Can't find TestActuatorHardware in `ros2_control` tests.
I'm trying to develop my own ros2_control
controller.
I'm starting here
https://control.ros.org/master/doc/ro...
and then more or less following along with admittance_controller
here, using PickNik's generate_parameter_library
to update to the new approaches in ros2_controllers
.
I believe I have a skeleton implementation and all the required methods filled in, and I'm trying to run a controller load test, but my test can't find TestActuatorHardware
:
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from TestLoadMyCustomController
[ RUN ] TestLoadMyCustomController.load_controller
[INFO] [1666914636.756125863] [resource_manager]: Loading hardware 'TestActuatorHardware'
unknown file: Failure
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 robotiq_driver/RobotiqGripperHardwareInterface" thrown in the test body.
[ FAILED ] TestLoadMyCustomController.load_controller (1 ms)
[----------] 1 test from TestLoadMyCustomController (1 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (1 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] TestLoadMyCustomController.load_controller
1 FAILED TEST
I do not yet have a minimal reproduction. That's probably the next step so I can simply share the whole thing, but if someone can save me the effort and knows what's happening here, it would be appreciated.
It seems to me like the test is just not finding many ros2_control
controller plugins. Sometimes the list is blank, and there should be a lot more exported controllers available in my installation.
Minimal reproduction here: https://github.com/danzimmerman/dz_mi...
Test result output in the README there.
I reduced the differences against the
package.xml
andCMakeLists.txt
ofadmittance_controller
on the branch https://github.com/danzimmerman/dz_mi... so it's easier to look at side-by-side.I started the original package with
ros2 pkg create
which I think was a mistake.This seems to be a test issue only. I also had the
PLUGINLIB_CLASS_EXPORT
inside the controller namespace, but fixing that didn't fix thecolcon test
failure.However, now that it's fixed, the controller loads and runs correctly from an ordinary launch file.
ros2 launch dz_minimal_controller controller_load.launch.py
from the branchhttps://github.com/danzimmerman/dz_mi...
works.