Unit 6: How to change the learning algorithm: Cube Error related to TF

When i try to launch the file from virtual environment the traininh never starts an i get quikly kicked off.

I did teste the ROS TF it was ok
Than i compiled following strictly the instructions
Verified the whole code
And repeated the sequence a few time

Always the same messages


process[movingcube_gym-1]: started with pid [21237]
Logging to /tmp/openai-2020-03-02-02-03-29-369777
Traceback (most recent call last):
File “/home/user/catkin_ws/src/my_moving_cube_pkg/scripts/my_start_deepq.py”, line 8, in
import my_one_disk_walk
File “/home/user/catkin_ws/src/my_moving_cube_pkg/scripts/my_one_disk_walk.py”, line 10, in
from tf.transformations import euler_from_quaternion
File “/opt/ros/kinetic/lib/python2.7/dist-packages/tf/init.py”, line 28, in
from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
File “/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/init.py”, line 38, in
from tf2_py import *
File “/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_py/init.py”, line 38, in
from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)
[movingcube_gym-1] process has died [pid 21237,exit code 1, cmd /home/user/catkin_ws/src/my_moving_cube_pkg/scripts/my_start_deepq.py __name:=movingcube_gym __log:=/home/user/.ros/log/8baf16b4-5c20-11ea-aea7-0a568a31e1d1/movingcube_gym-1.log].
log file: /home/user/.ros/log/8baf16b4-5c20-11ea-aea7-0a568a31e1d1/movingcube_gym-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor…
… shutting down processing monitor complete

I tried a few other things with new reloaded consoles )
source ~/.catkin_ws_python3/openai_venv/bin/activate
source ~/.catkin_ws_python3/devel/setup.bash
the tf verification is ok but the launch file is not recognized.

If i then i add
cd /home/user/catkin_ws
source devel/setup.bash
I am able to launch the file but the tf is no more recognized.

In the live course #81 we use a special catkin_make
catkin_make -DPYTHON_EXECUTABLE:FILEPATH=~/python3_ws/py3venv/bin/python
why dont we use it in this module adapted to the ~/.catkin_ws_python3/openai_venv/ ?

Ok try this:

cd /home/user/catkin_ws
source ~/.py3venv/bin/activate
source /home/user/.catkin_ws_python3/devel/setup.bash
rospack profile

This should source the python3 compiled geometry ROS package.

The OpenAI ROS course might be getting outdated to the latest changes. This is the workspace created for python3 packages.

I supose that this issue is happeining in the course.

Please notify us if it doesnt work

1 Like


Below is the original sequence of commands at the end of the unit 6
source ~/.catkin_ws_python3/openai_venv/bin/activate
source ~/.catkin_ws_python3/devel/setup.bash (note 2a)
cd /home/user/catkin_ws
rm -rf build devel
source devel/setup.bash
roslaunch my_moving_cube_pkg my_start_training_deepq_version.launch

I did exactly theses steps followed by the roslaunch.
cd /home/user/catkin_ws
source ~/.py3venv/bin/activate (note 1)
source /home/user/.catkin_ws_python3/devel/setup.bash (note 2b)
rospack profile
roslaunch my_moving_cube_pkg my_start_training_deepq_version.launch

But i have the following error message
[my_start_training_deepq_version.launch] is neither a launch file in package [my_moving_cube_pkg] nor is [my_moving_cube_pkg] a launch file name

I have a few questions
If i use the ~/.py3venv instead of the ~/.catkin_ws_python3/openai_venv
why i still have to source home/user/.catkin_ws_python3/devel/setup.bash ?

I did recompile the hole thing with the ~/.py3venv ? with the following sequence
cd /home/user/catkin_ws
source ~/.py3venv/bin/activate (note 1)
source /home/user/.catkin_ws_python3/devel/setup.bash (note 2b)
rospack profile
rm -rf build devel
source devel/setup.bash
roslaunch my_moving_cube_pkg my_start_training_deepq_version.launch

Now i get a new error message
File “/home/user/catkin_ws/src/my_moving_cube_pkg/scripts/my_start_deepq.py”, line 3, in
** import gym**
ImportError: No module named 'gym’