Tutorials of the contents in this repo are all located at Docs. The order is: system_setup->create_urdf_tutorial->gazebo_ros_tutorial
- Ubuntu 16.04 or Ubuntu 18.04
- ROS-Kinetic in Ubuntu 16.04 or ROS-Melodic in Ubuntu 18.04
- Python 2.7,
- TensorFlow 2 and TensorFlow Probability
The lastest Python2 supported tensorflow2 version is 2.1, tensorflow-probability version is 0.9, please make sure the right
version is installed. Example:
pip install tensorflow==2.1andpip install tensorflow-probability==0.9
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- Create a catkin workspace, assume your workspace is at
~/ros_ws/ - Clone this repo to your catkin workspace
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.bashCatkin Command Line Tools is a substitution to
catkin_make.
- make sure following two lines are in your
~/.bashrcfile.
source /opt/ros/melodic/setup.bash
source /home/linzhank/ros_ws/devel/setup.bashReplace
melodicwithkineticin the lines above if you are using ROS-Kinetic. You may want to copy all the contents intwo_loggers/loggers_gazebo/models/grey_wall_10/grew_wallto~/.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/
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.launchIn 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.pysubstitute
this_repowith actual repo path.
for solo escape env,
roslaunch loggers_control solo_logger_control.launch, then navigate to theenvslocation and runpython se.py
Two DQN agents are available and tested:
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.launchIn a new terminal (tab), enter the following commands to train a ppo controller in solo escape environment.
rosrun loggers_control train_se_ppo.pySince the envs are updated, please refer to
legacy_20200817branch for tested scripts training distributed controllers using DQN algorithm.
Under developing scripts include new agents, new envs could be found in
develbranch.