This repository contains the implementation for the paper "Safe Monte Carlo Planning for Mobile Robots in Dynamic Environments". The project was tested on:
- Ubuntu 20.04
- Python 3.8.10
- ROS2 Foxy
- Unity
env_build/: Contains the compiled Unity environmentssin_env/: Sinusoidal obstacle trajectories environmentint_env/: Intention-based obstacle trajectories environment
mctsVoRos/: Contains the Python implementation of the algorithms and experiment runnermcts_vo_Turtlebot3UnityROS2/: Unity project implementing the simulation environment
-
Install system dependencies:
sudo apt update sudo apt install ffmpeg
-
Clone this repository into your colcon workspace:
git clone https://github.com/LorenzoBonanni/MCTS_VO_ROS.git ~/colcon_ws/src/MCTS_VO_ROS -
Navigate to the project directory:
cd ~/colcon_ws/src/MCTS_VO_ROS/mctsVoRos
-
Remove the existing MCTS_VO directory and clone the ROS branch:
rm -rf MCTS_VO git clone -b ros https://github.com/Isla-lab/MCTS_VO.git
-
Return to the main project directory:
cd .. -
Create and activate a Python virtual environment:
python3 -m venv venv/ source venv/bin/activate -
Install required Python packages:
pip install -r mctsVoRos/requirements.txt
-
Build the project:
colcon build source install/setup.bash
-
Navigate to the mctsVoRos directory:
cd ~/colcon_ws/src/MCTS_VO_ROS/mctsVoRos
-
Create debug directory:
mkdir debug
Note: All commands should be run from the ~/colcon_ws/src/MCTS_VO_ROS/mctsVoRos directory.
python3 run.py-
Obstacle Trajectories (default: sinusoidal): Modify
loopHandler_copy.py:# For sinusoidal obstacles (default) process = subprocess.Popen(["../env_build/sin_env/env.x86_64"], preexec_fn=os.setpgrp) # For intention-based obstacles # process = subprocess.Popen(["../env_build/int_env/env.x86_64"], preexec_fn=os.setpgrp)
-
Algorithm Selection (default: MCTS-VO): Modify the
--algorithmargument inrun.py:VO-TREE: MCTS-VO (default)MCTS: Standard MCTSVO-PLANNER: VO-Planner
python3 loopHandler_copy.py --exp_num <EXPERIMENT_NUMBER> --algorithm <ALGORITHM>Example:
python3 loopHandler_copy.py --exp_num 1 --algorithm VO-TREEAfter completing the installation steps, your directory structure should look like this:
~/colcon_ws/src/MCTS_VO_ROS/
├── env_build/
│ ├── sin_env/
│ └── int_env/
├── mctsVoRos/
│ ├── MCTS_VO/
│ │ ├── bettergym/
│ │ ├── environment_creator.py
│ │ ├── experiment_utils.py
│ │ ├── __init__.py
│ │ └── mcts_utils.py
│ ├── debug/
│ ├── debug_utils.py
│ ├── estimate_obs.py
│ ├── __init__.py
│ ├── loopHandler_copy.py
│ ├── requirements.txt
│ └── run.py
├── build/
├── install/
├── log/
├── mcts_vo_Turtlebot3UnityROS2/
├── package.xml
├── README.md
├── resource/
├── setup.cfg
├── setup.py
├── test/
└── venv/
Always make sure to run the experiments from the ~/colcon_ws/src/MCTS_VO_ROS/mctsVoRos directory to ensure correct path references.