ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Can't find TestActuatorHardware in `ros2_control` tests.

asked 2022-10-27 19:00:22 -0600

danzimmerman gravatar image

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.

edit retag flag offensive close merge delete

Comments

Minimal reproduction here: https://github.com/danzimmerman/dz_mi...

Test result output in the README there.

danzimmerman gravatar image danzimmerman  ( 2022-10-28 18:06:07 -0600 )edit

I reduced the differences against the package.xml and CMakeLists.txt of admittance_controlleron 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.

danzimmerman gravatar image danzimmerman  ( 2022-10-28 20:00:49 -0600 )edit

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 the colcon test failure.

However, now that it's fixed, the controller loads and runs correctly from an ordinary launch file.

danzimmerman gravatar image danzimmerman  ( 2022-11-04 19:56:18 -0600 )edit

ros2 launch dz_minimal_controller controller_load.launch.py from the branch

https://github.com/danzimmerman/dz_mi...

works.

danzimmerman gravatar image danzimmerman  ( 2022-11-04 19:57:32 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-09 22:18:06 -0600

danzimmerman gravatar image

This looks like perhaps it's just a problem not being up-to-date with ros2_control but cribbing from a bleeding-edge test in admittance_controller.

I started a new virtual env and installed a bunch of ros2_control-related packages from source, and now my test passes:

[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from TestLoadDzMinimalController
[ RUN      ] TestLoadDzMinimalController.load_controller
[INFO] [1668053588.268818404] [resource_manager]: Loading hardware 'TestActuatorHardware' 
[INFO] [1668053588.269133031] [resource_manager]: Initialize hardware 'TestActuatorHardware' 
[INFO] [1668053588.269149398] [resource_manager]: Successful initialization of hardware 'TestActuatorHardware'
[INFO] [1668053588.269161442] [resource_manager]: Loading hardware 'TestSensorHardware' 
[INFO] [1668053588.269218916] [resource_manager]: Initialize hardware 'TestSensorHardware' 
[INFO] [1668053588.269227868] [resource_manager]: Successful initialization of hardware 'TestSensorHardware'
[INFO] [1668053588.269234006] [resource_manager]: Loading hardware 'TestSystemHardware' 
[INFO] [1668053588.269277314] [resource_manager]: Initialize hardware 'TestSystemHardware' 
[INFO] [1668053588.269286159] [resource_manager]: Successful initialization of hardware 'TestSystemHardware'
[INFO] [1668053588.282571466] [test_controller_manager]: Loading controller 'load_dz_minimal_controller'
[       OK ] TestLoadDzMinimalController.load_controller (24 ms)
[----------] 1 test from TestLoadDzMinimalController (24 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (24 ms total)
[  PASSED  ] 1 test.
edit flag offensive delete link more

Comments

(Note on the virtual environment, I'm using Humble installed via Robostack https://robostack.github.io/ and had a mix of binary packages with tag 2.12 and 2.13 from the ros2_control repo.)

danzimmerman gravatar image danzimmerman  ( 2022-11-09 22:33:25 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-10-27 19:00:22 -0600

Seen: 318 times

Last updated: Nov 09 '22