NRC_OEB_AUTO-IceNav_demo1.mp4
This repo contains code for the following papers.
AUTO-IceNav: A Local Navigation Strategy for Autonomous Surface Ships in Broken Ice Fields Rodrigue de Schaetzen, Alexander Botros, Ninghan Zhong, Kevin Murrant, Robert Gash, Stephen L. Smith In submission, 2024 👈 Extended journal paper |
|
Real-Time Navigation for Autonomous Surface Vehicles In Ice-Covered Waters Rodrigue de Schaetzen, Alexander Botros, Robert Gash, Kevin Murrant, Stephen L. Smith ICRA 2023 👈 Original conference paper |
- Demo Videos from NRC Experiments
- Installation
- Simulator
- Demo Scripts
- Reproducing Simulation Experiments
- Evaluation
- Contact
- Citation
- Acknowledgement
More videos can be found at this google drive link or can be uploaded upon request.
AUTO-IceNav_demo_x4_speed_1.mp4
AUTO-IceNav_demo_x4_speed_2.mp4
AUTO-IceNav_demo_x4_speed_3.mp4
AUTO-IceNav_demo_x4_speed_4.mp4
# clone the repo and navigate to the directory
git clone https://github.com/rdesc/AUTO-IceNav/ && cd AUTO-IceNav
# create a new python 3.9 environment using conda (or some other virtual environment)
conda create --name py39 python=3.9
# activate the new environment
conda activate py39
# install packages
pip install -r requirements.txt
# download the simulated ice field dataset
# this contains the 400 ice fields used in the simulation experiments
gdown https://drive.google.com/uc?id=1DuuVJfHHxXJqVZ1KG60q_X2uK5ZoS2cS --output data/
# (optional) run tests
cd tests && pytest .
This repo includes a 2D physics simulator for simulating ship-ice interactions. It uses the Pymunk library for simulating ice floes treated as rigid bodies, and the Marine Systems Simulator (Python) for the ship dynamics. The core physics parameters and utility functions are defined in sim_utils.py, while the main simulation loop is defined in sim2d.py.
The vessel model is selected by setting the sim_dynamics.vessel_model
parameter in the configuration object / file.
Additional vessel models can be added by extending the SimShipDynamics class.
There are currently two vessel models available:
- Full scale PSV
- Dynamics: 3 DoF linear state-space model
- Mass: 6000,000 kg
- Dimensions: 76.2 m x 18.0 m (L x W)
- Propulsion: four tunnel thrusters (two fore and two aft) and two main propellers
- Bow geometry: GEM simulation for local ice loads paper (figure)
- 1:45 scale platform supply vessel (PSV)
- Dynamics: 3 DoF linear state-space model
- Mass: 90 kg
- Dimensions: 1.84 m x 0.38 m x 0.43 m (L x W x H)
- Propulsion: two tunnel thrusters (fore and aft) and two main propellers
- Bow geometry: NRC paper
We model the mass of an ice floe as a random variable that follows a log-normal distribution. To generate realistic random configurations of ice floes use the script generate_rand_exp.py (note, parameters are set using global variables in the python script).
python -m ship_ice_planner.experiments.generate_rand_exp
This figure shows sample ice fields for four different ice concentrations: 20%, 30%, 40%, and 50%.
sim_demo.mp4
The main demo script demo_sim2d_ship_ice_navigation.py launches both the
physics simulator and the AUTO-IceNav autopilot which runs one simulation trial.
To launch the demo with default command line arguments (append --help
to see full usage),
run the following command:
python demo_sim2d_ship_ice_navigation.py
The following are the command line arguments to change default behavior:
positional arguments:
exp_config_file File path to experiment config pickle file generated by generate_rand_exp.py
planner_config_file File path to planner and simulation parameter config yaml file (see configs/)
optional arguments:
-c ICE_CONCENTRATION Pick an ice concentration from {0.2, 0.3, 0.4, 0.5}
-i ICE_FIELD_IDX Pick an ice field from {0, 1, ..., 99}
--start x y psi Initial ship position (x, y) in meters and heading (psi) in radians
--goal x y Goal position (x, y) in meters
--no_anim Disable live animation (significantly speeds up sim!)
--output_dir DIR Directory path to store output data
--debug, Debug mode
--logging, Logging mode
--log_level LEVEL, Logging level
Note, by default the positional command line arguments exp_config_file
and planner_config_file
are set to
'data/experiment_configs.pkl'
and 'configs/sim2d_config.yaml'
, respectively.
The following is an example of launching the main demo with a 40% concentration ice field (with an index of 9) where the trial output files
are saved to 'output/SAMPLE_TRIAL_NAME'
:
python demo_sim2d_ship_ice_navigation.py -c 0.4 -i 9 --output_dir output/SAMPLE_TRIAL_NAME
Within the output directory, the following files may be saved:
output/SAMPLE_TRIAL_NAME
├── config.yaml # config file with parameters
├── log.txt # logging file
├── metrics.txt # metrics computed by planner
├── state_history.txt # data logged by the simulator
├── plots # stores planned paths (disabled with save_paths=False in config.yaml)
│ ├── 0.pkl # a pkl file is saved for each planning iteration
│ ├── ...
│ └── n.pkl
├── planner_plots # stores plots generated by the planner
│ ├── 0.pdf # a pdf file is saved for each planning iteration
│ ├── ...
│ └── n.pdf
└── sim_plots # plots generated by the simulator at the end of the trial
├── sim.mp4 # animation of the simulation (disabled with --no_anim)
├── sim.pdf # shows the final state of the simulation
├── control_vs_time.pdf # control inputs vs time
├── floe_mass_hist.pdf # distribution of all ice floe and collided ice floe masses
├── impact_locations_impulse.pdf # impulse vectors at impact locations for all logged collisions
├── ke_impulse_vs_time.pdf # kinetic energy and impulse vs time
└── state_vs_time.pdf # ship state vs time (_d suffix for desired state)
The following is a side-by-side comparison between the three navigation methods in a snippet of a simulation trial.
The planner can be set by the parameter planner
in the configuration file.
sim_side_by_side_comparison.mp4
To run the demo without the physics simulator, use the script demo_dynamic_positioning.py. This script only simulates the vessel dynamics and runs the controller module.
python demo_dynamic_positioning.py
The demo script demo_pymunk_minimal_sim.py is useful for testing and tuning the parameters of the physics simulator. This script does not use the vessel dynamics model to simulate ship motion.
python demo_pymunk_minimal_sim.py
To run the full simulation experiments conducted in our paper, use the script sim_exp.py. This script sequentially runs 100 simulation trials for each ice concentration (20%, 30%, 40%, 50%) and for each navigation approach: AUTO-IceNav, and two baselines. A total of 1200 simulation trials takes 60 hours (with rendering disabled) to complete on a machine with Intel core i7 CPU and 32GB RAM.
Below is a sample command to run the full simulation experiments where all the output files are saved to 'output/SAMPLE_RUN_NAME/'
:
python -m ship_ice_planner.experiments.sim_exp \
--run_name SAMPLE_RUN_NAME \
--planners straight skeleton lattice \
--method_names Straight Skeleton AUTO-IceNav \
--no_anim
The evaluation script evaluate_run_sim.py processes the output files generated by the simulation experiments. It computes various performance metrics, saved as csv files, and generates several plots including a plot showing all ship-ice collisions that occurred during the simulation trials:
If no errors occurred during the simulation trials, the evaluation pipeline will be triggered as the final step of sim_exp.py. Otherwise, the evaluation can be done manually via the following command:
python -m ship_ice_planner.evaluation.evaluate_run_sim --output_dir output/SAMPLE_RUN_NAME/
Within the output directory, the following files will be saved:
output/SAMPLE_RUN_NAME/
├── mean.csv # mean metrics aggregated over method and ice concentration
├── raw_results.csv # metrics for each trial
├── 0.2 # trials with 20% ice concentration
│ ├── 0 # ice field index 0
│ │ ├── results.csv # results for ice field index 0
│ │ ├── ice_field.png # initial ice field configuration
│ │ ├── METHOD_NAME_1 # output files for navigation method 1 (trial 1)
│ │ ├── ...
│ │ └── METHOD_NAME_n # output files for navigation method n (trial n)
│ ├── ...
│ └── n # ice field index n
├── 0.3 # trials with 30% ice concentration
└── ... # trials with the other ice concentrations
Feel free to open a git issue if you come across any issues or have any questions. The maintainer of this project can be reached at rdeschae [at] uwaterloo [dot] ca.
Please consider citing our papers if you find our work useful for your research:
@article{
}
@inproceedings{deschaetzen2023real,
title={Real-Time Navigation for Autonomous Surface Vehicles In Ice-Covered Waters},
author={de Schaetzen, Rodrigue and Botros, Alexander and Gash, Robert and Murrant, Kevin and Smith, Stephen L},
booktitle={2023 IEEE International Conference on Robotics and Automation (ICRA)},
pages={1069--1075},
year={2023},
organization={IEEE}
}
This work was completed as part of the MASc thesis of Rodrigue de Schaetzen at the University of Waterloo.
This repo uses the python implementation of the Marine Systems Simulator (MSS) by Thor I. Fossen.