---
id: ARCH-03
title: Arquitectura de software
description: Distribución del software de Atlas X1 entre firmware, ROS 2, IA, aplicación de control y herramientas, con sus contratos. Estado propuesto.
category: arquitectura
tags: [arquitectura, software, c4]
status: en-desarrollo
version: 0.1.0
created: 2026-11-26
updated: 2026-11-26
responsible_agent: software-architect
validation_status: no-verificado
---

# Arquitectura de software (propuesta)

## Contenedores (C4 nivel 2)
```mermaid
flowchart LR
  subgraph esp["ESP32-S3 (C/C++, FreeRTOS)"]
    fw_safe["Supervisor de seguridad"]
    fw_ctl["Control de motores (PID por rueda)"]
    fw_com["Comunicación con la Pi"]
  end
  subgraph pi["Raspberry Pi 5 (ROS 2 Jazzy)"]
    hw["atlas_hardware"]
    safety["atlas_safety"]
    loco["atlas_locomotion"]
    perc["atlas_lidar · atlas_perception · atlas_sensors"]
    nav["atlas_mapping · atlas_navigation"]
    voice["atlas_voice / IA"]
    bridge["Backend de la app (FastAPI)"]
  end
  web["Frontend de la app (React/TS)"]
  web <--> bridge
  bridge --> safety
  voice --> safety
  nav --> loco
  loco --> safety
  safety --> hw <--> fw_com
  fw_com --> fw_safe --> fw_ctl
```

## Contratos principales (a definir)
| Contrato | Entre | Documento |
|---|---|---|
| Protocolo serie Pi ↔ ESP32-S3 | `atlas_hardware` ↔ firmware | [communications.md](communications.md) |
| Interfaces ROS 2 (topics, servicios, acciones) | Nodos | [ros2.md](ros2.md) |
| API y eventos de la app | Backend ↔ frontend | [application.md](application.md) |
| Intenciones de IA y voz | `atlas_voice` ↔ `atlas_safety` | [ai.md](ai.md) |

## Lenguajes por defecto
Según la skill `language-selection`: C/C++ en firmware y nodos exigentes; Python en orquestación, prototipos e IA;
TypeScript en la web; Node.js para las herramientas de ADH.
