# fsc-lab/fsc_octorotor_simulation_ros2 architecture

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

- Interactive diagram: https://gitdiagram.com/fsc-lab/fsc_octorotor_simulation_ros2
- Repository: https://github.com/fsc-lab/fsc_octorotor_simulation_ros2

## Overview

This repository provides a Tarot T18 forest-monitoring simulation and two ways to command the simulated aircraft: QGroundControl missions or ROS 2 offboard waypoint following. In the ROS 2 route, the controller generates and tracks a smooth trajectory, sends PX4 commands over the XRCE-DDS link, and can visualize flight status; PX4 drives the Gazebo aircraft in the forest world. The tree-placement script and camera receiver are supporting runtime capabilities. Wiring beyond the README and sampled controller excerpts is not assumed.

Main entry points: [`ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py`](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py) (Offboard controller), [`gazebo/gazebo_world/customforest.sdf`](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/gazebo/gazebo_world/customforest.sdf) (Forest world), [`ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/gzcam.py`](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/gzcam.py) (Gazebo camera receiver), [`gazebo/gazebo_world/tree_coordinates.py`](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/gazebo/gazebo_world/tree_coordinates.py) (Tree layout generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Flight control"]
  node_qgc["QGroundControl"]
  node_controller["Offboard controller"]
  node_waypoint_path["Trajectory planning"]
  node_flight_display["Flight visualization"]
end

subgraph group_simulation["Simulation scene"]
  node_gazebo["Gazebo simulator"]
  node_forest_world["Forest world<br/>[customforest.sdf]"]
  node_t18_model["T18 models"]
  node_camera_model["Camera variant"]
  node_tree_model["Pine tree model"]
  node_tree_layout["Tree layout generator"]
end

subgraph group_bridge["Vehicle integration"]
  node_px4["PX4 SITL"]
  node_airframe["T18 airframe"]
  node_px4_msgs["PX4 ROS messages"]
  node_xrce["Micro XRCE-DDS Agent"]
end

subgraph group_sensing["Monitoring"]
  node_camera_receiver["Gazebo camera receiver<br/>[gzcam.py]"]
  node_camera_topic["Gazebo camera stream"]
end

node_operator(("Mission operator"))

node_operator -.->|"plans mission"| node_qgc
node_qgc -.->|"uploads mission"| node_px4
node_operator -->|"starts node"| node_controller
node_controller -->|"generates trajectory"| node_waypoint_path
node_controller -->|"uses message definitions"| node_px4_msgs
node_controller -->|"sends commands"| node_xrce
node_xrce -->|"transports DDS"| node_px4
node_px4 -->|"publishes vehicle state"| node_xrce
node_xrce -->|"delivers state"| node_controller
node_airframe -->|"configures vehicle"| node_px4
node_px4 -->|"controls simulated vehicle"| node_gazebo
node_gazebo -->|"returns simulation data"| node_px4
node_gazebo -->|"loads world"| node_forest_world
node_gazebo -->|"loads model"| node_t18_model
node_gazebo -.->|"loads optional model"| node_camera_model
node_forest_world -->|"includes trees"| node_tree_model
node_tree_layout -.->|"emits tree includes"| node_forest_world
node_controller -->|"starts camera thread"| node_camera_receiver
node_camera_receiver -->|"subscribes"| node_camera_topic
node_gazebo -.->|"publishes images"| node_camera_topic
node_controller -->|"updates visualization"| node_flight_display

click node_controller "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py"
click node_waypoint_path "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py"
click node_flight_display "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py"
click node_airframe "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/px4_airframe_configuration/4012_gz_t18"
click node_px4_msgs "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/tree/main/ros2_node/src/px4_msgs"
click node_forest_world "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/gazebo/gazebo_world/customforest.sdf"
click node_t18_model "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/tree/main/gazebo/gazebo_model/t18"
click node_camera_model "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/tree/main/gazebo/gazebo_model/t18_mono_cam"
click node_tree_model "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/tree/main/gazebo/gazebo_model/Pine%20Tree"
click node_tree_layout "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/gazebo/gazebo_world/tree_coordinates.py"
click node_camera_receiver "https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/gzcam.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_qgc,node_controller,node_waypoint_path,node_flight_display toneBlue
class node_gazebo,node_forest_world,node_t18_model,node_camera_model,node_tree_model,node_tree_layout toneAmber
class node_px4,node_airframe,node_px4_msgs,node_xrce toneMint
class node_camera_receiver,node_camera_topic toneRose
class node_operator toneIndigo
```

## Components

### Flight control

- **QGroundControl**
- [Offboard controller](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py): `ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py`
- [Trajectory planning](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py): `ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py`
- [Flight visualization](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py): `ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/offboard_ctrl_example.py`

### Simulation scene

- **Gazebo simulator**
- [Forest world](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/gazebo/gazebo_world/customforest.sdf): `gazebo/gazebo_world/customforest.sdf`
- [T18 models](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/tree/main/gazebo/gazebo_model/t18): `gazebo/gazebo_model/t18`
- [Camera variant](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/tree/main/gazebo/gazebo_model/t18_mono_cam): `gazebo/gazebo_model/t18_mono_cam`
- [Pine tree model](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/tree/main/gazebo/gazebo_model/Pine%20Tree): `gazebo/gazebo_model/Pine Tree`
- [Tree layout generator](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/gazebo/gazebo_world/tree_coordinates.py): `gazebo/gazebo_world/tree_coordinates.py`

### Vehicle integration

- **PX4 SITL**
- [T18 airframe](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/px4_airframe_configuration/4012_gz_t18): `px4_airframe_configuration/4012_gz_t18`
- [PX4 ROS messages](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/tree/main/ros2_node/src/px4_msgs): `ros2_node/src/px4_msgs`
- **Micro XRCE-DDS Agent**

### Monitoring

- [Gazebo camera receiver](https://github.com/fsc-lab/fsc_octorotor_simulation_ros2/blob/main/ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/gzcam.py): `ros2_node/src/my_offboard_ctrl/my_offboard_ctrl/gzcam.py`
- **Gazebo camera stream**

### Other components

- **Mission operator**

## Connections

- Mission operator → QGroundControl: plans mission
- QGroundControl → PX4 SITL: uploads mission
- Mission operator → Offboard controller: starts node
- Offboard controller → Trajectory planning: generates trajectory
- Offboard controller → PX4 ROS messages: uses message definitions
- Offboard controller → Micro XRCE-DDS Agent: sends commands
- Micro XRCE-DDS Agent → PX4 SITL: transports DDS
- PX4 SITL → Micro XRCE-DDS Agent: publishes vehicle state
- Micro XRCE-DDS Agent → Offboard controller: delivers state
- T18 airframe → PX4 SITL: configures vehicle
- PX4 SITL → Gazebo simulator: controls simulated vehicle
- Gazebo simulator → PX4 SITL: returns simulation data
- Gazebo simulator → Forest world: loads world
- Gazebo simulator → T18 models: loads model
- Gazebo simulator → Camera variant: loads optional model
- Forest world → Pine tree model: includes trees
- Tree layout generator → Forest world: emits tree includes
- Offboard controller → Gazebo camera receiver: starts camera thread
- Gazebo camera receiver → Gazebo camera stream: subscribes
- Gazebo simulator → Gazebo camera stream: publishes images
- Offboard controller → Flight visualization: updates visualization
