-
Notifications
You must be signed in to change notification settings - Fork 101
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
[ROS2] Loading plugins from a non-ROS package #161
Comments
A slightly messy workaround is to manually append the non-ROS package containing the libraries I want to load to the edit: It also looks for an empty file with the same name as the package at a specific path within the package install directory: |
In ROS 1, the paths to all packages used in the project workspace are added to the
ROS_PACKAGE_PATH
environment variable, including pure CMake packages. This allows pluginlib to find libraries defined in non-ROS libraries, since the ROS 1 implementation of ClassLoader usesros::package::path()
.However, in ROS 2 there are different environment variables for
CMAKE_PREFIX_PATH
andAMENT_PREFIX_PATH
. The first one contains all CMake packages used in my project, while the second one is a subset of the first only containing ament CMake packages. The ROS 2 implementation of ClassLoader usesament_index_cpp::get_package_prefix()
, which apparently only looks for packages inAMENT_PREFIX_PATH
. This means that (so far) I can no longer load libraries defined in non-ROS packages.The Tesseract motion planning pipeline is an example of something affected by this difference in behavior. The tesseract_plugins package defines several plugins which use libraries created by the ROS-agnostic tesseract_collision package, and these plugins are loaded at runtime by classes in the tesseract_monitoring ROS package. This works just fine in ROS 1 but in my ROS 2 port I get errors like:
Any thoughts? I'd be open to package configuration workarounds on my end as well.
(pinging @Levi-Armstrong as the Tesseract package maintainer)
The text was updated successfully, but these errors were encountered: