Skip to content

ACNoonan/saildock

Repository files navigation

SailDock

Autonomous docking system for sailboats — open-source simulation, control, and system design.

SailDock is a retrofit kit that adds autonomous taxiing and docking capabilities to sailboats with single auxiliary engines. Unlike commercial autodocking systems (Simrad AutoCaptain, Avikus NeuBoat, Raymarine DockSense) which are tightly coupled to twin-engine powerboat propulsion, SailDock is designed around the unique constraints of sailboats: deep keels that resist lateral movement, single-engine auxiliary power, and high windage from mast and rigging.

Status: Early-stage and experimental. The active code today is the Phase 0 simulation stack in simulation/hull_model/; the rest of the repo outlines the planned path toward ROS 2, hardware, and real-world validation.

Safety notice: This project is not certified marine equipment and is not ready for use on a vessel without substantial additional engineering, testing, and independent safety review.


Table of Contents


Vision

A sailboat owner approaches their home marina, taps a button, and the boat handles the last 200 meters: navigating the fairway, turning into the slip, and holding position against wind and current while lines are secured. No joystick, no stress, no dock rash.

Design Principles:

  • Retrofit-first — works on existing sailboats without hull modifications (where possible)
  • Sailboat-native — designed around keels, single engines, and high windage
  • Incrementally useful — each phase delivers standalone value (thrusters alone improve docking; sensors alone provide situational awareness)
  • Open — hardware schematics, firmware, and software are all open source

Why Sailboats Are Different

Every commercial autodocking system assumes twin-engine powerboat dynamics. Sailboats break those assumptions:

Challenge Powerboat Sailboat
Lateral thrust Twin engines in opposite directions None without thrusters — keel resists sideways movement
Control authority at low speed High (twin screws + bow thruster) Very low (single prop, prop walk, rudder ineffective below ~2 kts)
Windage Moderate, predictable Extreme and asymmetric (mast, boom, rigging)
Hull behavior Planing or semi-displacement, predictable Displacement, keel-dependent (fin vs. long vs. bilge)
Prop effects Cancel out with twins Prop walk pulls stern to one side in reverse

This means SailDock needs independent bow and stern thrusters as primary actuators for close-quarters maneuvering, with the main engine providing forward/reverse thrust and the rudder contributing to heading control only at speed.


System Architecture

┌─────────────────────────────────────────────────┐
│                  PERCEPTION                      │
│                                                  │
│  LiDAR ──┐                                      │
│  Cameras ─┤──► Sensor Fusion ──► World Model     │
│  IMU ─────┤         ▲                  │         │
│  GPS ─────┤         │                  │         │
│  Wind ────┘    Calibration             │         │
│                                        ▼         │
│              ┌─────────────────────────────┐     │
│              │      PLANNING & CONTROL      │     │
│              │                              │     │
│              │  Berth Detection             │     │
│              │       ▼                      │     │
│              │  Path Planning               │     │
│              │       ▼                      │     │
│              │  Dynamic Positioning (MPC)   │     │
│              │       ▼                      │     │
│              │  Thrust Allocation            │     │
│              └──────────┬───────────────────┘     │
│                         │                         │
│              ┌──────────▼───────────────────┐     │
│              │        ACTUATION              │     │
│              │                               │     │
│              │  Bow Thruster (port/stbd)     │     │
│              │  Stern Thruster (port/stbd)   │     │
│              │  Main Engine (fwd/rev)        │     │
│              │  Rudder (port/stbd)           │     │
│              └───────────────────────────────┘     │
│                                                    │
│              ┌───────────────────────────────┐     │
│              │        SAFETY & HMI            │     │
│              │                                │     │
│              │  Collision avoidance (always on)│    │
│              │  Dead man's switch              │    │
│              │  Manual override (instant)      │    │
│              │  Tablet UI / Apple Vision Pro   │    │
│              └────────────────────────────────┘    │
└────────────────────────────────────────────────────┘

Development Phases

Phase 0 — Simulation & Software Foundation

Goal: Build the entire control and perception pipeline in simulation before buying hardware. Validate the control architecture, size thrusters, and de-risk the project using synthetic data and physics-based modeling.

Why simulation first?

  • Thruster sizing: determine whether 5 kgf (T200-class) or 15 kgf thrusters are needed for your hull's displacement and windage before spending $600–7,000
  • Control tuning: debug MPC, EKF, and thrust allocation against known ground truth where you can see what's wrong
  • Architecture validation: get the full ROS 2 node graph, message types, and topic namespaces running so real hardware is plug-and-play
  • Risk reduction: 2–4 months of simulation work can prevent buying the wrong hardware or discovering a flawed control approach after it's mounted

