Ros2 control hardware plugin not found when using the Ignition Gazebo controller
I'm trying to use ROS2 control to direct the steering and driving of a 4 wheel steering robot. I'm using ROS2 humble (on Ubuntu 22.04.1) with Ignition Fortress and the latest version of the ROS2 control library (and the matching Ignition control library).
When I launch Ignition and my robot description, Ignition creates the controllers for the wheel steering and drive (based on the URDF). When the launch file later tries to create the position and velocity controllers the launch logs indicate that the ign_ros2_control/IgnitionSystem
hardware plugin cannot be found, even though this library is in my local workspace and has been built. The log reads
` [INFO] [ros2controlnode-8]: process started with pid [3452]
[ros2controlnode-8] [INFO] [1663472456.970382307] [resource_manager]: Loading hardware 'CratebotJointControl'
[ros2controlnode-8] terminate called after throwing an instance of 'pluginlib::LibraryLoadException'
[ros2controlnode-8] what(): According to the loaded plugin descriptions the class ignros2control/IgnitionSystem with base class type hardwareinterface::SystemInterface does not exist. Declared types are fakecomponents/GenericSystem mockcomponents/GenericSystem testhardwarecomponents/TestSystemCommandModes testhardwarecomponents/TestTwoJointSystem testsystem `
If I don't load the position and velocity controllers I can't connect to them and use them to drive the robot. However when I do try to load them, they load but may not be activated (even if the log says they were)
My launch files are:
My questions are:
- What do I need to do for the ROS code to find the correct hardware plugin. I would have thought that having it in the same workspace is enough, but apparently it's not.
- what is the correct way to load the position and velocity controllers such that this both works when using Ignition and in the real world? Or would I need two completely different launch files for both those cases
- Is there any extensive documentation that explains how to use ROS2 control with Ignition. I've found the demo repo but those are all simple examples with no explaination as to why things are done a specific way.
Asked by petrik on 2022-09-18 00:40:57 UTC
Answers
The answer is that my code didn't correctly disable the loading of the controller_manager
node when running inside Ignition. This was caused by using a LaunchConfiguration value in a python if statement. For the changes that were needed to fix it see: https://github.com/pvandervelde/cratebot_description/commit/0004762c4dc56610b8ff21523341171a7a4cc4f9
Additionally the controllers also need to be activated, see: https://github.com/pvandervelde/cratebot_description/commit/c937415b3156c595dbf1052221aa8f36c398ab6f
Asked by petrik on 2022-09-23 03:52:38 UTC
Comments