Coder Social home page Coder Social logo

zerosansan / td3_ddpg_sac_dqn_qlearning_sarsa_mobile_robot_navigation Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 1.0 49.72 MB

Reinforcement Learning (RL) based navigation implementation for mobile robot navigation. The algorithms of TD3, DDPG, SAC, DQN, Q-Learning, and SARSA were implemented.

CMake 3.08% Python 92.75% C++ 4.17%

td3_ddpg_sac_dqn_qlearning_sarsa_mobile_robot_navigation's Introduction

Reinforcement Learning-based mobile robot crowd navigation

This repository contains codes to replicate my research work titled "Deep Reinforcement Learning-Based Mapless Crowd Navigation with Perceived Risk of the Moving Crowd for Mobile Robots".

In addition, it also provides a framework to train and test six different algorithms which are TD3, DDPG, SAC, Q-Learning, SARSA, and DQN. The initial results of this work have been presented at the 2nd Workshop Social Robot Navigation: Advances and Evaluation at IROS 2023. Turtlebot3 Burger mobile robot platform was used to train and test these algorithms. Unlike my other repository, I have completely removed the dependency of OpenAI so it is a much simpler process to get our codes to run in your own workspace.

Watch the video

If you have found this repository useful or have used this repository in any of your scientific work, please consider citing my work using this BibTeX Citation. A full mobile robot navigation demonstration video has been uploaded on YouTube.

Table of contents

Installation

  • Firstly, the following packages (turtlebot3, turtlebot3_gazebo) and their dependencies should be cloned in your ROS workspace.
  • Then, clone this repository and move the contents turtlebot3_simulations and turtlebot3_description to the installed packages.
  • Finally, the ROS workspace should be compiled with catkin_make and sourced with source devel/setup.bash. The compile process should return no error if all the dependencies are met.

Repository contents

turtlebot3_rl_sim - This folder contains files for the robot to run our version of TD3 (with Risk Perception of Crowd) as well as other algorithms of DDPG, TD3, DQN, Q-Learning, and SARSA for training and testing.

turtlebot3_description - This folder contains core files to run Turtlebot3 in the Gazebo simulator with the same settings used in our work.

turtlebot3_simulations - This folder contains the Gazebo simulation launch files, models, and worlds.

Getting Started

Start ROSCORE

  1. Run roscore in your terminal.

Launch Gazebo world

  1. Run roslaunch turtlebot3_gazebo turtlebot3_crowd_dense.launch in your terminal.

Place your robot in the Gazebo world

  1. Run roslaunch turtlebot3_gazebo put_robot_in_world_training.launch in your terminal.

Simulating crowd behavior

  1. Run rosrun turtlebot3_rl_sim simulate_crowd.py in your terminal.

Start training with TD3

  1. Run roslaunch turtlebot3_rl_sim start_td3_training.launch in your terminal.

Start testing with TD3

Firstly, we must use the following parameters in the start_td3_training.py script:

resume_epoch = 1500  # e.g. 1500 means it will use the model saved at episode 1500
continue_execution = True
learning = False
k_obstacle_count = 8  # K = 8 implementation
utils.record_data(data, result_outdir, "td3_training_trajectory_test") <-- Change the string name accordingly, to avoid overwriting the training results file

Secondly, edit the turtlebot3_world.yaml file to reflect the following settings:

min_scan_range: 0.0 # To get reliable social and ego score readings, depending on evaluation metrics
desired_pose:
    x: -2.0
    y: 2.0
    z: 0.0
starting_pose:
    x: 1.0
    y: 0.0
    z: 0.0

Thirdly, edit the environment_stage_1_nobonus.py script to reflect the following settings:

self.k_obstacle_count = 8  #K = 8 implementation
  1. Launch the Gazebo world:
  • Run roslaunch turtlebot3_gazebo turtlebot3_obstacle_20.launch in your terminal.
  1. Place your robot in the Gazebo world:
  • Run roslaunch turtlebot3_gazebo put_robot_in_world_testing.launch in your terminal.
  1. Simulating test crowd behaviors (OPTIONS:{crossing, towards, ahead, random}):
  • Run rosrun turtlebot3_rl_sim simulate_OPTIONS_20.py in your terminal.
  1. Start the testing script:
  • Run roslaunch turtlebot3_rl_sim start_td3_training.launch in your terminal.

Real-world testing (deployment)

  1. Physical deployment requires the Turtlebot3 itself and a remote PC to run.

  2. On the Turtlebot3:

  • Run roslaunch turtlebot3_bringup turtlebot3_robot.launch in your terminal.
  1. On the remote PC:
  • Run roscore
  • Run roslaunch turtlebot3_bringup turtlebot3_remote.launch in your terminal.
  • Run roslaunch turtlebot3_rl_sim start_td3_real_world_test.launch in your terminal.

Hardware and Software Information

Software

  • OS: Ubuntu 18.04
  • ROS version: Melodic
  • Python version: 2.7 (Code is in Python3, so porting to a newer version of ROS/Ubuntu should have no issues)
  • Gazebo version: 9.19
  • CUDA version: 10.0
  • CuDNN version: 7

Computer Specifications

  • CPU: Intel i7 9700
  • GPU: Nvidia RTX 2070

