/home/yourname/ros_ws
, and ready to config the environment in it.
$ sudo apt install ros-kinetic-turtlebot-gazebo
Sometimes, you may need to $ cd /opt/ros/kinetic
, then $ source setup.bash
turtlebot_gazebo
is launchable, try $ roslaunch turtlbot_gazebo turtlebot_world.launch
$ cd ~/ros_ws/src
, then clone this repo $ git clone https://github.com/linZHank/turtlebot_rl.git
$ roslaunch turtlebot_rl turtlebot_crib.launch
$ cd /home/yourname/ros_ws/turtlebot_rl/scripts
, then $ python crib_nav_qtable.py
to start Q learning.
You can substitute
crib_nav_qtable.py
intocrib_nav_qnet.py
to start Q-net learning.
This repo was created to test the contents in this openai_ros's tutorial.
However, may be different configurations were implemented, I made following changes to realize my turtlebot bumping around in the maze.
fake laser
part in turtlebot_gazebo
's launch file.
Besides, the original tutorial was using the topic of /kobuki/laser/scan
to publish laser's data,
hence I have to remap scan
to /kobuki/laser/scan
in my launch file.cmd_vel
to publish command to control the turtlebot.
However, I found my turtlebot use topic of /mobile_base/commands/velocity
to publish commands.
So, I have to edit ~/ros_ws/src/openai_ros/src/openai_ros/robot_envs/turtlebot2_env.py
.
I don't understand why I cannot simply use a
remap
in my launch file to fix it. Anyway, you'll find the topic around "line 76", just change the publisher's topic from/cmd_vel
to/mobile_base/commands/velocity
. Then you should good to go.