-->
At Team aQuatonomous, weāre blending cutting-edge technology with innovative thinking to push the limits of what autonomous aquatic systems can do. In this article, weāre diving into the brains behind āNautical Disasterāāfrom the early days of Pygame simulations to advanced ROS architectures and sensor integration. Learn how weāve tackled challenges like buoy navigation, obstacle avoidance, and precise docking, all while simulating and refining our system in virtual environments. Ready to explore the tech that powers our vessel? Letās set sail!
The team developed a Python-based algorithm visualizer using Pygame to provide a robust and interactive platform for path-planning experimentation. Designed with a modular structure, the visualizer allows users to seamlessly add, test, and compare custom path-planning algorithms, such as A* and Dijkstraās. The program supports dynamic toggling between algorithms through an intuitive GUI launcher. As a demonstration, the A* algorithm is implemented with a step-by-step visualization, showcasing the algorithmās decision-making process and path generation. Dijkstraās algorithm, accessible via the same interface, further demonstrates the flexibility of the tool. The visualizer also features user-defined grids where obstacles and target points can be placed interactively. A separate GUI menu built with Tkinter provides control options, such as selecting the algorithm, resetting the grid, or toggling visual search effects. The use of threading ensures smooth integration between the GUI and the Pygame display.
The Pygame simulation interface.
Under the hood, the visualizer employs classes for handling grid tiles, distinguishing obstacles, and calculating distances. Each algorithm implementation uses the core concepts of cost functions and search strategies to determine the optimal path, while users can observe the process in real-time. This tool is a valuable resource for testing, refining, and understanding path-planning algorithms, making it ideal for both educational and development purposes.
For obstacle avoidance, implement a potential field method by assigning a positive charge to the boat and a negative charge to the end goal. Obstacles should also be assigned a positive charge, with the charge magnitude proportional to the number of pixels the obstacle occupies in the cameraās field of view. This algorithm would be used for yellow buoys in Task 2, black buoys in Task 4 and to return home in Task 6.
A visual representation of the potential fields algorithm.
Implement left-right navigation using a segmented 180-degree camera, combined with colour perception and object detection for classification. The camera will be split vertically into multiple segments, ensuring that the red buoys stay in the leftmost segment and the green buoys in the rightmost segment., ensuring these colours align correctly to proceed forward. If the colours are not on the correct sides, adjust the orientation until proper alignment is achieved. This navigational method will be used for Task 1 and Task 2.
The left-right buoy navigation system.
Position the vessel within the starting box and utilize camera detection to monitor the starting light. Begin movement only once the light activates. Approach the blue buoy at an angle and execute the apex driving line turning script when an optimal distance from the turning buoy is achieved. For counting oil spills, employ a combination of camera, LiDAR, and GPS to detect and track previously counted spills. This will be used for the Task 4 speed challenge.
The speed challenge approach.
The main frontal camera will be utilized for navigation, while a secondary camera will focus on identifying symbols. Begin at an offset corner of the dock and navigate around an offset perimeter to locate the designated docking symbol. Align with the dock if on the correct side, otherwise, back out and realign to achieve the proper approach. LiDAR will assist in detecting dock edges and ensuring accurate alignment. This will be used for the Task 3.
The docking and navigation process.
For obstacle avoidance, implement camera-driven potential fields to enable real-time dynamic path adjustments. Combine this with a path-planning system that utilizes GPS coordinates to save waypoints and optimize navigation. Routes will be dynamically adjusted to efficiently bypass obstacles while maintaining a clear path toward the destination. This will be used for Task 6.
The obstacle avoidance system.
The following diagram illustrates the perception and autonomy system for the ASV, showcasing its data flow and decision-making process. The system integrates inputs from three primary sensors: the bow and starboard cameras, as well as a Unitree 4D LiDAR. Each camera processes its input using the v4l2_camera
node, passing images through respective computer vision modules (buoy_cv
and starboard_cv
) to detect key objects such as buoys or symbols. These detections are published to /buoy_positions
and /symbols
topics, which inform navigation tasks like left_right_navigation
, speed_challenge
, and docking
. Meanwhile, the LiDAR data is processed by the unilidar_sdk
to generate segmented_points
, which feed into the pf_obstacle_avoidance
module for path planning and collision avoidance. Notably, there is an unshown MAVROS topic that dynamically determines the active navigation task based on mission priorities. All navigation outputs are consolidated into the obstacle avoidance system before passing final actuation commands, such as /setpoint_position
or /setpoint_velocity
, through MAVROS to the Pixhawk4 autopilot. This ensures smooth and coordinated operation of the vessel in dynamic environments.
The ROS architecture for the ASV.
The Pixhawk 4, which executes control of the ASV to its desired position, uses a simple thrust and steer model.
The ASV model.
The creation of a virtual representation of the competition space is achieved by integrating Gazebo with RViz, enabling a realistic simulation of the environment. Gazebo provides an accurate model of the competition map, including elements such as the boat and buoys placed within the water, reflecting the actual conditions the team will encounter. This simulation serves as a testbed for evaluating the teamās algorithms and ROS (Robot Operating System) implementation.
RViz plays a crucial role in visualizing sensor data and monitoring the boatās movements within the simulated environment. The system processes inputs from sensors such as cameras and LiDAR, feeding this information into the boatās control system. Using the algorithms developed by the team, the boat can interpret the sensor data and make navigation decisions in real time. This integration allows for comprehensive testing and fine-tuning of the boatās autonomous capabilities, providing an invaluable platform to refine the system before deployment in the actual competition.
The combination of Gazeboās simulation capabilities and RVizās visualization tools ensures that the team can efficiently test, monitor, and optimize the boatās performance in a controlled, virtual environment. This approach minimizes the risk of errors and allows for iterative improvements to the boatās navigation and obstacle avoidance strategies.
The camera mounted on the bow of the ASV plays a key role in guiding its movements by analyzing the placement of buoys in its field of view. To simplify this process, the cameraās frame is divided into six evenly spaced vertical segments. Each buoy detected in the cameraās view is assigned to one of these segments based on its position. The color and size of the buoy, along with the segment it occupies, inform the ASV about its next course of action. For instance, if the ASV is navigating between two buoys and detects that the left buoy appears in a segment near the center-left of the frame while the right buoy is located in the far-right segment, the system determines that the vessel needs to steer further to the right to remain on course. This segmentation system enables the ASV to make precise and responsive navigation decisions in real-time.
A camera 6-window segment example for a situation in which the ASV must navigate between a red buoy (right) and a green buoy (left). The grey arrow indicates the heading of the ASV. The yellow arrow indicates the turning vector of the ASV required to get on the desired course, given the window segments that each buoy currently occupies.
The 3D LiDAR system complements the camera by offering a detailed environmental view through height-based segmentation. The LiDAR data is split into three layers based on elevation above the waterline. The lowest layer captures objects up to 30 cm high, such as small buoys. The middle layer focuses on objects between 30 cm and 1 meter, like tall buoys, while the highest layer identifies objects above 1 meter, including platforms or other large structures. To ensure accurate classification, objects detected in higher layers mask out any points from the lower layers using bounding boxes. This ensures that each object is correctly assigned to its respective height layer. The LiDAR system provides a secondary sensing method that supplements the camera by identifying objects and obstacles the camera might miss. For navigation and obstacle avoidance, a combined point cloud from all three LiDAR layers is used to detect and avoid objects effectively. This height-based classification is especially useful in distinguishing small buoys from platforms, which is crucial for completing specific tasks like buoy navigation and docking.
A Y-Z plane cross section of the LiDAR segmentation approach in which an input point cloud is split into three layers based on point heights. Upper layers create bounding boxes (blue) around their points, which mask out points on lower layers that are aligned on the Y-Z plane. Each point cloud layer is flattened after the segmentation is complete.