Skip to content

omron-sinicx/when2replan

Repository files navigation

When to Replan? An Adaptive Replanning Strategy for Autonomous Navigation using Deep Reinforcement Learning

arxiv

This repository contains the code for the paper "When to Replan? An Adaptive Replanning Strategy for Autonomous Navigation using Deep Reinforcement Learning", ICRA 2024.[project page] [paper]

Tested environment

  • Ubuntu 20.04
  • Python 3.8.10

Installation

# create venv
cd when2replan
python3 -m venv .venv
source .venv/bin/activate

# pytorch-cpu
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu

# stable baselines3 bleeding edge version: commit tag https://github.com/DLR-RM/stable-baselines3/commit/0532a5719c2bb46fd96b61a7e03dd8cb180c00fc
pip3 install wheel
pip3 install git+https://github.com/DLR-RM/stable-baselines3@0532a5719c2bb46fd96b61a7e03dd8cb180c00fc

# install other dependencies
cd when2replan
pip3 install -e .

Run Navigation with pre-trained model

Run setting file is here

For example, to run a specific setting, you can use the following command:

cd scripts
python3 run.py\
        run.model_dir="../trained_model"\
        run.model_name="DijkstraxDWA/16pillar.zip"\
        run.log_save_dir="run/DijkstraxDWA/16pillar"\
        run.navigation_scenarios=["config/scenario/sixteen_pillar/random.yaml"]\
        run.view_animation=False\
        run.seeds=[37]\
        navigation.common.global_planner="Dijkstra"\
        navigation.common.local_planner="DWA"

To visualize the results using Pygame, run:

cd scripts
python3 pygame_visualizer.py main ../log/run/[planners]/[map-layout]/[seed]/[method-name]_data.pkl

For example,

cd scripts
python3 pygame_visualizer.py main ../log/run/DijkstraxDWA/16pillar/37/rl_based_replan_data.pkl

Train

Training setting file is here

cd scripts
python3 train.py

tensorboard

tensorboard --logdir ./log/tensorboard

mlflow

cd scripts
mlflow ui

Evaluation

Evaluation setting file is here

cd scripts
python3 eval.py

You can check the result by mlflow

cd scripts
mlflow ui

Or, logged the all results in ./log dir

Citation

@inproceedings{honda2024replan,
  title={When to Replan? An Adaptive Replanning Strategy for Autonomous Navigation using Deep Reinforcement Learning},
  author={Honda, Kohei and Yonetani, Ryo and Nishimura, Mai and Kozuno, Tadashi},
  booktitle={IEEE International Conference on Robotics and Automation},
  pages={6650--6656},
  year={2024},
  organization={IEEE}
}

Note

All maps are generated by the script in arena-rosnav: https://github.com/ignc-research/arena-rosnav/blob/local_planner_subgoalmode/simulator_setup/maps/map_creator.py