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

Set AMENT_PREFIX_PATH to $ENV{AMENT_PREFIX_PATH) in xacro-extras.cmake #359

Merged
merged 2 commits into from
Mar 20, 2025

Conversation

seantfish
Copy link

@seantfish seantfish commented Mar 16, 2025

I was having an issue where I have derivative_robot_description referencing xacro files from original_robot_description which refer to package://original_robot_description.

I am also using xacro-extras.cmake to generate urdf files on build from *.urdf.xacro files.

Upon building, I would encounter this error:

<class 'ament_index_python.packages.PackageNotFoundError'>: "package 'original_robot_description' not found, searching: ['/path/to/ws/build/derivative_robot_description/ament_cmake_index']" "package 'original_robot_description' not found, searching: ['/path/to/ws/build/derivative_robot_description/ament_cmake_index']"

Upon investigating the colcon build logs, I found that list(JOIN AMENT_PREFIX_PATH ":" AMENT_PREFIX_PATH_ENV) was not actually populating at all, and only PROJECT_BUILD_INDEX was doing anything in COMMAND ${CMAKE_COMMAND} -E env AMENT_PREFIX_PATH="${PROJECT_BUILD_INDEX}:${AMENT_PREFIX_PATH_ENV}" xacro -o ${abs_output} ${input} ${_XACRO_REMAP}.

This change sets AMENT_PREFIX_PATH to $ENV{AMENT_PREFIX_PATH} and fixes the build issue.

seantfish and others added 2 commits March 16, 2025 16:43
This variable is not used anymore in ament cmake files.
Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am surprised that this solves your issue.
You set the cmake variable AMENT_PREFIX_PATH, but you don't pass that variable to the environment when running xacro in line 89.
I suggest to get rid of AMENT_PREFIX_PATH_ENV, which doesn't seem to be used (anymore?).

@seantfish
Copy link
Author

I was under the impression that AMENT_PREFIX_PATH_ENV is a reformatted version of AMENT_PREFIX_PATH. Getting rid of AMENT_PREFIX_PATH_ENV seems to still solve the problem on my end. Thanks!

@rhaschke rhaschke merged commit 4691ada into ros:ros2 Mar 20, 2025
11 checks passed
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 this pull request may close these issues.

2 participants