Ask Your Question

openai_ros_example shadow_tc RL dont work :(

asked 2020-03-17 14:08:02 -0500

julgay gravatar image

updated 2020-03-17 14:49:34 -0500

gvdhoorn gravatar image

Hi i try to run the RL examples of the openai_ros_example package. I want to run the Shadow_tc simulation, but it shows me this error after following code:

cd catkin_ws;catkin_make;source devel/setup.bash;roscd my_shadow_tc_openai_example/scripts;chmod +x
roslaunch my_shadow_tc_openai_example start_training_v2.launch


... logging to /home/user/.ros/log/5a3068b6-687f-11ea-9119-0294725245b4/roslaunch-rosdscomputer-15467.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.

started roslaunch server http://rosdscomputer:43219/


 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /shadow_tc/alpha: 0.1
 * /shadow_tc/epsilon: 0.9
 * /shadow_tc/epsilon_discount: 0.999
 * /shadow_tc/gamma: 0.7
 * /shadow_tc/nepisodes: 500
 * /shadow_tc/nsteps: 10000
 * /shadow_tc/ros_ws_abspath: /home/user/simula...
 * /shadow_tc/task_and_robot_environment_name: ShadowTcGetBall-v0

    shadow_tc_learn_to_pick_ball_qlearn (my_shadow_tc_openai_example/


process[shadow_tc_learn_to_pick_ball_qlearn-1]: started with pid [15510]
/usr/local/lib/python2.7/dist-packages/requests/ RequestsDependencyWarning: urllib3 (1.25.8) or chardet (2.3.0) doesn't match a supported version!
/usr/local/lib/python2.7/dist-packages/requests/ RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
[WARN] [1584471079.505701, 363.332000]: Env: ShadowTcGetBall-v0 will be imported
the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'
[WARN] [1584471080.353807, 364.115000]: Register of Task Env went OK, lets make the env...ShadowTcGetBall-v0
[WARN] [1584471080.746326, 364.451000]: path_launch_file_name==/home/user/simulation_ws/src/shadow_robot_smart_grasping_sandbox/shadow_gazebo/launch/start_world.launch
[WARN] [1584471080.746890, 364.451000]: Launching command=source /home/user/simulation_ws/devel/setup.bash;roslaunch  shadow_gazebo start_world.launch
[WARN] [1584471081.648505, 365.016000]: path_launch_file_name==/home/user/simulation_ws/src/shadow_robot_smart_grasping_sandbox/shadow_gazebo/launch/put_shadow_in_world.launch
[WARN] [1584471081.651014, 365.018000]: Launching command=source /home/user/simulation_ws/devel/setup.bash;roslaunch  shadow_gazebo put_shadow_in_world.launch
[ERROR] [1584471081.690665, 365.035000]: NO RESET SIMULATION SELECTED
[ERROR] [1584471081.693267, 365.036000]: NOT Initialising Simulation Physics Parameters
[WARN] [1584471081.703284, 365.040000]: Start Init ControllersConnection
[WARN] [1584471081.705393, 365.040000]: END Init ControllersConnection
Failed to import pyassimp, see for more info
Traceback (most recent call last):
  File "/home/user/catkin_ws/src/openai_examples_projects/my_shadow_tc_openai_example/scripts/", line 22, in <module>
  File "/home/user/simulation_ws/src/openai_ros/openai_ros/src/openai_ros/", line 31, in StartOpenAI_ROS_Environment
    env = gym.make(task_and_robot_environment_name)
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 161, in make
    return registry.make(id)
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 119, in make
    env = spec.make()
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 86, in make
    env = cls(**self._kwargs)
  File "/home/user/simulation_ws/src/openai_ros/openai_ros/src/openai_ros/task_envs/shadow_tc/", line 37, in __init__
    super(ShadowTcGetBallEnv, self).__init__(ros_ws_abspath)
  File "/home/user/simulation_ws/src/openai_ros/openai_ros/src/openai_ros/robot_envs/", line 75, in __init__
  File "/home/user/simulation_ws/src/openai_ros/openai_ros/src/openai_ros/robot_envs/", line 172, in _setup_smart_grasper
    self.sgs = SmartGrasper(init_ros_node ...
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2020-03-21 11:35:08 -0500

Alberto E. gravatar image

Hello there!

The problem is in the script, within the constructor of the SmartGrasperclass (

In the script (line 172), you are sending an argument to this class, here:

self.sgs = SmartGrasper(init_ros_node=False)

But as you can see in the class constructor, this argument is not expected, so it crashes. You need to add this argument to the constructor of the class (in the script), like this:

def __init__(self, init_ros_node=True):

Then, this argument is supposed to control if a ROS node is initiated or not, so you should do something like this inside the constructor:

if init_ros_node:

So, when the init_ros_node argument is set to True, the ROS node will be initiated, and when it's set to False, it won't.

I tested the training with this modifications and it works correctly. You can have a look at this video if you want.

edit flag offensive delete link more


Thank you very nice work and nice Video:)

julgay gravatar image julgay  ( 2020-03-23 01:45:09 -0500 )edit

answered 2020-03-17 23:42:05 -0500

Did you:

Failed to import pyassimp, see for more info

As the message suggests?

edit flag offensive delete link more


Thank you for your reply.

I tried this: Pip install -- pyassimp

But it still dont work

julgay gravatar image julgay  ( 2020-03-18 04:17:04 -0500 )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


Asked: 2020-03-17 14:08:02 -0500

Seen: 49 times

Last updated: Mar 21