Skip to content

A Gazebo+ROS playground of Reinforcement Learning Agents

License

Notifications You must be signed in to change notification settings

linZHank/two_loggers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two Loggers Gazebo Simulation

Tutorials of the contents in this repo are all located at Docs. The order is: system_setup->create_urdf_tutorial->gazebo_ros_tutorial

Setup

PyTorch or other deep learning libraries should be no problem working with the environment developed in this repo.

  • gazebo_ros_pkgs
sudo apt-get install ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-ros-control
cd ~/ros_ws/src
git clone https://github.com/linZHank/two_loggers.git
  • Build ROS packages (loggers_description, loggers_gazebo, loggers_control)
cd ~/ros_ws/
catkin_make
source devel/setup.bash

Catkin Command Line Tools is a substitution to catkin_make.

  • make sure following two lines are in your ~/.bashrc file.
source /opt/ros/melodic/setup.bash
source /home/linzhank/ros_ws/devel/setup.bash

Replace melodic with kinetic in the lines above if you are using ROS-Kinetic. You may want to copy all the contents in two_loggers/loggers_gazebo/models/grey_wall_10/grew_wall to ~/.gazebo/models/ if using Ubuntu 16.04 and ROS-Kinetic. e.g. cp -a ~/ros_ws/src/two_loggers/loggers_gazebo/models/grey_wall_10/ ~/.gazebo/models/

Environments

Two environments are available right now: this_repo/loggers_control/scripts/envs/se.py and this_repo/loggers_control/scripts/envs/de.py both are with discrete action space.

se indicates solo escape, the goal is control the logger robot exiting the room through the only opening on the south wall.

de indicates double escape, the goal is control a two-robot team formed with two logger robots exiting the room while carrying a 2m rod.

Usage

A segment of example code can be found in the end of each script.

Open a terminal and enter the following commands to launch the simulation.

roslaunch loggers_control double_logger_control.launch

In a new terminal (tab), enter the following commands to test the environment with random control signals.

cd this_repo/loggers_control/scripts/envs
python de.py

substitute this_repo with actual repo path.

for solo escape env, roslaunch loggers_control solo_logger_control.launch, then navigate to the envs location and run python se.py

Agents

Two DQN agents are available and tested:

  1. DQN
  2. PPO

Location: this_repo/loggers_control/scripts/agents

Usage

Open a terminal and enter the following commands to launch the simulation.

roslaunch loggers_control solo_logger_control.launch

In a new terminal (tab), enter the following commands to train a ppo controller in solo escape environment.

rosrun loggers_control train_se_ppo.py

Since the envs are updated, please refer to legacy_20200817 branch for tested scripts training distributed controllers using DQN algorithm.

Under developing scripts include new agents, new envs could be found in devel branch.

About

A Gazebo+ROS playground of Reinforcement Learning Agents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published