# ibo-asv/njord2026_ws architecture

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

- Interactive diagram: https://gitdiagram.com/ibo-asv/njord2026_ws
- Repository: https://github.com/ibo-asv/njord2026_ws

## Overview

#### Purpose and execution model
This is a ROS 2 colcon workspace for an autonomous surface vessel (ASV): sensor ingestion, localization, perception, Nav2-based navigation, behavior-tree task control, thruster actuation, diagnostics, and task simulations. Primary integrated entry points are `src/robot/launch/all.launch.py`, `src/robot/launch/localization.launch.py`, and `src/robot/launch/navigation.launch.py`.

#### System integration and coordinate boundary
The `robot` package is the deployment composition layer: it owns the vessel URDF/TF setup, robot-localization EKF parameters, Nav2 parameters, and launch-level assembly. The coordinate convention is ENU, with `base_link` at the vessel; localization is expected to establish map/odom/base transforms before Nav2 operates.
- `src/robot/launch/static_transform_publisher.launch.py`
- `src/robot/urdf/robot.urdf.xacro`
- `src/robot/config/ekf_global.yaml`

#### Hardware and actuator boundary
ROS nodes isolate physical interfaces for GNSS, camera, LiDAR, IMU, battery/CAN, and propulsion. GNSS drivers support multiple receiver families; UM982 is a serial protocol implementation. The propulsion path terminates at a thruster driver that includes thrust allocation, separating high-level velocity commands from motor-level outputs.
- `src/driver/gnss/um982_driver/src/node.cpp`
- `src/driver/micon/thruster_driver/src/allocation.cpp`
- `src/driver/micon/thruster_driver/launch/thruster_driver.launch.py`

#### Localization and navigation
GNSS/IMU-derived pose and TF feed Nav2. Navigation accepts configured waypoints, represents detected buoys/field boundaries as obstacle data, plans/replans through Nav2 costmaps, and smooths paths through optional spline plugins/nodes. Navigation configuration is task-specific, rather than embedded in planning code.
- `src/robot/launch/nav2.launch.py`
- `src/navigation/path_generator/waypoint_publisher/waypoint_publisher/waypoint_publisher_node.py`
- `src/navigation/buoy_obstacle_publisher/buoy_obstacle_publisher/buoy_obstacle_publisher_node.py`

#### Perception pipeline
Two principal perception routes exist: point-cloud buoy detection and Python YOLO image inference. The ZED ROS wrapper and a local ZED2i driver provide camera integration; LiDAR support is vendored under drivers. Perception outputs are intended to become navigation-relevant buoy/obstacle information, but this is a ROS topic boundary rather than a direct library dependency.
- `src/detection/pcl_det/src/pcl_bouy_det_node.cpp`
- `src/detection/yolo/yolo/main.py`
- `src/driver/camera/zed2i_driver/src/cpu_stereo_node.cpp`

#### Mission behavior and interfaces
Mission-level control uses BehaviorTree XML task definitions and custom BT actions. `system_manager` is the C++ executable coordinating tree execution; its navigation and system-configuration plugins bridge declarative task flow to ROS actions/services. Custom interfaces are deliberately limited to vessel-specific messages and the configuration action.
- `src/behavior/system_manager/src/main.cpp`
- `src/behavior/tree/task3.xml`
- `src/njord_interfaces/action/ConfigureSystem.action`

#### Simulation, health, and runtime dependencies
Simulation can replace vessel dynamics and inject sensor noise, while task-specific orchestrators create evaluation scenarios. Diagnostics monitor topic heartbeats. The primary target is ROS 2 Humble on Ubuntu 22.04 with Nav2 and `robot_localization`; ZED requires the Stereolabs SDK/CUDA. Jetson YOLO runs in an isolated Python venv to avoid ROS/ZED NumPy and OpenCV conflicts. Foxglove is the recommended ROS visualization client.
- `src/sim/dutyed_tf_pub_with_disturbance/launch/sim_dynamics.launch.py`
- `src/sim/task3_sim/task3_sim/orchestrator.py`
- `src/diagnostics/diagnostic_monitors/src/topic_heartbeat_monitor_node.cpp`

