Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of AMENT_PREFIX_PATH #832

Closed
traversaro opened this issue Jul 18, 2021 · 3 comments · Fixed by #868
Closed

Fix use of AMENT_PREFIX_PATH #832

traversaro opened this issue Jul 18, 2021 · 3 comments · Fixed by #868

Comments

@traversaro
Copy link
Member

traversaro commented Jul 18, 2021

The AMENT_PREFIX_PATH environment variable can be used to specify non-standard directory and prefixes that are looked into for the ament_index (https://github.com/ament/ament_index), that is the resource retrieval system used by ROS2. However, in this repo and in several other repos (icub-models, idyntree) we assumed that for a given <install_prefix>, <install_prefix>/share should be added to AMENT_PREFIX_PATH. However, this is wrong, and even if I can't find a clear documentation page for AMENT_PREFIX_PATH, by using ament_index and inspecting the source code of ament-related code (for example https://github.com/ament/ament_cmake/blob/84e1cea2df62102509de530a5b1bb6d8cde2b5a2/ament_cmake_core/cmake/index/ament_index_get_prefix_path.cmake#L37 ) it is clear that <install_prefix> should be appended to AMENT_PREFIX_PATH, not <install_prefix>\share.

@traversaro
Copy link
Member Author

traversaro commented Jul 18, 2021

I wonder if the same problem affects pinocchio: https://github.com/stack-of-tasks/pinocchio/blob/a1df23c2f183d84febdc2099e5fbfdbd1fc8018b/src/utils/file-explorer.cpp#L48 , that is the original space from which we took the inspiration.

@traversaro
Copy link
Member Author

To double check, I installed ROS Noetic and ROS Foxy in a machine and I checked the value of this env vars, see:

codespace ➜ ~ $ rosversion -d
noetic
codespace ➜ ~ $ echo $ROS_PACKAGE_PATH 
/opt/ros/noetic/share

and

codespace ➜ /workspaces/robotology-superbuild (master ✗) $ echo $AMENT_PREFIX_PATH 
/opt/ros/foxy

Indeed, AMENT_PREFIX_PATH contains <prefix>, while ROS_PACKAGE_PATH contains <prefix>/share .

@traversaro
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant