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 for plugin tests #3

Open
christian-rauch opened this issue Oct 28, 2024 · 1 comment
Open

fix for plugin tests #3

christian-rauch opened this issue Oct 28, 2024 · 1 comment

Comments

@christian-rauch
Copy link

christian-rauch commented Oct 28, 2024

I know you seem to have fixed your issue with newer packages. But I think this is not the real solution.

I encountered the same issue on an up-to-date humble installation and found the following. I am just mentioning this here, since some of your branches mention in the README that the problem was fixed by upgrading packages, but there are actually still other steps involved. I hope this helps others who encounter the same issue.

Missing dependency on hardware_interface_testing

First, I got:

C++ exception with description "According to the loaded plugin descriptions the class test_actuator with base class type hardware_interface::ActuatorInterface does not exist. Declared types are  test_hardware_components/TestSingleJointActuator" thrown in the test body.

The test_actuator is defined in hardware_interface_testing:
https://github.com/ros-controls/ros2_control/blob/1d67297e5472ca868bd16f6441ab52bedde66e80/hardware_interface_testing/test/test_components/test_components.xml#L3-L7

So a sudo apt install ros-humble-hardware-interface-testing fixed that issue, but it should still be added to the package.xml as <test_depend>hardware_interface_testing</test_depend>.

Macro PLUGINLIB_EXPORT_CLASS called inside dz_minimal_controller namespace

The next issue was a symbol lookup issue.

[...]/build/dz_minimal_controller/test_load_dz_minimal_controller: symbol lookup error: [...]/install/dz_minimal_controller/lib/libdz_minimal_controller.so: undefined symbol: _ZN21dz_minimal_controller12class_loader4impl30getCurrentlyLoadingLibraryNameB5cxx11Ev

_ZN21dz_minimal_controller12class_loader4impl30getCurrentlyLoadingLibraryNameB5cxx11Ev demangles to:

c++filt _ZN21dz_minimal_controller12class_loader4impl30getCurrentlyLoadingLibraryNameB5cxx11Ev
dz_minimal_controller::class_loader::impl::getCurrentlyLoadingLibraryName[abi:cxx11]()

It's a bit weird that the class_loader should be in the dz_minimal_controller namespace and indeed on the main branch the PLUGINLIB_EXPORT_CLASS macro is called inside the dz_minimal_controller namespace:

#include "pluginlib/class_list_macros.hpp"
PLUGINLIB_EXPORT_CLASS(
dz_minimal_controller::DzMinimalController, controller_interface::ControllerInterface)
} // namespace dz_minimal_controller

and moving it out of the namespace, like on the dz/cargo-cult-admittance-cmake branch:
} // namespace dz_minimal_controller
#include "pluginlib/class_list_macros.hpp"
PLUGINLIB_EXPORT_CLASS(
dz_minimal_controller::DzMinimalController, controller_interface::ControllerInterface)

eventually fixes the issue.

I can then call

colcon test --event-handlers=console_direct+

and finally get

100% tests passed, 0 tests failed out of 1
@danzimmerman
Copy link
Owner

Thanks for the info. I haven't run this for a while and will take a look at and fix the main branch accordingly.

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

No branches or pull requests

2 participants