Deliverables:

  • 3-DOF (surge, sway, yaw) hydrodynamic plant model based on Fossen's equations
  • Nonlinear MPC controller with NED-frame disturbance observer and QP-based thrust allocation
  • Ibiza-specific wind profiles (calm through gale-edge) for realistic scenario testing
  • Thruster sizing analysis across the full design envelope
  • Complete ROS 2 workspace skeleton: message definitions, launch files, node graph
  • Gazebo simulation with VRX maritime environment (next)
  • EKF state estimator tested against simulated sensors with known ground truth (next)
  • Path planner (Hybrid A* / Nav2) tested against synthetic occupancy grids (next)

Key findings from simulation (validated):

  • PID controllers are ruled out. P-controllers cause oscillation and instability with powerful actuators — the same thruster that helps in calm wind makes things worse in strong wind with naive gains. MPC is required.
  • MPC + NED-frame disturbance observer achieves sub-meter station keeping in winds up to 24 kts (gusts) with 2× Sideshift ST45 thrusters.
  • 2× Sideshift ST45 (450N/ea, ~$6,000 total) is the minimum for the full design envelope — full auto docking through 24 kt gusts, safe hold in 32 kt gusts.
  • 4× BlueRobotics T500 (120N/ea, ~$1,600 total) passes full auto through moderate conditions but fails safe hold in strong wind. Viable as a lower-cost product tier.
  • Software is worth more than hardware — $12k of extra thrusters with a P-controller performs worse than $6k of thrusters with MPC. The controller is the product.

Platform:

  • macOS (Apple Silicon) — Gazebo Harmonic and ROS 2 Jazzy run natively or via Docker on Apple Silicon
  • Python for hull dynamics prototyping, control algorithm iteration, and data analysis
  • C++ for real-time control nodes once algorithms are validated
  • Foxglove Studio (native macOS app) for visualization and replay

Key software components (implemented in simulation/hull_model/):

  • Hull model: Fossen's 3-DOF rigid-body + hydrodynamic equations for a 37' fin-keel displacement hull (8,000 kg). Parametrized with added mass, linear/quadratic damping, and prop walk.
  • Wind/current disturbance model: Aerodynamic wind forces with asymmetric sailboat windage (mast/rigging), time-varying gusts and direction shifts. Five Ibiza-specific profiles from calm (4 kts) to near-gale (37 kts).
  • MPC controller: CasADi-based nonlinear MPC with NED-frame disturbance observer. The observer estimates persistent wind/current in the earth-fixed frame (stable under heading changes), then feeds forward into the MPC's prediction model.
  • Thrust allocation: CVXPY QP solver distributing desired force/torque across arbitrary multi-thruster arrays with individual actuator constraints. Supports mixed thruster sizes and redundant configurations.
  • Simulation sweeps: Automated scripts testing controller + thruster combinations across all wind profiles to identify minimum viable hardware.

What simulation won't give you (and why Phase 1 hardware still matters):

  • Real hydrodynamic coefficients for your specific hull — sim gets you in the ballpark, real data calibrates
  • Actual sensor noise, mounting vibration, water splash on optics
  • Real prop walk behavior, which is notoriously hard to model accurately
  • Confidence in weatherproofing, power systems, and marine-grade reliability

Estimated cost: $0 (software only — all tools are open source)


Phase 1 — Sensor Platform & Data Collection

Goal: Mount a passive sensor suite. Log every manual docking. Build a dataset of "what good docking looks like" on this specific hull, in this specific marina, across wind conditions. Use this real-world data to calibrate and replace the simulation assumptions from Phase 0.

Deliverables:

  • Weatherproof sensor enclosure (3D-printed + off-the-shelf marine housing)
  • ROS 2 data pipeline: sensors → time-synced bag files
  • 30+ recorded docking maneuvers with full telemetry
  • Visualization/replay tool for reviewing docking runs

Hardware:

  • Compute: NVIDIA Jetson Orin Nano (ROS 2, CUDA for future CV)
  • LiDAR: RPLIDAR S2 (budget, ~$500) or Velodyne VLP-16 (research-grade, ~$2,000)
  • Cameras: 3× USB3 wide-angle cameras (ArduCam or FLIR Blackfly) for 270° coverage
  • IMU: BNO085 9-DOF IMU (~$30) for attitude and heading
  • GPS: u-blox ZED-F9P RTK GPS (~$200) for centimeter-level positioning
  • Wind: Interface with existing boat instruments via NMEA 2000/SignalK
  • Power: 12V marine battery → buck converters for 5V/19V rails

