Chapter 8 - Problem with launch file

Hello,

after launch:

my_start_training_deepq_version.launch

I give error:

[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
The traceback for the exception was written to the log file

My launch file is the same as in the notebook.
I attach ss.

make sure you build the workspace and source the setup file. Otherwise ROS doesn’t know those names;

roscd; cd …
catkin_make
source ~/catkin_ws/devel/setup.bash

WARNING: make sure to create new packages by calling catkin_create_pkg and not just creating a new folder and copying the files from a different package. The package.xml and CMakeLists.txt have the package name defined on top. THIS is where the package is defined, not the folder name. Make sure it is defined correctly here.

I carry out these commands, according to the course (pictured), but the problem remains. My package contains these files. I created it using the catkin_create_pkg command.

1 Like

did you source the setup.bash after building the workspace? This looks like the typical case of not having sourced the devel/setup.bash

Can you do roscd to the package my_moving_cube_pkg? Is the my_start_training_deepq_version.launch in the launch folder?
And as @ simon.steinmann91 said, please check you compiled and sourced.

I have same problem here. The reason is after source python3 setup file, “source ~/.catkin_ws_python3/devel/setup.bash”, the roslaunch cannot find the package. But if does not source the setup file, it will have problem to import tf package. The package run successfully under python2 environment. I also tired to do “catkin_make” under python3 env and source setup file, but it does not work.

Ok , I think I found the issue, which were actually two:

  1. This first issue is due to the fact that the catkin_ws is NOT in the ROS_PACKAGE_PATH that sets the setup.bash from :

source ~/.catkin_ws_python3/devel/setup.bash
echo $ROS_PACKAGE_PATH
/home/user/.catkin_ws_python3/src:/home/simulations/public_sim_ws/src:/opt/ros/kinetic/share

So to make this work you have to remove the existing builds of the catkin_ws and compilethem again and then source. We cant source directly because then the catkin_ws_python3 WONT be in the path nad then we will have issues with tf2 not being compiled for Python3… Long story short, you have to do this and it should launch:

source ~/.catkin_ws_python3/openai_venv/bin/activate
source ~/.catkin_ws_python3/devel/setup.bash
cd /home/user/catkin_ws
rm -rf build devel
catkin_make
source devel/setup.bash
roslaunch my_moving_cube_pkg my_start_training_deepq_version.launch

  1. Then another issue appera which has to do with the besrion of baselines and openai bug. To solve it just commen the line

register(
id=‘MyTrainingEnv-v0’,
entry_point=‘template_my_training_env:MovingCubeOneDiskWalkEnv’,
#timestep_limit=timestep_limit_per_episode,
)

And you should have the cube running:

cube

Hope it helped. I’m going to upload the changes into the notebooks.

1 Like

This is the right answer. We need to remove the devel and build directory before catkin_make. After re-compile at Python3 env, it works. And we can replace “timestep_limit” with “max_episode_steps”, it can launch successfully.

Hi i performed the steps aformentioned however i get the following issue:

I think there is a problem with the Euler library that is compatible with Python 2. Can someone hint me please???

I I followed aforementioned indications to launch the Deepq algoritm in virtual environment (with Python 3):


but still get the error.

Another point i would like to mention is that the jupiternotebook indication doesn t work for me.
I perform the command “python --version”

Any idea about all these points ? What am i doing wrong ???

Even doing all the steps when I do catkin_make it still finds python2 as interpreter even if I’m using the virtual environment… any ideas?

Two questions:

  • Did you source the Python3 environment?
  • Are you compiling indicating the specific location of the Python3 executable?
    catkin_make -DPYTHON_EXECUTABLE:FILEPATH=/home/user/python3_ws/py3env/bin/python
2 Likes

Thank you Ricardo, by specifying the version of python I solved my problem.

Actually using your command " catkin_make -DPYTHON_EXECUTABLE:FILEPATH=/home/user/python3_ws/py3env/bin/python" I got the following error “CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find PythonInterp: Found unsuitable version “1.4”, but required
is at least “2” (found /home/user/python3_ws/py3env/bin/python)”

Instead using this catkin command I was able to compile successfully
“catkin build -DCATKIN_ENABLE_TESTING=0 -DCMAKE_BUILD_TYPE=Release -DPYTHON_VERSION=3.5”

1 Like

The issue is we must compile tf in python3 env.
Thanks! It works!

Hi @rtellez ! Can you kindly update the python notebook of Unit 8? The new comming students may be easier to follow.

source ~/.catkin_ws_python3/openai_venv/bin/activate
source ~/.catkin_ws_python3/devel/setup.bash
cd /home/user/catkin_ws
rm -rf build devel
catkin build -DCATKIN_ENABLE_TESTING=0 -DCMAKE_BUILD_TYPE=Release -DPYTHON_VERSION=3.5
# catkin_make (this does not work)
source devel/setup.bash
roslaunch my_moving_cube_pkg my_start_training_deepq_version.launch