Skip to content

AChompSitsIn/sailbot2526

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Sailing Robot Control System

ROS2 Python Ubuntu License

Overview

This is the 2025-2026 iteration of the Kehillah autonomous sailing robot control system built on ROS2 (Robot Operating System 2). The system is designed for the sailbot competition: https://www.sailbot.org/

Key Features

  • Multi-Event Support: Fleet race, precision navigation, station keeping, endurance, payload, and search events
  • Path Planning: Python-based navigation algorithms with polar performance curves
  • Sensor Integration: GPS, wind sensors, rudder/winch control
  • Dual Communication: Radio for RC commands, cellular for telemetry
  • Autonomous/RC Mode Switching: Seamless transition between manual and autonomous control
  • Global Wind Backup: Reliable wind direction backup system for sensor failures
  • Timing Control: Precise actuator control timing for optimal performance

System Architecture

sailbot2526/
├── src/
│   ├── sailboat_control/     # Core autonomous control logic
│   ├── sensors/             # Sensor nodes and hardware interfaces  
│   └── path_planning/       # Navigation algorithms and waypoint management
├── docs/                    # Documentation
├── util/                    # Utility scripts
└── start_sailbot.sh        # System launcher script

Core Components

  • Sailboat Control: Event management, boat state control, autonomous decision making
  • Sensors: GPS, wind sensors, rudder/winch control, radio and cellular communication
  • Path Planning: Navigation algorithms with polar performance data

Communication Architecture

The system uses a split communication architecture:

  • Radio (radio_comm_node): Receives RC commands (rudder, sail, mode switches) over serial radio link. This is the primary control channel.
  • Cellular (cellular_comm_node): Sends telemetry data (GPS, wind, status, waypoints) to the remote monitoring station via WebSocket relay.

Quick Start

Prerequisites

System Requirements:

  • Ubuntu 24.04 LTS
  • ROS2 Jazzy
  • Python 3.12+

Install Dependencies:

# System dependencies
sudo apt update && sudo apt install -y \
    python3-serial python3-smbus i2c-tools \
    ros-jazzy-desktop

# Python dependencies  
pip3 install websocket-client numpy pyserial

Build and Launch

  1. Clone and Build:
git clone https://github.com/AChompSitsIn/sailbot2526.git
cd sailbot2526
  1. Launch the System:
./start_sailbot.sh

This script will:

  • Compile all ROS2 packages
  • Launch all sensor nodes, communication nodes, and control systems

Quick Test

# In a new terminal, test GPS node
ros2 topic echo /gps/fix

# Test wind sensor  
ros2 topic echo /wind/direction

# Check system status
ros2 topic echo /boat_status

Supported Events

Event Type Description Autonomous Features
Fleet Race (F) Traditional sailing race RC mode only
Precision Navigation (Pr) Navigate precisely through waypoints Full autonomous waypoint following
Station Keeping (S) Maintain position in designated area Position holding algorithms
Endurance (E) Long-duration autonomous sailing Extended waypoint sequences
Payload (P) Carry payload while navigating Specialized control for added weight
Search (Se) Visual-based buoy detection and approach Camera-based visual servoing
Developer Mode (D) Testing and development Local test waypoints

Event Selection

# Launch with specific event type
ros2 run sailboat_control state_management_node --ros-args -p event_type:=search

# Or specify in launch parameters
./start_sailbot.sh --event-type precision_navigation

Navigation Features

Path Planning

  • Polar performance curves for optimal sail trim calculations
  • Tacking and jibing algorithms for upwind/downwind sailing
  • Waypoint following with configurable intermediate points

Visual Servoing (Search Event)

  • Real-time orange buoy detection using camera input
  • P-controller based visual servoing for precise approach
  • Distance-based hit detection with configurable thresholds
  • Automatic upwind recovery after buoy contact

Global Wind Backup System

Provides reliable wind direction when primary sensor fails:

  • Manual wind angle configuration via ROS parameters
  • Dynamic updates through ROS topics
  • Automatic fallback with configurable timeout
  • Status reporting for wind source monitoring

Configuration

Launch Parameters

ros2 run sailboat_control state_management_node --ros-args \
    -p event_type:=search \
    -p global_wind_angle:=270.0 \
    -p use_global_wind:=false \
    -p wind_sensor_timeout:=5.0 \
    -p rudder_update_interval:=3.0 \
    -p sail_update_interval:=10.0

Key Parameters

Parameter Default Description
event_type developer_mode Competition event type
global_wind_angle 0.0 Backup wind direction (degrees)
wind_sensor_timeout 5.0 Timeout before using global wind (seconds)
rudder_update_interval 3.0 Rudder control update frequency
sail_update_interval 10.0 Sail control update frequency

ROS2 Topics

Key Topics

Topic Type Description
/gps/fix NavSatFix GPS position data
/wind/direction Float32 Wind direction (degrees)
/control/rudder_angle Float32 Rudder position command
/control/sail_angle Float32 Sail position command
/rudder/command Float32 RC rudder command (from radio)
/sail/angle Float32 RC sail command (from radio)
/radio_commands Int32 Mode switch commands (from radio)
/boat_status String JSON system status
/camera/buoy_angle_offset Float32 Visual servo angle error

Monitor System Status

# Real-time system monitoring
ros2 topic echo /boat_status

# Visual servoing feedback
ros2 topic echo /camera/buoy_angle_offset

# Wind system status  
ros2 topic echo /wind/status

Documentation

Feature Documentation

Architecture Documentation

Development

Running Tests

# ROS2 package tests
colcon test --packages-select sailboat_control sensors path_planning

Development Mode

# Launch in developer mode with local test waypoints
ros2 run sailboat_control state_management_node --ros-args -p event_type:=developer_mode

Troubleshooting

Common Issues

GPS Connection Issues:

# Check serial port permissions
sudo usermod -a -G dialout $USER
# Then logout and login again

# Test GPS hardware
sudo cat /dev/ttyAMA0

Radio Connection Issues:

# Check if radio device is available
ls -la /dev/ttyRADIO

# Test with different port
ros2 run sensors radio_comm --ros-args -p port:=/dev/ttyUSB0

Wind Sensor Timeout:

# Enable global wind backup
ros2 param set /sailboat_control use_global_wind true
ros2 param set /sailboat_control global_wind_angle 270.0

Debug Mode

# Enable verbose logging
export ROS_LOG_LEVEL=DEBUG
ros2 run sailboat_control state_management_node --ros-args -p event_type:=search

About

The 2025-2026 iteration of Kehillah's sailbot software.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors