Project

General

Profile

Actions

Bug #247

closed

.catkin generation

Added by Olivier Stasse about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-

Description

Dear robotpkg team,
It seems that there is a problem related to ros workspace chaining.
The current generation of .catkin prevent to do it properly.

Symptoms:
Assuming that the binaries or the robotpkg installation directory is /opt/openrobots.
Assuming that we have installed a ros package from robotpkg (such as talos_simulation)

When creating locally a catkin workspace with CMAKE_PREFIX_PATH pointing to /opt/openrobots with:
export CMAKE_PREFIX_PATH=/opt/openrobots:$CMAKE_PREFIX_PATH
mkdir -p /tmp/catkin_ws/src
cd /tmp/catkin_ws/src
catkin_init_workspace
cd ..;catkin_make
cd devel
source setup.bash
env | grep ROS_PACKAGE_PATH

gives
ROS_PACKAGE_PATH=/tmp/catkin_ws/src:

but it should be:

ROS_PACKAGE_PATH=/tmp/catkin_ws/src:/opt/openrobots/share:/opt/ros/melodic/share

This is fixed by doing:
rm /opt/openrobots/.catkin
touch /opt/openrobots/.catkin

set the size of .catkin to 0 instead of 1.

IMHO this is due to
43: ${ECHO} >${CATKIN_MARKER}
in devel/ros-catkin/files
using touch instead of echo seems to do the trick.

What do you think ?

Thanks for your time and help.

Olivier.

Actions #1

Updated by Anthony Mallet about 4 years ago

AFAIK the contents of the catkin marker file does not matter. I can
find only places where the existence of the file is checked.

Could it be a permission issue on the file (not readable by your user) ?

Actions #2

Updated by Olivier Stasse about 4 years ago

Anthony Mallet wrote in #note-1:

AFAIK the contents of the catkin marker file does not matter. I can
find only places where the existence of the file is checked.

At first I thought the same as well. As for instance rospack is just checking the existence.
However after reading what is really doing the file setup.sh created by catkin_make, I found out
that it is:
1/ crawling the directories specified in CMAKE_PREFIX_PATH,
2/ for each of this subdirectory:
- look if a subdirectory etc/catkin/profile.d exists
- list the hooks (sh/bat) present in this subdirectory
- return the list of the hooks
4/ each hook is then sourced by setup.sh

For /opt/ros/melodic/etc/profile.d they are 18 hooks among which there is
1.ros_package_path.sh
when this file is called by setup.sh it is reading the contents of .catkin.
If it is empty it is simply adding the directory containing the .catkin file
otherwise the contained data is split according to a ';' separation character and appended to the string.
As the /opt/openrobots/.catkin file has one character this character is used instead of /opt/openrobots.

Could it be a permission issue on the file (not readable by your user) ?

Unfortunately this is not.

Actions #3

Updated by Anthony Mallet about 4 years ago

OK, thanks for the detailed analysis!

Actions #4

Updated by Olivier Stasse about 4 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF