0
$\begingroup$

I was following the ROS2 control hardware interface checklist with some additional resources, like ROS2 control examples and some actual implementations.

I got the plugin to compile and to load, but I'm stuck at this lovely error message:

Caught exception of type : N9pluginlib20CreateClassExceptionE while loading hardware: MultiLibraryClassLoader: Could not create class of type test_hardware/TestActuator.

In an attempt to find my mistake I stripped away more and more and now I've everything removed but I'm still getting the error. Has someone any idea whats going wrong here?

I created a new Repo with my M(not)WE here.

Build:

colcon build -DBUILD_TESTING=1 --packages-select test_hardware

Run:

ros2 launch test_hardware view_1dof.launch.py

Error:

[INFO] [launch]: All log files can be found below /home/user/.ros/log/2024-11-19-16-34-10-761991-Rechenmaschine-6390
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [6394]
[INFO] [robot_state_publisher-2]: process started with pid [6395]
[INFO] [spawner-3]: process started with pid [6396]
[ros2_control_node-1] [INFO] [1732034050.952412737] [controller_manager]: Subscribing to '/robot_description' topic for robot description.
[ros2_control_node-1] [INFO] [1732034050.952552074] [controller_manager]: update rate is 10 Hz
[ros2_control_node-1] [WARN] [1732034050.952659563] [controller_manager]: Could not enable FIFO RT scheduling policy: with error number <1>(Operation not permitted). See [https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html] for details on how to enable realtime scheduling.
[robot_state_publisher-2] [INFO] [1732034050.957780548] [robot_state_publisher]: Robot initialized
[ros2_control_node-1] [INFO] [1732034050.957913809] [controller_manager]: Received robot description from topic.
[ros2_control_node-1] [INFO] [1732034050.959827028] [controller_manager.resource_manager]: Loading hardware 'WheelJoint' 
[ros2_control_node-1] [ERROR] [1732034050.960321658] [controller_manager.resource_manager]: Caught exception of type : N9pluginlib20CreateClassExceptionE while loading hardware: MultiLibraryClassLoader: Could not create class of type test_hardware/TestActuator
[ros2_control_node-1] [WARN] [1732034050.960382632] [controller_manager]: Could not load and initialize hardware. Please check previous output for more details. After you have corrected your URDF, try to publish robot description again.
[spawner-3] [INFO] [1732034051.278139569] [spawner_forward_position_controller]: waiting for service /controller_manager/list_controllers to become available...
[ros2_control_node-1] [WARN] [1732034051.952014765] [controller_manager]: Waiting for data on 'robot_description' topic to finish initialization
[ros2_control_node-1] [WARN] [1732034052.951998904] [controller_manager]: Waiting for data on 'robot_description' topic to finish initialization
[ros2_control_node-1] [WARN] [1732034053.952009371] [controller_manager]: Waiting for data on 'robot_description' topic to finish initialization

Ubuntu 24, ROS2 Rolling

$\endgroup$

1 Answer 1

2
$\begingroup$

It is a matter of "find the 7 differences". The error message is giving you a hint:

[ros2_control_node-1] [ERROR] [1732034050.960321658] [controller_manager.resource_manager]: Caught exception of type : N9pluginlib20CreateClassExceptionE while loading hardware: MultiLibraryClassLoader: Could not create class of type test_hardware/TestActuator

Taking a look at your plugin definition

<class name="test_hardware/TestActuator" type="test_hardware/TestActuator" base_class_type="hardware_interface::ActuatorInterface">

Indeed type="test_hardware/TestActuator" should be type=test_hardware::TestActuator

$\endgroup$
2
  • $\begingroup$ Thank you. I was starring at this for far too long. $\endgroup$ Commented Nov 20 at 18:14
  • $\begingroup$ Glad I could help $\endgroup$ Commented Nov 21 at 0:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.