How hkpolyu-uav/bluerov2 works
Project Type and Purpose
• This is a ROS‐based simulation and control framework for an unmanned underwater vehicle (BlueROV2)
• Provides multi‐node state estimation, path planning, NMPC (and DOB‐MPC) control, plus a Gazebo/UUV simulation environment
• Integrates external libraries (acados), ROS packages (mavros, uuv_simulator), joystick and video streaming
File Structure
• Top‐level ROS packages:
– bluerov2_environ: Gazebo world, URDF/XACRO robot models, meshes, launch files
– bluerov2_states: state estimation nodelets, IMU fusion, config, scripts
– bluerov2_path: trajectory definitions, path‐planning node, wrench publisher
– bluerov2_dobmpc / bluerov2_mpc: core control logic, message defs, C++ nodes, config, code-generation scripts
– realsense-ros-gazebo, ros_utilities, uuv_simulator: external simulation & utilities
• Config files: YAML under each package for controllers, thrusters, environment parameters
• CMakeLists, package.xml: build & dependency declarations
• Scripts: code‐generation (generate_c_code.py), plotting, data processing
README Insights
• Emphasizes ROS noetic, uuv_simulator, mavros, acados
• Launch workflows: no‐controller simulation, MPC demo, DOB‐MPC demo
• Docker image available
Components & Interactions
a. Main Components
1) ROS Master (central broker)
2) Gazebo/UUV Simulator + World (ocean_waves, custom worlds)
3) Robot Description (URDF/XACRO, meshes)
4) Sensor Nodes: IMU, DVL, camera (realsense plugin)
5) State Estimator (bluerov2_states nodelets)
6) Path Planner (bluerov2_path node)
7) Reference Generator (trajectories from config)
8) Controller(s):
– MPC (bluerov2_mpc)
– DOB‐MPC (bluerov2_dobmpc)
– PID / cascade controllers (fallback)
9) acados Solver (external library, C‐code modules)
10) Thruster Manager (in ROS, publishes to Gazebo plugin)
11) Joystick / MAVROS Interface
12) Video Stream (OpenCV)
b. Relationships & Data Flow
– Sensor → /imu, /dvl, /camera topics → State Estimator → /state topic
– Path Planner → /reference topic → Controller nodes
– Controller → /thruster_manager/input → Gazebo actuators
– Gazebo sim → /ground_truth, /sensor topics
– acados library is called by controller nodes (generated C‐code via scripts)
– Joystick/MAVROS → teleop topics → thruster_manager or direct control
c. Architectural Patterns & Principles
– ROS node & pub/sub decoupling
– Modular packages (env, states, path, control)
– Config‐driven (YAML) parameterization
– Automated C‐code generation for real‐time solvers
d. Key Technologies & Frameworks
– ROS Noetic, Gazebo, UUV Simulator
– Acados (NMPC solver)
– C++ / Python nodes, message definitions
– MAVROS, joystick drivers, OpenCV