Software:

  • ROS 2 Humble on Ubuntu 22.04 (Jetson)
  • Sensor drivers: rplidar_ros, usb_cam, nmea_navsat_driver
  • Time sync: PTP or GPS-disciplined clock
  • Recording: rosbag2 with mcap storage
  • Replay/viz: Foxglove Studio

Estimated cost: $1,500–3,500 depending on LiDAR choice


Phase 2 — Thruster Actuation & Manual Joystick Control

Goal: Install bow and stern thrusters. Verify manual joystick docking is reliable. Then replace the joystick controller with a microcontroller that can receive commands from the ROS stack.

Deliverables:

  • Bow + stern thrusters installed and tested
  • Custom thruster controller board (ESP32-based) with ROS 2 micro-ROS bridge
  • Joystick passthrough mode (manual control still works)
  • ROS 2 topics for commanding thrusters: /thrusters/bow/cmd, /thrusters/stern/cmd

Thruster selection (validated by Phase 0 simulation):

Config Calm Sea Breeze (17 kts) Moderate (24 kts) Strong (32 kts) Cost Verdict
4× BlueRobotics T500 0.0m 0.6m 0.2m 12.7m ~$1,600 Full auto only
2× Sideshift ST45 0.0m 0.0m 0.1m 0.8m ~$6,000 Full envelope
4× 300N mixed array 0.0m 0.0m 0.1m 0.5m ~$8,000 Full envelope + redundancy

Recommended path: 2× Sideshift ST45 (bow + stern). This is the minimum hardware that meets the full design envelope (auto docking through 24 kt gusts, safe hold in 32 kt gusts) with the MPC controller. DIY-friendly external mount, no hull cutting required.

Ruled out by simulation:

  • BlueRobotics T200 — 50N per thruster is 10:1 outgunned by wind on a 37' hull in even moderate conditions. Only viable for sub-25' boats.
  • DockStar Smart Thruster — 10-minute battery runtime is insufficient for sustained DP station-keeping.
  • ApisQueen U5 — Insufficient thrust, poor documentation, no path to production.

Controller architecture:

Wireless Joystick ──► ESP32 Controller ──► ESC ──► Thruster Motor
                          ▲
                          │ (micro-ROS / serial)
                          │
                     Jetson (ROS 2)

The ESP32 acts as a safety-critical gateway: it enforces current limits, timeout watchdogs, and provides instant manual override regardless of what the Jetson is doing.

Estimated cost: $800–7,000 depending on thruster choice


Phase 3 — Dynamic Positioning (Station Keeping)

Goal: The boat can hold a fixed position and heading against wind and current, using all four actuators. This is the foundational control capability that docking builds on.

Deliverables:

  • Nonlinear MPC controller with NED-frame disturbance observer (architecture validated in Phase 0)
  • QP-based thrust allocation across the actuator array
  • "Hold position" mode: tap a button, boat stays put
  • Real-time wind/current force estimation displayed on UI
  • Performance metrics: position hold accuracy in various conditions

Key software components:

  • State estimator: Extended Kalman Filter fusing GPS, IMU, and LiDAR-based odometry
  • Controller: Nonlinear MPC (CasADi/IPOPT). PID is ruled out — Phase 0 simulation showed P-controllers cause oscillation and instability with powerful actuators, performing worse than weaker thrusters in some conditions.
  • Disturbance observer: NED-frame estimation of persistent environmental forces. Estimating in earth-fixed frame (not body frame) is critical — quartering winds that yaw the boat cause body-frame estimates to chase a moving target.
  • Thrust allocator: QP solver (CVXPY) distributing desired force vector across the actuator array with individual constraint enforcement.
  • Plant model: Fossen's 3-DOF (surge, sway, yaw) hydrodynamic model, calibrated with Phase 1 data to replace simulation assumptions.

This is where the Phase 1 data pays off. The 30+ recorded dockings give you empirical data on how the hull responds to thruster inputs at low speed, which is used to calibrate the plant model and disturbance observer.

Estimated cost: Minimal hardware — mostly software development on existing Phase 1-2 hardware.


Phase 4 — Berth Detection & Path Planning

Goal: The system identifies the target berth (dock edges, pilings, neighboring boats) from LiDAR/camera data and plans a collision-free approach path.

