Ask Your Question
1

openai_ros example in local computer does not work.

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

danny p gravatar image

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

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 https://bitbucket.org/theconstructcore/turtlebot.git
    cd ~/catkin_ws/src/turtle
    git fetch && git checkout kinetic
    cd ~/catkin_ws
    catkin_make
    source devel/setup.bash
    
  2. Download openai_ros pkgs, and set branch.

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

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

    cd ~/catkin_ws/src
    git clone https://bitbucket.org/theconstructcore/open_ai_gym_construct.git
    cd ~/catkin_ws/src/open_ai_gym_construct
    git fetch && git checkout master
    cd ~/catkin_ws
    catkin_make
    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 http://wiki.ros.org/xacro#Processing_Order
    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 ...
(more)
edit retag flag offensive close merge delete

Comments

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 imageR. Tellez ( 2018-10-16 05:16:56 -0600 )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: https://github.com/erlerobot/gym-gazebo

steven1234 gravatar imagesteven1234 ( 2019-01-18 07:56:31 -0600 )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 imageaarontan ( 2019-06-11 16:41:53 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

Delb gravatar image

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

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/maze_loop_brick.world"/>
  </include>

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

Comments

I appreciate your comment. I got solved that problem right away, after revising some parts of 'start_qlearnig.py' 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 imagedanny p ( 2018-09-26 10:47:33 -0600 )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 imageR. Tellez ( 2018-10-16 05:21:02 -0600 )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 imageHaresh Miriyala ( 2019-04-01 16:18:24 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 717 times

Last updated: Oct 02 '18