A comprehensive sailing simulation with realistic physics and modular controller architecture for easy development and testing of navigation algorithms.
Kehillah Sailbot boat simulation program for the 2025-2026 Sailbot competition
# Run with default configuration
python3 run_simulator.py
# Run with custom boat configuration
python3 run_simulator.py --config boat_config_simple.yaml
# Force recalculation of polar diagrams
python3 run_simulator.py --recalc-polars- Realistic Physics: Aerodynamic and hydrodynamic forces on boat sails and hulls
- Navigation Testing: Test navigation algorithms with accurate boat behavior
- Performance Optimization: Calculate optimal sail trim, best VMG, and headings
- Modular Controllers: Easy-to-develop custom control algorithms
- YAML Configuration: Simple boat setup without code changes
PhysicsSimulator/
├── simulator/ # Main simulator package
│ ├── core/ # Physics simulation core
│ ├── display/ # Visualization system
│ ├── control/ # Control systems
│ │ ├── controllers/ # Modular controllers
│ │ └── algorithms/ # Navigation algorithms
│ └── utils/ # Utility functions
├── data/ # Boat performance data
├── docs/ # Documentation
├── boat_config.yaml # Default boat configuration
├── boat_config_simple.yaml # Simple example configuration
└── run_simulator.py # Main entry point
Boats are configured using YAML files. See boat_config.yaml for a complete example.
location: "Newport, Rhode Island"
wind:
direction: 90 # From East
speed: 10 # m/s
hulls:
- name: "main_hull"
datasheet: "data/naca0015-R7e7-F180.csv"
material_density: 1000 # Water
wetted_area: 0.5
size: 2.0
position:
angle: 0
distance: 0
sails:
- name: "main_sail"
datasheet: "data/mainSailCoeffs.cvs"
material_density: 1.204 # Air
wetted_area: 10.0
size: 5.0
position:
angle: 0
distance: 0See docs/README_CONFIG.md for detailed configuration guide.
The modular system allows easy development of custom control algorithms:
from simulator.control.controllers import BaseRudderController
class MyRudderController(BaseRudderController):
def calculate_rudder_angle(self, target_heading=None, **kwargs):
# Your custom steering logic
return rudder_angle # -10 to +10 degreesSee simulator/docs/MODULAR_CONTROLLER_README.md for details.
- Forces: Newtons
- Distance: Meters
- Angles: Degrees
- Density: kg/m³
- Wind: Direction wind is coming FROM (0° = East wind blowing West)
- Calculation angles: Unit circle (0° = East, 90° = North)
- Data angles: 0-180° range for foil data
- Variable: Base class for angles and vectors with automatic unit conversion
- Foil: Calculates lift and drag forces on sails/hulls
- Boat: Manages foils, position, velocity, and force calculations
- Python 3.7+
- matplotlib
- numpy
- pyyaml
- Additional dependencies in
requirements.txt
pip install -r requirements.txt
python3 run_simulator.py- Configuration Guide - Detailed YAML configuration
- Modular Controllers - Creating custom controllers
- Control Algorithms - Available algorithms
- Improve sail physics for realistic jibes and tacks
- Fix variable system display/data angle issues
- Add more sophisticated control algorithms
- Boeing, G. 2017. "OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks." Computers, Environment and Urban Systems 65, 126-139.
This is the third iteration of the Kehillah Sailbot boat simulation program