Deliverables:

  • LiDAR-based marina mapping (occupancy grid or point cloud segmentation)
  • Berth detection: identify the target slip from a saved "home berth" profile
  • Path planner: generate a feasible docking trajectory (approach angle, speed profile, waypoints)
  • Obstacle avoidance: dynamic replanning around moving boats, kayaks, swimmers
  • Simulation environment for testing before real-world deployment

Approaches to evaluate:

  • Classical: Occupancy grid + A* / Hybrid A* path planning + DWA local planner (Nav2 stack)
  • Learning-based: Imitation learning from Phase 1 docking recordings, refined with RL in simulation
  • Hybrid: Classical planning for gross approach, learned fine control for final 5 meters

Simulation:

  • Gazebo with VRX (Virtual RobotX) maritime environment
  • Custom boat URDF/SDF model matching hull characteristics
  • Synthetic marina environments for testing edge cases

Estimated cost: Minimal additional hardware. May want to add a more powerful GPU for training (could use cloud).


Phase 5 — Full Autonomous Docking

Goal: End-to-end autonomous docking from fairway to secured position. Captain taps "dock" and supervises.

Deliverables:

  • Complete autonomous docking pipeline: detect berth → plan path → execute → hold position
  • Multi-modal UI: tablet app, Apple Vision Pro overlay, or simple physical button
  • Safety system: virtual bumper, collision abort, manual override at any point
  • Confidence scoring: system reports its confidence and refuses if conditions exceed capability
  • Logging and replay for every autonomous docking attempt

Safety architecture (non-negotiable):

  • Physical kill switch cuts all thruster power instantly
  • Software watchdog: if Jetson heartbeat stops, thrusters go to neutral
  • Collision detection: if any sensor detects an object within the safety margin, system stops
  • Speed limits: autonomous mode hard-limited to 1.5 kts
  • Geofence: autonomous mode only active within defined marina boundaries

Hardware BOM (Summary)

Phase 1 — Sensor Platform

Component Specific Part Est. Cost
Compute NVIDIA Jetson Orin Nano 8GB $500
LiDAR RPLIDAR S2 (30m range, 10Hz) $500
Cameras (×3) ArduCam B0386 USB3 Wide Angle $150
IMU Adafruit BNO085 breakout $30
GPS SparkFun GPS-RTK-SMA (ZED-F9P) $220
NMEA interface Yacht Devices YDNR-02N (NMEA 2000 → USB) $150
Enclosure Polycase WH-12 weatherproof + custom 3D-printed mounts $100
Power Victron Orion 12V→5V/19V DC-DC $80
Cables, connectors, marine-grade Misc $200
Phase 1 Total ~$1,930

Phase 2 — Actuation

Component Specific Part Est. Cost
Bow thruster Sideshift ST45 (external mount, retractable) $2,500–3,500
Stern thruster Sideshift ST45 (external mount, retractable) $2,500–3,500
Controller ESP32-S3 DevKit + custom PCB $50
Control integration Relay interception or VESC replacement for ROS bridge $200
Wireless joystick FrSky Taranis (RC transmitter) or custom $100
Wiring, fuses, marine connectors Misc $200
Installation DIY (Sideshift is DIY-friendly, no hull cutting) $0
Phase 2 Total ~$5,550–7,550

Phase 0 simulation ruled out BlueRobotics T200 thrusters (50N) — they are outgunned 10:1 by crosswind on a 37' hull. The Sideshift ST45 (450N) is the minimum that meets the full design envelope with the MPC controller.


Software Stack

┌─────────────────────────────────────────────┐
│              Application Layer               │
│  Docking UI (React Native / SwiftUI)         │
│  Mission Manager (BehaviorTree.CPP)          │
│  Logging & Analytics                         │
├─────────────────────────────────────────────┤
│              Navigation Layer                │
│  Path Planner (Nav2 / custom Hybrid A*)      │
│  Dynamic Positioning Controller (MPC)        │
│  Thrust Allocator (QP solver)                │
├─────────────────────────────────────────────┤
│              Perception Layer                │
│  State Estimator (EKF: GPS+IMU+LiDAR)       │
│  Object Detection (YOLOv8 / point cloud)     │
│  Marina Mapping (occupancy grid / SLAM)      │
├─────────────────────────────────────────────┤
│              Driver Layer                    │
│  rplidar_ros2 | usb_cam | nmea_navsat       │
│  micro-ROS bridge (ESP32 ↔ Jetson)          │
│  SignalK / NMEA 2000 adapter                 │
├─────────────────────────────────────────────┤
│              Infrastructure                  │
│  ROS 2 Jazzy │ macOS (dev) / Ubuntu (deploy) │
│  Foxglove Studio (viz) │ mcap (recording)     │
│  Gazebo Harmonic + VRX (simulation)           │
└───────────────────────────────────────────────┘

