Code Monkey home page Code Monkey logo

drl-transformer-simtoreal-navigation's Introduction

GoT-GTRL

πŸ“ƒ Goal-guided Transformer-enabled Reinforcement Learning for Efficient Autonomous Navigation

πŸ’« A goal-driven mapless end-to-end autonomous navigation of unmanned grounded vehicle (UGV) realized through Transformer-enabled deep reinforcement learning (DRL) algorithm.

πŸš™ A car-like mobile robot learns to autonomously navigate to a random goal position only through raw RGB images from one Fisheye camera and goal information in polar coordination system.

πŸ”§ Realized in ROS Gazebo simulator with Ubuntu 20.04, ROS noetic, and Pytorch.

Citation

If you find this repository useful for your research, please consider starring ⭐ our repo and citing our paper.

@ARTICLE{huang2023goal,
  author={Huang, Wenhui and Zhou, Yanxin and He, Xiangkun and Lv, Chen},
  journal={IEEE Transactions on Intelligent Transportation Systems}, 
  title={Goal-Guided Transformer-Enabled Reinforcement Learning for Efficient Autonomous Navigation}, 
  year={2023},
  volume={},
  number={},
  pages={1-14},
  doi={10.1109/TITS.2023.3312453}}

Preview Simulation

Click the gif to zoom in πŸ”Ž

Video: Sim-to-Real Experiment ↙️

πŸ‘‰ GTRL Sim-to-Real Navigation Experiment Video πŸ‘ˆ

Basic Dependency Installation

1️⃣ ROS Noetic

2️⃣ Gazebo

3️⃣ Pytorch

User Guidance

Create a new Virtual environment (conda is suggested).

Specify your own name for the virtual environment, e.g., gtrl:

conda create -n gtrl python=3.7

Activate virtual environment.

conda activate gtrl

Install Dependencies.

pip install numpy tqdm natsort cpprb matplotlib einops squaternion opencv-python rospkg rosnumpy yaml
sudo apt install python3-catkin-tools python3-osrf-pycommon
sudo apt-get install ros-noetic-cv-bridge

Optional step for visualizing real-time plotting (reward curve) with Spyder.

conda install spyder==5.2.2

Clone the repository.

cd to your workspace and clone the repo.

git clone https://github.com/OscarHuangWind/DRL-Transformer-SimtoReal-Navigation.git

Compile the workspace.

cd ~/$your workspace/DRL-Transformer-SimtoReal-Navigation/catkin_ws
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3

Set up the environment variables.

export GAZEBO_RESOURCE_PATH=~/$your workspace/DRL-Transformer-SimtoReal-Navigation/catkin_ws/src/gtrl/launch
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ros/noetic/lib

Alternatively, you can select to write these variables to the ~/.bashrc file so that it can be automatically set when opening terminal.

Source the workspace.

source devel/setup.bash

Important!

Copy all the files under models folder to your default gazebo models folder.

cp -a ~/$your workspace/DRL-Transformer-SimtoReal-Navigation/catkin_ws/src/gtrl/models/. ~/.gazebo/models

Revise your system path in main.py and env_lab.py (gtrl/scripts/Environments/env_lab.py) file.

main.py

import sys
sys.path.append('/home/$your workspace/DRL-Transformer-SimtoReal-Navigation/catkin_ws/src/gtrl/scripts')

env_lab.py (line 129)

fullpath = os.path.join('/home/$your workspace/DRL-Transformer-SimtoReal-Navigation/catkin_ws/src/drl_navigation/launch', launchfile)

Time to train and get your GTRL model!!!

cd ~/$your workspace/DRL-Transformer-SimtoReal-Navigation/catkin_ws/src/gtrl/scripts/SAC

Run it in the terminal:

python main.py

(Optional) Alternatively, if you have already installed spyder, just click the run file button in spyder.

To kill the program, it is suggested to use following commands.

killall -9 rosout roslaunch rosmaster gzserver nodelet robot_state_publisher gzclient python python3

Alternatively, you can add alias of these commands to the ~/.bashrc file:

alias k9='killall -9 rosout roslaunch rosmaster gzserver nodelet robot_state_publisher gzclient python python3'

And type the alias in the terminal to kill all the process:

k9

Framework

Goal-guided Transformer (GoT)

Noise-augmented RGB images from fisheye camera

AGV and lab environment model in simulation and real world.

Sim-to-Real navigaiton experiment in office environment.

drl-transformer-simtoreal-navigation's People

Contributors

oscarhuangwind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

drl-transformer-simtoreal-navigation's Issues

issue about ROS path [0]

Thank you for your work. I am a beginner in ROS. When I followed the steps and went to Python main. py, I encountered the following error. I hope you can help me.

Resource not found: gtrl
ROS path [0]=/opt/ros/noetic/share/ros
ROS path [1]=/opt/ros/noetic/share
The traceback for the exception was written to the log file

Encountered issues during training

2024-01-26 17-46-30 ηš„ε±εΉ•ζˆͺε›Ύ

When I started training, I got stuck on this interface and couldn't continue training. What is the reason for this?
I hope to receive your help!!!

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.