Mobile Robot Platform

BibTeX Citation

If you have used this repository in any of your scientific work, please consider citing my work (submitted to ICRA2024):

@misc{anas2023deep,
      title={Deep Reinforcement Learning-Based Mapless Crowd Navigation with Perceived Risk of the Moving Crowd for Mobile Robots}, 
      author={Hafiq Anas and Ong Wee Hong and Owais Ahmed Malik},
      year={2023},
      eprint={2304.03593},
      archivePrefix={arXiv},
      primaryClass={cs.RO}
}

Acknowledgments

  • Thank you Robolab@UBD for lending the Turtlebot3 robot platform and lab facilities.

td3_ddpg_sac_dqn_qlearning_sarsa_mobile_robot_navigation's People

Contributors

zerosansan avatar

Stargazers

 avatar  avatar snow avatar Pu Xu avatar  avatar nfhe avatar Ruibin Zhang avatar  avatar  avatar STATIS avatar  avatar  avatar Ihsan Nurkhotib avatar  avatar  avatar  avatar  avatar rizqi subeno avatar  avatar yan yin avatar

Watchers

 avatar Kostas Georgiou avatar

Forkers

ganjiaxiang

td3_ddpg_sac_dqn_qlearning_sarsa_mobile_robot_navigation's Issues

Error after launching "roslaunch turtlebot3_rl_sim start_td3_training.launch"

Hello sir, I am getting the below after launching "roslaunch turtlebot3_rl_sim start_td3_training.launch". I tried to solve it many times. please help me to resolve this issue, sir.

error:
user@user:~/turtlebot3_ws$ roslaunch turtlebot3_rl_sim start_td3_training.launch
... logging to /home/user/.ros/log/7bde750c-7fe1-11ee-b68b-6185d6c00012/roslaunch-user-8755.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://user:40827/

SUMMARY

PARAMETERS

  • /rosdistro: noetic
  • /rosversion: 1.16.0
  • /stage_number: 1
  • /turtlebot3/actor_alpha: 0.0003
  • /turtlebot3/angular_speed: 0.3
  • /turtlebot3/critic_alpha: 0.0003
  • /turtlebot3/desired_pose/x: -1.0
  • /turtlebot3/desired_pose/y: 1.0
  • /turtlebot3/desired_pose/z: 0.0
  • /turtlebot3/gamma: 0.99
  • /turtlebot3/linear_forward_speed: 0.5
  • /turtlebot3/linear_turn_speed: 0.05
  • /turtlebot3/max_scan_range: 0.6
  • /turtlebot3/min_scan_range: 0.12
  • /turtlebot3/nepisodes: 1510
  • /turtlebot3/nsteps: 1000
  • /turtlebot3/scan_ranges: 360
  • /turtlebot3/stage_name: trajectory_test
  • /turtlebot3/starting_pose/x: 0.75
  • /turtlebot3/starting_pose/y: -0.75
  • /turtlebot3/starting_pose/z: 0.0
  • /turtlebot3/tau: 0.005

NODES
/
turtlebot3_td3 (turtlebot3_rl_sim/turtlebot3_rl_sim/src/start_td3_training.py)

ROS_MASTER_URI=http://localhost:11311/

ERROR: cannot launch node of type [turtlebot3_rl_sim/turtlebot3_rl_sim/src/start_td3_training.py]: Cannot locate node of type [turtlebot3_rl_sim/src/start_td3_training.py] in package [turtlebot3_rl_sim]. Make sure file exists in package path and permission is set to executable (chmod +x)
No processes to monitor
shutting down processing monitor...
... shutting down processing monitor complete

Ros noetic

i want to run for noetic but i am encountering the error

Testing the model

Hi sir
I finished training the model, need help to understand the testing it, i used SAC algorithm
Let me know your thoughts please

Regarding Installation

Hello sir
I have a bit of confusion regarding the first two installation steps you mentioned ,sir. Could you please provide a more detailed explanation of the entire process? I attempted to follow the steps you provided, but I seem to be encountering several errors. I believe I may be missing something crucial in the process. Can you please clarify the steps for me so that I can better understand and resolve the issues I'm experiencing?

What happens when a robot touches a wall and doesn't move?

Hello, excuse me. I would like to ask how to resolve this error

[INFO] [1694695746.578410, 453.297000]: Collision!!
Traceback (most recent call last):
File "/home/robot/catkin_ws/src/turtlebot3_rl_sim/src/start_td3_training.py", line 140, in
social_safety_score = env.get_social_safety_violation_status(step + 1)
AttributeError: Env instance has no attribute 'get_social_safety_violation_status'
[INFO] [1694695746.740809, 453.443000]: Stopping TurtleBot
[turtlebot3_td3-1] process has died [pid 2675, exit code 1, cmd /home/robot/catkin_ws/src/turtlebot3_rl_sim/src/start_td3_training.py __name:=turtlebot3_td3 __log:=/home/robot/.ros/log/933e1d78-52fb-11ee-88b7-000c29188fcd/turtlebot3_td3-1.log].
log file: /home/robot/.ros/log/933e1d78-52fb-11ee-88b7-000c29188fcd/turtlebot3_td3-1*.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.