# vandanarora18/edge-avoidance-bot architecture

> Architecture diagram of the GitHub repository vandanarora18/edge-avoidance-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vandanarora18/edge-avoidance-bot
- Repository: https://github.com/vandanarora18/edge-avoidance-bot

## Overview

This ROS 2 workspace simulates a differential-drive robot and documents an autonomous edge-avoidance behavior: launch the simulated robot, provide LiDAR scans, detect a cliff, and command recovery motion through the drive controller. The principal packages cover robot modeling, simulation and sensor bridging, controller setup, and the Python behavior node. The launch excerpt comments out the edge-avoidance node, so the documented behavior is not active in that launch as shown. Model, world, RViz, and controller internals were not sampled; their paths and roles are based on the README and file tree.

Main entry points: [`src/bot_description/launch/gazebo.launch.py`](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_description/launch/gazebo.launch.py) (Gazebo Launch), [`src/bot_bringup/launch/simulated_robot.launch.py`](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_bringup/launch/simulated_robot.launch.py) (Simulation Launch), [`src/bot_controller/launch/controller.launch.py`](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_controller/launch/controller.launch.py) (Controller Launch), [`src/bot_script/bot_script/edge_detection.py`](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_script/bot_script/edge_detection.py) (Edge Avoidance Node)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Simulation Orchestration"]
  node_bringup["Simulation Launch"]
  node_gazebo_launch["Gazebo Launch<br/>[gazebo.launch.py]"]
  node_gazebo["Gazebo Simulation"]
  node_spawn["Robot Spawner"]
  node_bridge["ROS-Gazebo Bridge"]
  node_rviz["RViz Display<br/>[display.launch.py]"]
end

subgraph group_model["Robot Model"]
  node_robot_model["Robot Model"]
  node_worlds["Gazebo Worlds"]
  node_state_publisher["State Publisher"]
  node_lidar["LiDAR Scan"]
end

subgraph group_control["Motion Control"]
  node_controller_launch["Controller Launch"]
  node_controller_config["Controller Config"]
  node_controller_manager["Controller Manager"]
  node_drive_controller["Differential Drive"]
end

subgraph group_behavior["Edge Avoidance"]
  node_edge_node["Edge Avoidance Node<br/>[edge_detection.py]"]
  node_scan_topic["/scan"]
  node_velocity_topic["Velocity Commands"]
end

node_operator(("Operator"))

node_operator -->|"launches"| node_bringup
node_bringup -->|"includes"| node_gazebo_launch
node_bringup -->|"includes"| node_controller_launch
node_bringup -->|"starts"| node_rviz
node_gazebo_launch -->|"loads"| node_robot_model
node_gazebo_launch -->|"selects"| node_worlds
node_gazebo_launch -->|"starts"| node_state_publisher
node_gazebo_launch -->|"starts"| node_gazebo
node_gazebo_launch -->|"starts"| node_spawn
node_gazebo_launch -->|"starts"| node_bridge
node_spawn -->|"reads description"| node_state_publisher
node_bridge -->|"bridges scan"| node_scan_topic
node_lidar -.->|"publishes scan"| node_bridge
node_controller_launch -->|"spawns controllers"| node_controller_manager
node_controller_config -.->|"configures"| node_drive_controller
node_scan_topic -->|"feeds scans"| node_edge_node
node_edge_node -->|"publishes commands"| node_velocity_topic
node_velocity_topic -.->|"commands motion"| node_drive_controller
node_drive_controller -.->|"drives robot"| node_gazebo

