$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
1. Software environment setup
A Linux-based workstation running Ubuntu 20.04 and the Robot Operating System (ROS) Noetic was used as the primary development platform for implementing underwater self-localization systems17. The system was initialized by creating a catkin workspace with mkdir -p ~/catkin_ws/src and then initializing it with catkin_init_workspace. The uuv_simulator and aruco_ros packages were cloned into the source directory and compiled using the catkin_make command to support underwater intervention modeling.
Connectivity between the ROS middleware and the Gazebo 9 simulator was verified by launching a default underwater world and confirming active communication through the rostopic list command. The image processing and pose estimation nodes were implemented using Python 3.8 and integrated ArUco libraries to calculate relative pose using OpenCV. The ROS environment was configured to manage dependencies and enable real-time data communication, enabling the robot to localize itself relative to multiple artificial markers18. This setup also enabled evaluation of marker detection performance under varying conditions. Figure 1 illustrates communication among the simulation, perception, and visualization nodes in the ROS–Gazebo environment.
2. UUV model and hydrodynamic parameterization
The RexRov2 vehicle model was obtained from the uuv_descriptions package and launched in Gazebo using its Unified Robot Description Format (URDF) file5. The vehicle model consisted of links and joints, with a dry mass of 1,863 kg and a volume displacement of 1.838 m3, corresponding to near-neutral buoyancy in water with a density of 1,000 kg/m3.
Hydrodynamic effects were modeled using the uuv_underwater_object_plugin, including linear and quadratic damping forces. The added mass surge coefficient was set to 779.79, and damping parameters were calibrated based on reported RexRov2 characteristics to simulate realistic vehicle motion19. Figure 2 shows the overall simulation architecture.

Figure 2: Overall architecture of the simulation environment. The figure shows the integration of the UUV model, sensor inputs, perception pipeline, and control modules used for pose estimation and navigation. Please click here to view a larger version of this figure.
3. Camera, marker, and environmental setup
A monocular camera was attached to the rexrov2/camera_link frame. The camera parameters were set to 1280 × 720 pixels and 30 Hz. Intrinsic parameters were defined in the camera configuration file with a focal length of 554.25 pixels and a principal point at (640.5, 360.5).
A fixed vertical ArUco marker with a side length of 0.5 m, selected from the 6×6_250 dictionary (ID: 582), was positioned at coordinates (20.0, 0.0, -10.0). The simulated environment was configured with a water depth of 10 m and a constant current velocity of 0.1 m/s in the X-direction using the /uuv_simulation_app/set_current_velocity ROS service. A light intensity of 0.8 was used to ensure marker visibility9. Figure 3 shows the simulated underwater environment.

Figure 3: Simulated underwater environment in Gazebo 9. The environment includes the RexRov2 UUV, virtual ArUco markers, and controlled environmental conditions such as water depth, lighting, and current. Please click here to view a larger version of this figure.
4. Pose estimation and navigation control
The marker detection pipeline was initiated using the ArUco ROS node, which subscribed to the /rexrov2/forward_camera/image_raw topic. The pose of the vehicle was estimated using the Perspective-n-Point (PnP) method to compute the rotation matrix (R) and translation vector (t) relative to the known 3D marker geometry.
The estimated pose was transformed from the camera frame to the global reference frame using a static transform publisher. A PID controller was used to regulate vehicle motion by sending velocity commands to the /rexrov2/thruster_manager/input topic. The proportional gains (Kp) for the surge and heave axes were set to 1500 and 2000, respectively, to ensure stable tracking performance20.
5. Evaluation and ground-truth comparison
The agreement between the vision-based pose estimates and the simulated trajectory was evaluated using the /rexrov2/pose_gt topic provided by the uuv_gazebo_ros_p3d plugin. The estimated pose from the ArUco-based pipeline was compared with ground-truth odometry data to assess system stability and consistency.
Evaluation was performed through trajectory comparison and real-time visualization, where position (X, Y, Z) and orientation (roll, pitch, yaw) were monitored using Rviz and rqt_plot. This enabled observation of deviations under both nominal and disturbance-induced conditions.
The study focuses on qualitative and comparative evaluation. Quantitative evaluation using Root Mean Square Error (RMSE) is identified as future work, where multiple simulation runs will be used to assess position and orientation error.
6. Result generation and visualization
Rviz was used as a 3D visualization tool to monitor the UUV trajectory and attitude. The /rexrov2/camera_link and /aruco_marker_frame coordinate frames were visualized to assess the spatial relationship between the vehicle and the marker2.
The rqt_plot tool was used to generate real-time plots of vehicle attitude (roll, pitch, yaw) using the /rexrov2/pose_gt and /aruco_pose topics. The rosbag record command was used to capture simulation data, including video streams and control inputs, for qualitative analysis.
The simulation was conducted under ideal visual conditions, assuming good lighting and low turbidity. The ArUco marker was assumed to remain unobstructed. Hydrodynamic damping effects were modeled using simplified coefficients, and sensor noise was not included.