ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

openai_ros example in local computer does not work.

asked 2018-09-26 08:57:19 -0500

danny p gravatar image

updated 2018-09-26 09:23:58 -0500

Hello. I'm trying to this openai_ros gym tutorials, not using ROS Development Studio(RDS).

I already checked that it does work in RDS following step by step. There was not problem at all.

BUT, I couldn't do this same tutorial in my local computer. It was troubled on the just first step.

If I type the following on my local command terminal,

  roslaunch gym_construct main.launch

then it shows that

 [ INFO] [1537961641.295151763, 0.348000000]: DiffDrive(ns = //): Advertise joint_states
 [ INFO] [1537961641.295818023, 0.348000000]: DiffDrive(ns = //): Try to subscribe to cmd_vel
 [ INFO] [1537961641.298928159, 0.348000000]: DiffDrive(ns = //): Subscribe to cmd_vel
 [ INFO] [1537961641.299555014, 0.348000000]: DiffDrive(ns = //): Advertise odom on odom 
 [spawn_turtlebot_model-2] process has finished cleanly
 log file: /home/parkbj/.ros/log/043fb95e-c180-11e8-8ab1-7085c22a655c/spawn_turtlebot_model-2*.log

And then, there is nothing happened. Gazebo has to be loaded, but NOT.

This problem is not only for local computer. It does though for RDS.

If I just type the same command in the Shell of RDS, instead of Simulations tap > Select a launch file > main.launch, then I get a exactly same result.

I want to try this tutorial in local computer to integrate a reinforcement learning part included in it with my own robot later.

However, how to do this tutorial in the local computer, not using RDS is nowhere.
Please let me know this.

FIY, the following is the all step of my trials on command terminal in local computer for doing this tutorial.

  1. Download Turtlebot2Maze pkgs, and set branch.

    cd ~/catkin_ws/src
    git clone
    cd ~/catkin_ws/src/turtle
    git fetch && git checkout kinetic
    cd ~/catkin_ws
    source devel/setup.bash
  2. Download openai_ros pkgs, and set branch.

    cd ~/catkin_ws/src
    git clone
    cd ~/catkin_ws/src/openai_ros
    git fetch && git checkout kinetic-devel
    cd ~/catkin_ws
    source devel/setup.bash
  3. Download openai_examples_projects pkgs, and set branch.

    cd ~/catkin_ws/src
    git clone
    cd ~/catkin_ws/src/openai_examples_projects
    git fetch && git checkout tutorials
    cd ~/catkin_ws
    source devel/setup.bash
  4. Download open_ai_gym_construct pkgs, and set branch.

    cd ~/catkin_ws/src
    git clone
    cd ~/catkin_ws/src/open_ai_gym_construct
    git fetch && git checkout master
    cd ~/catkin_ws
    source devel/setup.bash
  5. Launch gym_construct main.launch file in command terminal.

    roslaunch gym_construct main.launch
  6. Then, the command terminal shows this result. (This is exactly same with the result of shell in RDS)

    parkbj@parkbj-desktop:~$ roslaunch gym_construct main.launch
    ... logging to /home/parkbj/.ros/log/043fb95e-c180-11e8-8ab1-7085c22a655c/roslaunch-parkbj-desktop-4063.log
    Checking log directory for disk usage. This may take awhile.
    Press Ctrl-C to interrupt
    Done checking log file disk usage. Usage is <1GB.
    xacro: Traditional processing is deprecated. Switch to --inorder processing!
    To check for compatibility of your document, use option --check-order.
    For more infos, see
    deprecated: xacro tags should be prepended with 'xacro' xml namespace.
    Use the following script to fix incorrect usage:
            find . -iname "*.xacro" | xargs sed -i 's ...
edit retag flag offensive close merge delete


Remember that if you want to execute the demos locally you have to have the simulations installed in your computer (ROSDS has them installed by default).

R. Tellez gravatar image R. Tellez  ( 2018-10-16 05:16:56 -0500 )edit

Hi, @danny p. Would like to know if the gym_gazebo in open_ai_gym_construct is actually complete package? Should I use the original gym_gazebo instead? Here is the link:

steven1234 gravatar image steven1234  ( 2019-01-18 07:56:31 -0500 )edit

hello @danny p , I did all the installation you mentioned in your question. However I am receiving the error message below

resource not found: create_description ROS path [0]=/opt/ros/kinetic/share/ros ROS path [1]=/home/user/catkin_ws/src ROS path [2]=/opt/ros/kinetic/share None

do you know why that is?

aarontan gravatar image aarontan  ( 2019-06-11 16:41:53 -0500 )edit

I'm also trying to using openai_ros and gym. And I wonder whether you did it in python3 env. Would it be ok if I launch it without python3 env?

kane_choigo gravatar image kane_choigo  ( 2020-02-14 20:36:36 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-09-26 09:30:13 -0500

Delb gravatar image

updated 2018-09-26 09:42:11 -0500

There are no issues here, all the requested nodes with their parameters are correctly launched (and it's normal that the spawn_turtlebot_model process end once launched in case you were wondering).

"Nothing happen" because you don't launch the Gazebo GUI (ie. gzclient), in your nodes you simply have gzserver. Look at your main.launch :

  <arg name="paused" value="true"/>
  <arg name="gui" default="false"/>
  <arg name="headless" value="true"/>
  <arg name="stacks"    value="$(optenv TURTLEBOT_STACKS hexagons)"/>  <!-- circles, hexagons --> 
  <arg name="3d_sensor" value="$(optenv TURTLEBOT_3D_SENSOR kinect)"/>  <!-- kinect, asus_xtion_pro --> 

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="use_sim_time" value="true"/>
    <arg name="debug" value="false"/>
    <arg name="gui" value="$(arg gui)" />
    <arg name="world_name" value="$(find gym_construct)/worlds/"/>

If you change <arg name="gui" default="false"/> to <arg name="gui" default="true"/> everything should be fine.

Or if you don't want to modify the launch file, you can also run :

roslaunch gym_construct main.launch gui:=true

In addition : you have <arg name="paused" value="true"/>, eventhough you don't use the arg its default value is false (if you have to use it and it's set to true Gazebo will be started on a paused state)

edit flag offensive delete link more


I appreciate your comment. I got solved that problem right away, after revising some parts of '' file which were changed for my_turtlebot2_maze example. Do you know if any different learning codes which can be used instantly in this openai_ros pkgs exists, instead of q-learning?

danny p gravatar image danny p  ( 2018-09-26 10:47:33 -0500 )edit

The learning algorithm used in the examples of openai_ros tutorials is a very simple Q-learning implementation (only provided as an example). Today we have a free ROS Developers Live Class where we teach how to change the algorithms in a very simple way

R. Tellez gravatar image R. Tellez  ( 2018-10-16 05:21:02 -0500 )edit

That worked for me. Thanks. Also, if someone is here for the error message "package [hokuyo] does not have a path", make sure you git checkout to branch 'kinetic' inside the turtlebot folder !

Haresh Miriyala gravatar image Haresh Miriyala  ( 2019-04-01 16:18:24 -0500 )edit

answered 2022-04-24 19:56:15 -0500

wirobot gravatar image

updated 2022-04-24 19:59:18 -0500

For anyone following this thread, I made a continuation for issues that you may encounter that I solved using ROSDS running ROS Kinetic, which I believe is easier than trying to set up ROS Kinetic on and old Ubuntu system.

BIG SHOUTOUT TO @danny p for documenting his steps, support is non-existent from the Construct to get this to work. Or if there are tutorials or documentation from the Construct directly, please link me!


edit flag offensive delete link more

Question Tools



Asked: 2018-09-26 08:52:11 -0500

Seen: 1,386 times

Last updated: Apr 24 '22