ROS Packages
The ROS packages in this repository are connected mostly through a small set of
topic interfaces. The important idea is that perception publishes a map,
localization publishes odometry, mission_executor consumes both, and the
selected bridge sends the resulting thruster commands to either Stonefish or
real hardware.
Runtime Topic Graph
flowchart LR
bringup["bringup<br/>launch files + config"]
subgraph sim["Simulation path"]
stonefish["stonefish_ros2<br/>Stonefish simulator"]
bridge_assets["bridge_stonefish<br/>scenarios + assets"]
mocker["detection_mocker<br/>scenario perception"]
end
subgraph hw["Hardware path"]
proteus["bridge_hardware<br/>Proteus Arduino bridge"]
vectornav["vectornav<br/>IMU driver"]
usbcam["usb_cam<br/>camera driver"]
end
subgraph perception["Perception / localization"]
zed["zed_custom_wrapper<br/>ZED camera + object map"]
orb["orb_slam3_ros2<br/>visual / inertial odometry"]
end
interfaces["interfaces<br/>Map, MapObject, MovingState"]
executor["mission_executor<br/>missions + PID + TAM"]
joy["joy_node<br/>joystick"]
arduino["Arduino / thrusters"]
bringup --> stonefish
bringup --> mocker
bringup --> executor
bringup --> proteus
bringup --> vectornav
bringup --> usbcam
bringup --> orb
bridge_assets --> stonefish
stonefish -- "/bridge/odometry<br/>nav_msgs/Odometry" --> executor
stonefish -- "/bridge/imu<br/>sensor_msgs/Imu" --> orb
stonefish -- "camera topics<br/>sensor_msgs/Image" --> orb
stonefish -- "scenario pose + objects" --> mocker
mocker -- "/vision/map<br/>interfaces/Map" --> executor
mocker -. "MarkerArray debug topics" .-> interfaces
zed -- "zed/map<br/>interfaces/Map" --> interfaces
zed -- "zed/odom<br/>nav_msgs/Odometry" --> interfaces
zed -- "zed/rgb, zed/depth<br/>sensor_msgs/Image" --> orb
zed -- "zed/objects<br/>zed_msgs/ObjectsStamped" --> interfaces
orb -- "orb_slam3/camera_odom<br/>nav_msgs/Odometry" --> interfaces
vectornav -- "/vectornav/imu<br/>sensor_msgs/Imu" --> orb
usbcam -- "/usb_cam/image_raw<br/>sensor_msgs/Image" --> orb
joy -- "/joy<br/>sensor_msgs/Joy" --> executor
interfaces --> executor
executor -- "/bridge/thrusters<br/>std_msgs/Float64MultiArray" --> stonefish
executor -- "/bridge/thrusters<br/>std_msgs/Float64MultiArray" --> proteus
proteus --> arduino
Custom Interfaces
The interfaces package defines the project-specific messages that sit
between perception and mission planning. Keep this package small and stable:
any change here affects the nodes that publish maps and the nodes that consume
maps.
interfaces/msg/Map
vision_msgs/BoundingBox3D map_bounds
MapObject[] objects
Map is the world model passed to mission_executor. It contains:
map_boundsA 3D bounding box for the known operating area. The executor uses this as context for navigation and collision checks.
objectsThe detected or known objects in the scene. Each object is a
MapObject.
Current publishers:
detection_mockerPublishes
/vision/mapin simulation. It builds this message by parsing Stonefish scenario objects and filtering them using vehicle odometry and detector parameters.bringuponeshot_map_nodePublishes one test
/vision/mapmessage for quick local testing.zed_custom_wrapperPublishes
zed/mapfrom ZED object detections. This is the real-camera equivalent of the simulated map, although the currentmission_executorsubscribes to/vision/mapby default.
Current subscribers:
mission_executorSubscribes to
/vision/map. The selected mission reads object classes and bounding boxes, decides how to react, and updates the controller goal.
interfaces/msg/MapObject
int32 cls
vision_msgs/BoundingBox3D bbox
MapObject describes one semantic object in the map.
clsInteger class id. In
mission_executorthese ids are interpreted as:0cube,1rectangle,2gate,3shark,4other, and5swordfish.bboxObject pose and size as a
vision_msgs/BoundingBox3D. The center pose is used as the target/reference point; the size is used for navigation and obstacle logic.
interfaces/msg/MovingState
bool depth
bool rotation
bool linear
MovingState is a compact state flag message for motion status. It is
defined in the interface package, but the current main runtime path does not
publish or subscribe to it yet.
Topic Contracts
The table below shows the main topics, who publishes them, who subscribes to them, and why they matter.
Topic |
Message type |
Publishers |
Subscribers / use |
|---|---|---|---|
|
|
|
|
|
|
|
Real-camera map output; remap to |
|
|
Stonefish scenario publishers |
|
|
|
|
Stonefish thruster subscribers and |
|
|
|
|
|
|
Stonefish scenario publishers |
ORB-SLAM or visualization tools can consume it. |
|
|
|
Hardware ORB-SLAM launch consumes it when IMU mode is enabled. |
|
|
|
|
|
|
Stonefish Hydrus scenario |
|
|
|
Stonefish Hydrus scenario |
|
|
|
|
Debug/localization output for consumers that need camera pose. |
|
|
|
Visual odometry output; can be remapped into the control path. |
|
|
|
RViz/path visualization. |
|
|
|
Camera stream for visualization or visual odometry. |
|
|
|
Depth stream for RGB-D perception/localization. |
|
|
|
Native ZED detections for debugging or ZED-specific consumers. |
|
|
|
ZED positional tracking output. |
|
|
|
ZED pose output. |
|
|
|
Stonefish torpedo object receives push force. |
Simulation Interface Flow
sequenceDiagram
participant S as stonefish_ros2
participant D as detection_mocker
participant I as interfaces/Map
participant M as mission_executor
participant B as Stonefish thrusters
S->>M: /bridge/odometry (nav_msgs/Odometry)
S->>D: odometry topic configured by bringup
D->>I: build Map from scenario + robot pose
I->>M: /vision/map (interfaces/Map)
M->>M: mission selects goal and PID computes thrusters
M->>B: /bridge/thrusters (Float64MultiArray)
In simulation, the map normally comes from detection_mocker. The robot
state comes from the Stonefish scenario publishers. mission_executor joins
those two streams and publishes thruster commands back into Stonefish.
Hardware Interface Flow
sequenceDiagram
participant C as camera/vision stack
participant V as vectornav / odometry source
participant I as interfaces/Map
participant M as mission_executor
participant H as bridge_hardware
participant A as Arduino
C->>I: /vision/map or remapped zed/map (interfaces/Map)
V->>M: /bridge/odometry or remapped odometry
I->>M: object map
M->>H: /bridge/thrusters (Float64MultiArray)
H->>A: serial thruster commands
On hardware, the control contract stays the same: mission_executor still
expects a map-like perception topic and odometry feedback, and it still outputs
/bridge/thrusters. The difference is that bridge_hardware converts
those commands into serial messages for the Arduino instead of Stonefish
consuming them directly.
Package Responsibilities
bringup
Owns launch files and shared configuration.
stonefish.launch.pyStarts the simulator,
detection_mocker,joy_node, and usuallymission_executor.hardware_proteus.launch.pyStarts
mission_executor,bridge_hardware, and optional hardware sensors such as VectorNav, USB camera, and ORB-SLAM.config/mission_executor.tomlHolds PID gains and the thruster allocation matrix used by
mission_executor.
mission_executor
Consumes /vision/map, /bridge/odometry, and optionally /joy. It
runs the selected mission, computes a goal, applies PID control and the
thruster allocation matrix, then publishes /bridge/thrusters.
bridge_stonefish
Packages Stonefish scenario files, meshes, textures, and helper commands. The
scenario files declare Stonefish ROS publishers/subscribers such as
/bridge/odometry, /bridge/imu, camera topics, and
/bridge/thrusters.
detection_mocker
Turns Stonefish scenario objects into interfaces/msg/Map output. It is the
simulation stand-in for real object detection.
bridge_hardware
Subscribes to /bridge/thrusters and forwards each normalized thruster value
to the Proteus Arduino over serial.
orb_slam3_ros2
Consumes image, depth, and/or IMU topics. Publishes camera pose, odometry, and path topics for visual/inertial localization.
zed_custom_wrapper
Publishes ZED RGB/depth images, ZED native detections, ZED pose/odometry, and
a project interfaces/msg/Map topic named zed/map.
Vendored Packages
stonefish_ros2ROS 2 integration for Stonefish, including graphical and headless simulator launch files plus Stonefish-specific messages/services.
vectornavandvectornav_msgsHardware IMU/GNSS driver and message definitions.
zed_msgsNative ZED message and service definitions used by
zed_custom_wrapper.stonefish_bluerov2External Stonefish examples and assets used as references for additional robot and environment scenarios.