This repo contains a few reinforcement learning environements and example scripts greatly inspired by openai_ros. The environments are build with ROS ecosystem, Gazebo-7.0 simulation software and OpenAI-gym toolkit.
- Install ROS-Kinetic, recommand Desktop-Full install.
- (Optional but recommend) Install catkin-command-line-tools
- (Optional, skip this step if you've installed ROS in Desktop-Full mode) Install Gazebo-7.0
- Install OpenAI-gym
pip install gym
(Optional) Install openai_ros- Setup turtlebot Gazebo simulation environment
- Assume you have set up an ros workspace at
/home/yourname/ros_ws
, and ready to config the environment in it.$ sudo apt install ros-kinetic-turtlebot-gazebo
- To make sure
turtlebot_gazebo
is launchable, try$ roslaunch turtlbot_gazebo turtlebot_world.launch
- Assume you have set up an ros workspace at
- To get ready for reinforcement learning,
$ cd ~/ros_ws/src
, then clone this repo$ git clone https://github.com/deePurrobotics/gazebo_rl.git
$ cd ~/ros_ws
, then$ catkin build
All codes are located in
*this_repo*/scripts/
Copy the model files of cable-driven joint into local gazebo models library$ cp -a *this_repo*/gazebo_models/* ~/.gazebo/models/
- Launch learning environment,
$ roslaunch gazebo_rl turtlebot_crib.launch
- Open a new terminal, you can
$ rosrun gazebo_rl crib_nav_qtable
to start a q-learning"make sure to
$ chmod +x *this_repo*/scripts/turtlebot/crib_nav_qtable.py
- Launch simulation,
$ roslaunch gazebo_rl turtlebot_playground.launch
- To test this env,
$ rosrun gazebo_rl pground_env_test
- CMake force plugin for the cable-driven joint
$ cd *this_repo*/worlds/cable_world/ $ mkdir build $ cd build $ cmake .. $ make
- Add
export GAZEBO_PLUGIN_PATH=${GAZEBO_PLUGIN_PATH}:*this_repo*/worlds/cable_world/build
to~/.bashrc
- Launch cable joint simulation,
$ roslaunch gazebo_rl cable_joint.launch
- Open a new terminal to test this env,
$ rosrun gazebo_rl cable_env_test
make sure to
$ chmod +x *this_repo*/scripts/cable_joint/cable_env_test.py