Skip to content

Va5k3/Autonomous-boat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Boat (ROS 2 + VRX)

Project for controlling an autonomous boat in simulation.

The project is made by ROS 2 framework, called boat_navigation and it is tested in VRX (Virtual RobotX) / Gazebo simulation.
The main idea is simple: the boat should go to a target position and try to avoid obstacles using a potential field controller.

What is inside

  • ROS 2 node (C++): boat_controller_node
  • Launch files (Python):
    • launch/boat_vrx.launch.py
    • launch/full_simulation.launch.py
  • Uses VRX topics like:
    • /wamv/sensors/lidars/lidar_wamv_sensor/scan (LiDAR)
    • /wamv/sensors/gps/gps/fix (GPS)
    • /wamv/sensors/imu/imu/data (IMU)
    • Thrusters:
      • /wamv/thrusters/left/thrust
      • /wamv/thrusters/right/thrust

Requirements

This repo is a ROS 2 (ament_cmake) package. You need:

  • ROS 2 installed (I used ROS 2 style build with colcon)
  • VRX / vrx_gz package installed (VRX Gazebo)
  • rviz2 (optional)

Dependencies from package.xml:

  • rclcpp
  • geometry_msgs
  • nav_msgs
  • sensor_msgs
  • tf2
  • tf2_geometry_msgs

Build (colcon)

Example workspace structure:

ws_boat/
  src/
    boat_navigation/   <-- this repository

Build:

cd ~/ws_boat
colcon build --symlink-install
source install/setup.bash

Run

Option 1: Full simulation launch

This starts VRX + then starts my controller node with a small delay:

ros2 launch boat_navigation full_simulation.launch.py

You can also pass arguments (world/target), for example:

ros2 launch boat_navigation full_simulation.launch.py world:=scan_dock_deliver_task.sdf

Option 2: VRX + controller launch

ros2 launch boat_navigation boat_vrx.launch.py

How it works (very short)

  • I read LiDAR + GPS + IMU.
  • I compute a force:
    • attraction force to target
    • repulsion force from obstacles
  • From that force I compute desired heading (yaw).
  • Then I publish thrust commands to left/right thrusters (differential drive idea).

This is not perfect, but it works as a good simulation demo.

Screenshot

(Example screenshot from my simulation / RViz) image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors