# aech-7/ros2-slam-auto-navigation architecture

> Architecture diagram of the GitHub repository aech-7/ros2-slam-auto-navigation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aech-7/ros2-slam-auto-navigation
- Repository: https://github.com/aech-7/ros2-slam-auto-navigation

## Overview

This ROS 2 robot package supports simulated exploration and autonomous navigation: launch the robot in Gazebo, build or load a map, send goals through Nav2, and monitor the system in RViz. Its main stages are robot description and simulation, mapping/localization, navigation, and velocity control. The tree also includes standalone goal/waypoint clients and map-based rack detection. Some connections are explicit in the sampled launch files; Nav2, SLAM Toolbox, Gazebo, and controller internals are external dependencies, so their internal flows are not expanded.

Main entry points: [`launch/launch_sim.launch.py`](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/launch_sim.launch.py) (Simulation launch), [`launch/slam_navigation.launch.py`](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/slam_navigation.launch.py) (SLAM/navigation launch), [`launch/rsp.launch.py`](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/rsp.launch.py) (Robot state launch), [`cv/rack.py`](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/cv/rack.py) (Rack detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Robot and simulation"]
  node_sim_launch["Simulation launch"]
  node_rsp_launch["Robot state launch<br/>[rsp.launch.py]"]
  node_robot_model["Robot model<br/>[robot.urdf.xacro]"]
  node_gazebo["Gazebo"]
  node_world["Simulation world<br/>[simple.world]"]
  node_robot_state["Robot State Publisher"]
  node_controllers["Drive controllers"]
end

subgraph group_mapping["Mapping and localization"]
  node_slam_launch["SLAM/navigation launch"]
  node_slam_toolbox["SLAM Toolbox"]
  node_map_config["Saved map<br/>[mymap.yaml]"]
  node_ekf["EKF filter"]
end

subgraph group_navigation["Navigation and control"]
  node_nav2["Nav2"]
  node_rviz["RViz"]
  node_goal_client["Goal client<br/>[goal.py]"]
  node_waypoint_client["Waypoint client<br/>[waypoint.py]"]
  node_twist_mux["Velocity mux"]
end

subgraph group_analysis["Map analysis"]
  node_rack_detection["Rack detection<br/>[rack.py]"]
  node_map_assets["Map image and metadata<br/>[mymap3.pgm]"]
end

node_operator(("Operator"))

node_operator -->|"starts simulation"| node_sim_launch
node_sim_launch -->|"includes"| node_rsp_launch
node_rsp_launch -->|"processes description"| node_robot_model
node_rsp_launch -->|"starts"| node_robot_state
node_sim_launch -->|"starts with world"| node_gazebo
node_sim_launch -->|"loads"| node_world
node_sim_launch -->|"spawns robot"| node_gazebo
node_sim_launch -->|"starts spawners"| node_controllers
node_sim_launch -->|"starts"| node_twist_mux
node_twist_mux -->|"routes velocity commands"| node_controllers
node_operator -->|"starts mapping and navigation"| node_slam_launch
node_slam_launch -->|"includes"| node_slam_toolbox
node_slam_launch -->|"includes"| node_nav2
node_slam_launch -->|"starts"| node_ekf
node_slam_launch -->|"starts"| node_rviz
node_slam_toolbox -->|"builds map"| node_map_config
node_nav2 -->|"loads map"| node_map_config
node_operator -->|"sets navigation goal"| node_rviz
node_rviz -->|"sends goal"| node_nav2
node_goal_client -->|"sends pose goals"| node_nav2
node_waypoint_client -->|"sends waypoints"| node_nav2
node_operator -->|"runs analysis"| node_rack_detection
node_rack_detection -->|"reads image and metadata"| node_map_assets

click node_sim_launch "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/launch_sim.launch.py"
click node_rsp_launch "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/rsp.launch.py"
click node_robot_model "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/description/robot.urdf.xacro"
click node_world "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/worlds/simple.world"
click node_slam_launch "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/slam_navigation.launch.py"
click node_map_config "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/maps/mymap.yaml"
click node_goal_client "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/scripts/goal.py"
click node_waypoint_client "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/scripts/waypoint.py"
click node_twist_mux "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/launch_sim.launch.py"
click node_rack_detection "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/cv/rack.py"
click node_map_assets "https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/maps/mymap3.pgm"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sim_launch,node_rsp_launch,node_robot_model,node_gazebo,node_world,node_robot_state,node_controllers toneBlue
class node_slam_launch,node_slam_toolbox,node_map_config,node_ekf toneAmber
class node_nav2,node_rviz,node_goal_client,node_waypoint_client,node_twist_mux toneMint
class node_rack_detection,node_map_assets toneRose
class node_operator toneIndigo
```

## Components

### Robot and simulation

- [Simulation launch](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/launch_sim.launch.py): `launch/launch_sim.launch.py`
- [Robot state launch](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/rsp.launch.py): `launch/rsp.launch.py`
- [Robot model](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/description/robot.urdf.xacro): `description/robot.urdf.xacro`
- **Gazebo**
- [Simulation world](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/worlds/simple.world): `worlds/simple.world`
- **Robot State Publisher**
- **Drive controllers**

### Mapping and localization

- [SLAM/navigation launch](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/slam_navigation.launch.py): `launch/slam_navigation.launch.py`
- **SLAM Toolbox**
- [Saved map](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/maps/mymap.yaml): `maps/mymap.yaml`
- **EKF filter**

### Navigation and control

- **Nav2**
- **RViz**
- [Goal client](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/scripts/goal.py): `scripts/goal.py`
- [Waypoint client](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/scripts/waypoint.py): `scripts/waypoint.py`
- [Velocity mux](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/launch/launch_sim.launch.py): `launch/launch_sim.launch.py`

### Map analysis

- [Rack detection](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/cv/rack.py): `cv/rack.py`
- [Map image and metadata](https://github.com/aech-7/ros2-slam-auto-navigation/blob/master/maps/mymap3.pgm): `maps/mymap3.pgm`

### Other components

- **Operator**

## Connections

- Operator → Simulation launch: starts simulation
- Simulation launch → Robot state launch: includes
- Robot state launch → Robot model: processes description
- Robot state launch → Robot State Publisher: starts
- Simulation launch → Gazebo: starts with world
- Simulation launch → Simulation world: loads
- Simulation launch → Gazebo: spawns robot
- Simulation launch → Drive controllers: starts spawners
- Simulation launch → Velocity mux: starts
- Velocity mux → Drive controllers: routes velocity commands
- Operator → SLAM/navigation launch: starts mapping and navigation
- SLAM/navigation launch → SLAM Toolbox: includes
- SLAM/navigation launch → Nav2: includes
- SLAM/navigation launch → EKF filter: starts
- SLAM/navigation launch → RViz: starts
- SLAM Toolbox → Saved map: builds map
- Nav2 → Saved map: loads map
- Operator → RViz: sets navigation goal
- RViz → Nav2: sends goal
- Goal client → Nav2: sends pose goals
- Waypoint client → Nav2: sends waypoints
- Operator → Rack detection: runs analysis
- Rack detection → Map image and metadata: reads image and metadata