click node_bringup "https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_bringup/launch/simulated_robot.launch.py"
click node_gazebo_launch "https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_description/launch/gazebo.launch.py"
click node_rviz "https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_description/launch/display.launch.py"
click node_robot_model "https://github.com/vandanarora18/edge-avoidance-bot/tree/main/src/bot_description/urdf"
click node_worlds "https://github.com/vandanarora18/edge-avoidance-bot/tree/main/src/bot_description/worlds"
click node_controller_launch "https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_controller/launch/controller.launch.py"
click node_controller_config "https://github.com/vandanarora18/edge-avoidance-bot/tree/main/src/bot_controller/config"
click node_edge_node "https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_script/bot_script/edge_detection.py"

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_bringup,node_gazebo_launch,node_gazebo,node_spawn,node_bridge,node_rviz toneBlue
class node_robot_model,node_worlds,node_state_publisher,node_lidar toneAmber
class node_controller_launch,node_controller_config,node_controller_manager,node_drive_controller toneMint
class node_edge_node,node_scan_topic,node_velocity_topic toneRose
class node_operator toneIndigo
```

## Components

### Simulation Orchestration

- [Simulation Launch](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_bringup/launch/simulated_robot.launch.py): `src/bot_bringup/launch/simulated_robot.launch.py`
- [Gazebo Launch](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_description/launch/gazebo.launch.py): `src/bot_description/launch/gazebo.launch.py`
- **Gazebo Simulation**
- **Robot Spawner**
- **ROS-Gazebo Bridge**
- [RViz Display](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_description/launch/display.launch.py): `src/bot_description/launch/display.launch.py`

### Robot Model

- [Robot Model](https://github.com/vandanarora18/edge-avoidance-bot/tree/main/src/bot_description/urdf): `src/bot_description/urdf`
- [Gazebo Worlds](https://github.com/vandanarora18/edge-avoidance-bot/tree/main/src/bot_description/worlds): `src/bot_description/worlds`
- **State Publisher**
- **LiDAR Scan**

### Motion Control

- [Controller Launch](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_controller/launch/controller.launch.py): `src/bot_controller/launch/controller.launch.py`
- [Controller Config](https://github.com/vandanarora18/edge-avoidance-bot/tree/main/src/bot_controller/config): `src/bot_controller/config`
- **Controller Manager**
- **Differential Drive**

### Edge Avoidance

- [Edge Avoidance Node](https://github.com/vandanarora18/edge-avoidance-bot/blob/main/src/bot_script/bot_script/edge_detection.py): `src/bot_script/bot_script/edge_detection.py`
- **/scan**
- **Velocity Commands**

### Other components

- **Operator**

## Connections

- Operator → Simulation Launch: launches (evidence: `README.md`)
- Simulation Launch → Gazebo Launch: includes (evidence: `src/bot_bringup/launch/simulated_robot.launch.py`)
- Simulation Launch → Controller Launch: includes (evidence: `src/bot_bringup/launch/simulated_robot.launch.py`)
- Simulation Launch → RViz Display: starts (evidence: `src/bot_bringup/launch/simulated_robot.launch.py`)
- Gazebo Launch → Robot Model: loads (evidence: `src/bot_description/launch/gazebo.launch.py`)
- Gazebo Launch → Gazebo Worlds: selects (evidence: `src/bot_description/launch/gazebo.launch.py`)
- Gazebo Launch → State Publisher: starts (evidence: `src/bot_description/launch/gazebo.launch.py`)
- Gazebo Launch → Gazebo Simulation: starts (evidence: `src/bot_description/launch/gazebo.launch.py`)
- Gazebo Launch → Robot Spawner: starts (evidence: `src/bot_description/launch/gazebo.launch.py`)
- Gazebo Launch → ROS-Gazebo Bridge: starts (evidence: `src/bot_description/launch/gazebo.launch.py`)
- Robot Spawner → State Publisher: reads description
- ROS-Gazebo Bridge → /scan: bridges scan
- LiDAR Scan → ROS-Gazebo Bridge: publishes scan
- Controller Launch → Controller Manager: spawns controllers (evidence: `src/bot_controller/launch/controller.launch.py`)
- Controller Config → Differential Drive: configures
- /scan → Edge Avoidance Node: feeds scans (evidence: `src/bot_script/bot_script/edge_detection.py`)
- Edge Avoidance Node → Velocity Commands: publishes commands (evidence: `src/bot_script/bot_script/edge_detection.py`)
- Velocity Commands → Differential Drive: commands motion
- Differential Drive → Gazebo Simulation: drives robot