Main entry points: [`src/robot/launch/all.launch.py`](https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/launch/all.launch.py) (Integrated launch), [`src/robot/config/ekf_global.yaml`](https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/config/ekf_global.yaml) (Global EKF), [`src/behavior/system_manager/src/main.cpp`](https://github.com/ibo-asv/njord2026_ws/blob/master/src/behavior/system_manager/src/main.cpp) (System manager), [`src/navigation/buoy_obstacle_publisher/buoy_obstacle_publisher/buoy_obstacle_publisher_node.py`](https://github.com/ibo-asv/njord2026_ws/blob/master/src/navigation/buoy_obstacle_publisher/buoy_obstacle_publisher/buoy_obstacle_publisher_node.py) (Buoy obstacle publisher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Robot deployment"]
  node_all_launch["Integrated launch<br/>ROS launch<br/>[all.launch.py]"]
  node_robot_model["Vessel URDF / TF<br/>robot model<br/>[robot.urdf.xacro]"]
  node_static_tf["Static transforms<br/>TF launch"]
  node_ekf["Global EKF<br/>robot_localization<br/>[ekf_global.yaml]"]
end

subgraph group_hardware["Hardware interfaces"]
  node_thruster_launch["Thruster driver<br/>actuator launch"]
  node_thrust_allocation["Thrust allocation<br/>actuator control<br/>[allocation.cpp]"]
  node_vessel_hardware{{"Vessel hardware<br/>sensors and motors"}}
  node_um982["UM982 GNSS driver<br/>GNSS node<br/>[node.cpp]"]
  node_zed_driver["ZED2i driver<br/>camera node"]
end

subgraph group_perception["Perception"]
  node_pcl_buoy["Point-cloud buoy detection<br/>LiDAR perception"]
  node_yolo["YOLO inference<br/>image perception<br/>[main.py]"]
end

subgraph group_autonomy["Navigation"]
  node_nav2_launch["Nav2 launch<br/>ROS launch<br/>[nav2.launch.py]"]
  node_waypoints["Waypoint publisher<br/>navigation node"]
  node_obstacles["Buoy obstacle publisher<br/>navigation node"]
  node_nav2["Nav2 planner and costmaps<br/>navigation stack"]
end

subgraph group_mission["Mission and operations"]
  node_system_manager["System manager<br/>BT executor<br/>[main.cpp]"]
  node_task_tree["Task 3 behavior tree<br/>BT XML<br/>[task3.xml]"]
  node_configure_action["ConfigureSystem action<br/>custom ROS action"]
end

subgraph group_simulation["Simulation and health"]
  node_sim_dynamics["Simulation dynamics<br/>simulator launch"]
  node_task_orchestrator["Task simulation orchestrator<br/>scenario runner<br/>[orchestrator.py]"]
  node_heartbeat_monitor["Topic heartbeat monitor<br/>diagnostics node"]
end

node_all_launch -->|"loads"| node_robot_model
node_all_launch -->|"starts"| node_static_tf
node_all_launch -->|"starts"| node_ekf
node_all_launch -->|"starts"| node_nav2_launch
node_robot_model -->|"frame definitions"| node_static_tf
node_um982 -->|"GNSS pose"| node_ekf
node_vessel_hardware -->|"GNSS data"| node_um982
node_vessel_hardware -->|"camera data"| node_zed_driver
node_vessel_hardware -->|"IMU data"| node_ekf
node_ekf -->|"map/odom/base TF and pose"| node_nav2
node_nav2_launch -->|"configures"| node_nav2
node_waypoints -->|"navigation goals"| node_nav2
node_obstacles -->|"costmap obstacles"| node_nav2
node_pcl_buoy -.->|"buoy detections"| node_obstacles
node_zed_driver -->|"images"| node_yolo
node_yolo -.->|"buoy detections"| node_obstacles
node_nav2 -->|"velocity commands"| node_thruster_launch
node_thruster_launch -->|"runs"| node_thrust_allocation
node_thrust_allocation -->|"motor outputs"| node_vessel_hardware
node_task_tree -->|"defines mission"| node_system_manager
node_system_manager -->|"requests navigation"| node_waypoints
node_system_manager -->|"uses"| node_configure_action
node_task_orchestrator -->|"creates scenario"| node_sim_dynamics
node_sim_dynamics -.->|"replaces dynamics and sensors"| node_vessel_hardware
node_heartbeat_monitor -.->|"monitors runtime topics"| node_all_launch

click node_all_launch "https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/launch/all.launch.py"
click node_robot_model "https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/urdf/robot.urdf.xacro"
click node_static_tf "https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/launch/static_transform_publisher.launch.py"
click node_ekf "https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/config/ekf_global.yaml"
click node_nav2_launch "https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/launch/nav2.launch.py"
click node_waypoints "https://github.com/ibo-asv/njord2026_ws/blob/master/src/navigation/path_generator/waypoint_publisher/waypoint_publisher/waypoint_publisher_node.py"
click node_obstacles "https://github.com/ibo-asv/njord2026_ws/blob/master/src/navigation/buoy_obstacle_publisher/buoy_obstacle_publisher/buoy_obstacle_publisher_node.py"
click node_thruster_launch "https://github.com/ibo-asv/njord2026_ws/blob/master/src/driver/micon/thruster_driver/launch/thruster_driver.launch.py"
click node_thrust_allocation "https://github.com/ibo-asv/njord2026_ws/blob/master/src/driver/micon/thruster_driver/src/allocation.cpp"
click node_um982 "https://github.com/ibo-asv/njord2026_ws/blob/master/src/driver/gnss/um982_driver/src/node.cpp"
click node_zed_driver "https://github.com/ibo-asv/njord2026_ws/blob/master/src/driver/camera/zed2i_driver/src/cpu_stereo_node.cpp"
click node_pcl_buoy "https://github.com/ibo-asv/njord2026_ws/blob/master/src/detection/pcl_det/src/pcl_bouy_det_node.cpp"
click node_yolo "https://github.com/ibo-asv/njord2026_ws/blob/master/src/detection/yolo/yolo/main.py"
click node_system_manager "https://github.com/ibo-asv/njord2026_ws/blob/master/src/behavior/system_manager/src/main.cpp"
click node_task_tree "https://github.com/ibo-asv/njord2026_ws/blob/master/src/behavior/tree/task3.xml"
click node_configure_action "https://github.com/ibo-asv/njord2026_ws/blob/master/src/njord_interfaces/action/ConfigureSystem.action"
click node_sim_dynamics "https://github.com/ibo-asv/njord2026_ws/blob/master/src/sim/dutyed_tf_pub_with_disturbance/launch/sim_dynamics.launch.py"
click node_task_orchestrator "https://github.com/ibo-asv/njord2026_ws/blob/master/src/sim/task3_sim/task3_sim/orchestrator.py"
click node_heartbeat_monitor "https://github.com/ibo-asv/njord2026_ws/blob/master/src/diagnostics/diagnostic_monitors/src/topic_heartbeat_monitor_node.cpp"

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_all_launch,node_robot_model,node_static_tf,node_ekf toneBlue
class node_thruster_launch,node_thrust_allocation,node_vessel_hardware,node_um982,node_zed_driver toneAmber
class node_pcl_buoy,node_yolo toneMint
class node_nav2_launch,node_waypoints,node_obstacles,node_nav2 toneRose
class node_system_manager,node_task_tree,node_configure_action toneIndigo
class node_sim_dynamics,node_task_orchestrator,node_heartbeat_monitor toneTeal
```

## Components

### Robot deployment

- [Integrated launch](https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/launch/all.launch.py): ROS launch · Composes the vessel runtime. · `src/robot/launch/all.launch.py`
- [Vessel URDF / TF](https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/urdf/robot.urdf.xacro): robot model · Defines the base_link vessel frame. · `src/robot/urdf/robot.urdf.xacro`
- [Static transforms](https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/launch/static_transform_publisher.launch.py): TF launch · `src/robot/launch/static_transform_publisher.launch.py`
- [Global EKF](https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/config/ekf_global.yaml): robot_localization · Establishes map/odom/base transforms in ENU. · `src/robot/config/ekf_global.yaml`

### Hardware interfaces

- [Thruster driver](https://github.com/ibo-asv/njord2026_ws/blob/master/src/driver/micon/thruster_driver/launch/thruster_driver.launch.py): actuator launch · Separates velocity commands from motor outputs. · `src/driver/micon/thruster_driver/launch/thruster_driver.launch.py`
- [Thrust allocation](https://github.com/ibo-asv/njord2026_ws/blob/master/src/driver/micon/thruster_driver/src/allocation.cpp): actuator control · `src/driver/micon/thruster_driver/src/allocation.cpp`
- **Vessel hardware**: sensors and motors · GNSS, IMU, LiDAR, camera, battery/CAN, and thrusters.
- [UM982 GNSS driver](https://github.com/ibo-asv/njord2026_ws/blob/master/src/driver/gnss/um982_driver/src/node.cpp): GNSS node · Serial receiver protocol implementation. · `src/driver/gnss/um982_driver/src/node.cpp`
- [ZED2i driver](https://github.com/ibo-asv/njord2026_ws/blob/master/src/driver/camera/zed2i_driver/src/cpu_stereo_node.cpp): camera node · `src/driver/camera/zed2i_driver/src/cpu_stereo_node.cpp`

### Perception

- [Point-cloud buoy detection](https://github.com/ibo-asv/njord2026_ws/blob/master/src/detection/pcl_det/src/pcl_bouy_det_node.cpp): LiDAR perception · `src/detection/pcl_det/src/pcl_bouy_det_node.cpp`
- [YOLO inference](https://github.com/ibo-asv/njord2026_ws/blob/master/src/detection/yolo/yolo/main.py): image perception · Runs in an isolated Jetson Python environment. · `src/detection/yolo/yolo/main.py`

### Navigation

- [Nav2 launch](https://github.com/ibo-asv/njord2026_ws/blob/master/src/robot/launch/nav2.launch.py): ROS launch · Starts configured Nav2 navigation. · `src/robot/launch/nav2.launch.py`
- [Waypoint publisher](https://github.com/ibo-asv/njord2026_ws/blob/master/src/navigation/path_generator/waypoint_publisher/waypoint_publisher/waypoint_publisher_node.py): navigation node · `src/navigation/path_generator/waypoint_publisher/waypoint_publisher/waypoint_publisher_node.py`
- [Buoy obstacle publisher](https://github.com/ibo-asv/njord2026_ws/blob/master/src/navigation/buoy_obstacle_publisher/buoy_obstacle_publisher/buoy_obstacle_publisher_node.py): navigation node · Publishes buoy and field-boundary obstacle data. · `src/navigation/buoy_obstacle_publisher/buoy_obstacle_publisher/buoy_obstacle_publisher_node.py`
- **Nav2 planner and costmaps**: navigation stack · Plans and replans around obstacle data.

### Mission and operations

- [System manager](https://github.com/ibo-asv/njord2026_ws/blob/master/src/behavior/system_manager/src/main.cpp): BT executor · Coordinates behavior-tree task execution. · `src/behavior/system_manager/src/main.cpp`
- [Task 3 behavior tree](https://github.com/ibo-asv/njord2026_ws/blob/master/src/behavior/tree/task3.xml): BT XML · Declarative mission flow. · `src/behavior/tree/task3.xml`
- [ConfigureSystem action](https://github.com/ibo-asv/njord2026_ws/blob/master/src/njord_interfaces/action/ConfigureSystem.action): custom ROS action · Vessel-specific configuration interface. · `src/njord_interfaces/action/ConfigureSystem.action`

### Simulation and health

- [Simulation dynamics](https://github.com/ibo-asv/njord2026_ws/blob/master/src/sim/dutyed_tf_pub_with_disturbance/launch/sim_dynamics.launch.py): simulator launch · Can replace vessel dynamics and inject sensor noise. · `src/sim/dutyed_tf_pub_with_disturbance/launch/sim_dynamics.launch.py`
- [Task simulation orchestrator](https://github.com/ibo-asv/njord2026_ws/blob/master/src/sim/task3_sim/task3_sim/orchestrator.py): scenario runner · `src/sim/task3_sim/task3_sim/orchestrator.py`
- [Topic heartbeat monitor](https://github.com/ibo-asv/njord2026_ws/blob/master/src/diagnostics/diagnostic_monitors/src/topic_heartbeat_monitor_node.cpp): diagnostics node · `src/diagnostics/diagnostic_monitors/src/topic_heartbeat_monitor_node.cpp`

## Connections

- Integrated launch → Vessel URDF / TF: loads
- Integrated launch → Static transforms: starts
- Integrated launch → Global EKF: starts
- Integrated launch → Nav2 launch: starts
- Vessel URDF / TF → Static transforms: frame definitions
- UM982 GNSS driver → Global EKF: GNSS pose
- Vessel hardware → UM982 GNSS driver: GNSS data
- Vessel hardware → ZED2i driver: camera data
- Vessel hardware → Global EKF: IMU data
- Global EKF → Nav2 planner and costmaps: map/odom/base TF and pose
- Nav2 launch → Nav2 planner and costmaps: configures
- Waypoint publisher → Nav2 planner and costmaps: navigation goals
- Buoy obstacle publisher → Nav2 planner and costmaps: costmap obstacles
- Point-cloud buoy detection → Buoy obstacle publisher: buoy detections · ROS topic boundary.
- ZED2i driver → YOLO inference: images
- YOLO inference → Buoy obstacle publisher: buoy detections · ROS topic boundary.
- Nav2 planner and costmaps → Thruster driver: velocity commands
- Thruster driver → Thrust allocation: runs
- Thrust allocation → Vessel hardware: motor outputs
- Task 3 behavior tree → System manager: defines mission
- System manager → Waypoint publisher: requests navigation
- System manager → ConfigureSystem action: uses
- Task simulation orchestrator → Simulation dynamics: creates scenario
- Simulation dynamics → Vessel hardware: replaces dynamics and sensors
- Topic heartbeat monitor → Integrated launch: monitors runtime topics
