# amansour5/self_driving_car architecture

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

- Interactive diagram: https://gitdiagram.com/amansour5/self_driving_car
- Repository: https://github.com/amansour5/self_driving_car

## Overview

This repository provides a ROS 2 vehicle-control and monitoring interface: a browser dashboard connects over rosbridge, displays compressed camera feeds, and publishes control mode and joystick input. Camera conversion is implemented in a ROS node; a separate node launches an HTTP MJPEG server using a configured web root. Control-side camera publishing is registered as an executable, but its implementation was not sampled, so its downstream behavior is omitted. The tree and excerpts do not establish how the control node consumes the dashboard's messages.

Main entry points: [`src/gui/gui/guiContent/app.js`](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/app.js) (Dashboard UI), [`src/gui/gui/nodes/GUIStreamingNode.py`](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/nodes/GUIStreamingNode.py) (HTTP GUI streamer), [`src/gui/gui/nodes/CameraStreamingNode.py`](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/nodes/CameraStreamingNode.py) (JPEG conversion), [`src/control/control/nodes/carla_test.py`](https://github.com/amansour5/self_driving_car/blob/main/src/control/control/nodes/carla_test.py) (CARLA camera publisher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser dashboard"]
  node_dashboard["Dashboard UI<br/>[app.js]"]
  node_webroot["Dashboard assets<br/>[index.html]"]
  node_control_input["Mode and joystick<br/>[app.js]"]
  node_camera_view["Camera panels<br/>[app.js]"]
end

subgraph group_ros["ROS streaming"]
  node_rosbridge["ROS bridge"]
  node_camera_convert["JPEG conversion"]
  node_camera_topics["Camera image topics"]
  node_compressed_topics["Compressed image topics"]
  node_gui_server["HTTP GUI streamer"]
  node_mjpg["MJPEG server"]
  node_carla_publisher["CARLA camera publisher<br/>[carla_test.py]"]
end

subgraph group_config["Configuration"]
  node_env_params["Environment parameters<br/>[EnvParams.py]"]
end

node_operator(("Vehicle operator"))

node_operator -->|"uses"| node_dashboard
node_dashboard -.->|"loads"| node_webroot
node_dashboard -->|"connects"| node_rosbridge
node_dashboard -->|"publishes"| node_control_input
node_control_input -->|"sends topics"| node_rosbridge
node_rosbridge -->|"delivers"| node_compressed_topics
node_compressed_topics -->|"renders frames"| node_camera_view
node_camera_topics -->|"subscribes"| node_camera_convert
node_camera_convert -->|"publishes JPEG"| node_compressed_topics
node_gui_server -->|"reads settings"| node_env_params
node_gui_server -->|"runs server"| node_mjpg
node_carla_publisher -.->|"publishes"| node_camera_topics

click node_dashboard "https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/app.js"
click node_webroot "https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/index.html"
click node_control_input "https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/app.js"
click node_camera_view "https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/app.js"
click node_camera_convert "https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/nodes/CameraStreamingNode.py"
click node_gui_server "https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/nodes/GUIStreamingNode.py"
click node_carla_publisher "https://github.com/amansour5/self_driving_car/blob/main/src/control/control/nodes/carla_test.py"
click node_env_params "https://github.com/amansour5/self_driving_car/blob/main/src/utils/utils/EnvParams.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_dashboard,node_webroot,node_control_input,node_camera_view toneBlue
class node_rosbridge,node_camera_convert,node_camera_topics,node_compressed_topics,node_gui_server,node_mjpg,node_carla_publisher toneAmber
class node_env_params toneMint
class node_operator toneIndigo
```

## Components

### Browser dashboard

- [Dashboard UI](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/app.js): `src/gui/gui/guiContent/app.js`
- [Dashboard assets](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/index.html): `src/gui/gui/guiContent/index.html`
- [Mode and joystick](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/app.js): `src/gui/gui/guiContent/app.js`
- [Camera panels](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/guiContent/app.js): `src/gui/gui/guiContent/app.js`

### ROS streaming

- **ROS bridge**
- [JPEG conversion](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/nodes/CameraStreamingNode.py): `src/gui/gui/nodes/CameraStreamingNode.py`
- **Camera image topics**
- **Compressed image topics**
- [HTTP GUI streamer](https://github.com/amansour5/self_driving_car/blob/main/src/gui/gui/nodes/GUIStreamingNode.py): `src/gui/gui/nodes/GUIStreamingNode.py`
- **MJPEG server**
- [CARLA camera publisher](https://github.com/amansour5/self_driving_car/blob/main/src/control/control/nodes/carla_test.py): `src/control/control/nodes/carla_test.py`

### Configuration

- [Environment parameters](https://github.com/amansour5/self_driving_car/blob/main/src/utils/utils/EnvParams.py): `src/utils/utils/EnvParams.py`

### Other components

- **Vehicle operator**

## Connections

- Vehicle operator → Dashboard UI: uses (evidence: `src/gui/gui/guiContent/app.js`)
- Dashboard UI → Dashboard assets: loads
- Dashboard UI → ROS bridge: connects (evidence: `src/gui/gui/guiContent/app.js`)
- Dashboard UI → Mode and joystick: publishes (evidence: `src/gui/gui/guiContent/app.js`)
- Mode and joystick → ROS bridge: sends topics (evidence: `src/gui/gui/guiContent/app.js`)
- ROS bridge → Compressed image topics: delivers
- Compressed image topics → Camera panels: renders frames (evidence: `src/gui/gui/guiContent/app.js`)
- Camera image topics → JPEG conversion: subscribes (evidence: `src/gui/gui/nodes/CameraStreamingNode.py`)
- JPEG conversion → Compressed image topics: publishes JPEG (evidence: `src/gui/gui/nodes/CameraStreamingNode.py`)
- HTTP GUI streamer → Environment parameters: reads settings (evidence: `src/gui/gui/nodes/GUIStreamingNode.py`)
- HTTP GUI streamer → MJPEG server: runs server (evidence: `src/gui/gui/nodes/GUIStreamingNode.py`)
- CARLA camera publisher → Camera image topics: publishes
