Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions doc/architecture/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# Architecture Documentation

This section describes the architecture of the racecar system.

## Overview

The system is built using a modular ROS2 architecture that supports both:

- Simulation (Gazebo)
- Real vehicle hardware (Racecar)

The same control flow is reused for both environments.

---

## Architecture Diagrams

- [System Context](context.md)
High-level view of how the system interacts with users and external systems.

- [Component Map](components.md)
Internal structure of the system and relationships between modules.

- [Sequence Diagram](sequences.md)
Step-by-step of the most complex core logic flow through the system.

---

98 changes: 98 additions & 0 deletions doc/architecture/components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@

# Component Map

This diagram shows the relationship between the major modules of the system.

```mermaid

flowchart LR

User[User]

%% --------------------
%% INPUT INTERFACES
%% --------------------
subgraph Input [Input Interfaces]
Control["(Joystick / Web Interface)"]
end

%% --------------------
%% ROS SYSTEM
%% --------------------
subgraph ROS [ROS2 System]
direction LR
%% Control (grouped)
subgraph Controls [Arduino Motor Controls]
direction LR
SpeedControl[SpeedControl]
PositionControl[PositionControl]
Openloop[Openloop]
end

%% Perception
subgraph Perception [Perception]
Lidar[Lidar]
Camera[Camera]
end

%% Odometry / state
subgraph State [Odometry]
direction LR
IMU[IMU]
Encoder[Wheel Encoder]
Steering[Steering Angle]
end

%% Navigation / decision
subgraph Navigation [Navigation Algorithms]
direction LR
SLAM[SLAM]
Blob[Blob Detection]
Brushfire[Brushfire]
Autopilot[Autopilot]
end

end

%% --------------------
%% EXECUTION
%% --------------------
subgraph Execution [Execution Systems]
direction LR
Racecar[Racecar]
Gazebo[Gazebo Simulation]
end
%% --------------------
%% MONITORING INTERFACES
%% --------------------

subgraph Monitoring [Monitoring and Tools]
direction LR
RViz[RViz]
RQt[RQt]
ROS2Bag[ROS2Bag]
end

ROS --> Monitoring

%% --------------------
%% FLOW
%% --------------------

%% Inputs into system
User --> Input
Input --> ROS

%% Sensor pipeline
State --> Navigation
State --> Controls
Perception --> Navigation


%% Navigation feeds control
Navigation --> Controls

%% Brushfire separate (map-level)

%% Control outputs
ROS --> Execution
39 changes: 39 additions & 0 deletions doc/architecture/context.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

# System Context

This diagram shows how the system interacts with external actors such as the user and the simulation environment.

```mermaid

flowchart LR

User[User]

subgraph Input [Input Interfaces]
Control["(Joystick / Web Interface)"]
end

subgraph Core [ROS2 System]
ROS[ROS2 Nodes]
end

subgraph Execution [Execution Systems]
Gazebo["Simulation (Gazebo)"]
Hardware[Racecar]
end

User --> Control
Control --> ROS
ROS --> Gazebo
ROS --> Hardware











39 changes: 39 additions & 0 deletions doc/architecture/sequences.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Sequence Diagram

This diagram illustrates the most complex core logic flow of the system during autonomous operation.

```mermaid
sequenceDiagram

participant Sensors
participant ROS2
participant Navigation as Navigation and SLAM
participant Blob as Blob Detection
participant Autopilot
participant Arduino

%% Initialization
ROS2->>Navigation: load map and initialize path

%% Continuous loop
loop Autonomous Navigation

Sensors->>ROS2: publish sensor data (lidar, camera, imu, encoder)

%% Localization and navigation
ROS2->>Navigation: send lidar and odometry
Navigation->>ROS2: position estimate

%% Blob detection
ROS2->>Blob: send lidar and camera data
Blob->>ROS2: detected balloons

%% Autopilot (reactive wall avoidance)
ROS2->>Autopilot: send lidar data
Autopilot->>ROS2: generate steering and speed commands

%% Execution
ROS2->>Arduino: send control commands
Arduino-->>ROS2: odometry feedback

end
Loading