Language choices:

  • Python for hull dynamics prototyping, control algorithm iteration, simulation scripts, data analysis
  • C++ for real-time control nodes (controller, thrust allocator, state estimator) once algorithms are validated
  • Rust (optional future) for safety-critical firmware on ESP32
  • TypeScript/React Native for companion app UI

Repo Structure

saildock/
├── README.md                          # Project overview, architecture, and phase plan
├── LICENSE                            # Apache 2.0 license for this repository
├── CONTRIBUTING.md                    # Contributor guidance
├── docs/
│   ├── boats/                         # Candidate boat/platform notes
│   ├── control-theory/                # Controller architecture and validation notes
│   ├── hardware/                      # Sensor/thruster/hull research
│   └── safety/                        # Safety architecture and constraints
├── firmware/
│   └── thruster-controller/           # Early ESP32 controller scaffold
├── hardware/                          # Placeholder for future CAD/PCB work
├── ros2_ws/                           # Placeholder for future ROS 2 integration
├── simulation/
│   └── hull_model/                    # Active Python simulation package
│       ├── hull_model/
│       │   ├── vessel.py              # Fossen 3-DOF hull dynamics
│       │   ├── environment.py         # Wind/current force models
│       │   ├── actuators.py           # Thrusters, engine, rudder models
│       │   ├── simulator.py           # Time-stepping simulation loop
│       │   ├── mpc_controller.py      # MPC + NED disturbance observer
│       │   ├── thrust_allocator.py    # QP thrust allocation
│       │   └── *.py                   # Runs, sweeps, and diagnostics
│       └── pyproject.toml             # Package metadata
├── tools/                             # Placeholder for future analysis/calibration tools
└── data/                              # Local-only ignored data (bags, models, maps)

Most of the repo outside simulation/hull_model/ is still scaffolding or design documentation for later phases. The simulation package is the current source of truth for implemented behavior.


References & Prior Art

Commercial Systems

  • Simrad AutoCaptain — First true autonomous docking for recreational boats (2025). Mercury Marine integration, 6 depth-perceiving cameras, 360° awareness. Powerboat only.
  • Avikus NeuBoat Dock II — Hyundai spinoff. LiDAR + AI object detection, AR navigation. Universal display compatibility.
  • Raymarine DockSense Control — FLIR machine vision cameras, object recognition, motion sensing. OEM installation only.
  • Volvo Penta Assisted Docking — IPS-coupled, GPS + dock sensors. Retrofit available for existing IPS boats.

Open Source & Research

  • ros-maritime/awesome-maritime-robotics — Curated list of open-source maritime robotics software (GitHub)
  • Nav2 — ROS 2 navigation framework with auto-docking, obstacle avoidance, behavior trees (nav2.org)
  • MOOS-IvP — Mission-oriented autonomy software for marine robots, developed at MIT
  • VRX (Virtual RobotX) — Gazebo-based maritime robotics simulation
  • MIT RoboWhaler — Research ASV with Velodyne LiDAR, FLIR cameras, broadband radar. Datasets publicly available.
  • RL Robotic Sailboats — Reinforcement learning for sailboat navigation in Gazebo/Omniverse simulation

Hardware References

  • BlueRobotics T200 — Well-documented ROV thruster, 5.1 kgf thrust, PWM/serial control (bluerobotics.com)
  • Sideshift Thrusters — DIY-friendly external mount thrusters for boats up to 50' (sideshift.com)
  • DockStar Smart Thruster — Battery-powered, stowable, no-drill mounting (dockstarthrusters.com)

Key Papers & Talks

  • Macenski et al., "The Marathon 2: A Navigation System" (IROS 2020) — Nav2 architecture
  • Fossen, T.I., "Handbook of Marine Craft Hydrodynamics and Motion Control" — The bible of marine vehicle control theory
  • Sørensen, A.J., "A survey of dynamic positioning control systems" — DP theory and practice

License

This repository is licensed under Apache 2.0.

If future hardware design files (schematics, CAD, PCB source) are added and a different license is needed for those artifacts, that will be stated clearly in the relevant subtree before release.


SailDock is a personal project by Adam. Not affiliated with any commercial autodocking vendor.

About

Open-source simulation and control stack for autonomous sailboat docking.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages