Hi everybody,
i’m working on a 4 wheel autonomous robot simulation with ROS and Gazebo.
Currently it operates with the diff-drive plugin but i’m planning on switching to an ackerman steering approach. Therefore im trying to setup ros2_control, but i got quiet some problems with it:
My setup:
Ubuntu 20.04
Ros Foxy
Gazebo 11.11.0
installed ros2_control package via sudo apt install ros-foxy-gazebo-ros2-control
installed gazebo_ros2_control package via sudo apt install ros-foxy-gazebo-ros2-control
Inside my URDF File i configured ros2_control as follows:
<!-- Position Config -->
<ros2_control name="GazeboSystem" type="system">
<hardware>
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
<!-- <plugin>test_system</plugin> -->
</hardware>
<joint name="front_right_steer_joint">
<command_interface name="position">
<param name="min">-0.45</param>
<param name="max">0.45</param>
</command_interface>
<state_interface name="position"/>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="front_left_steer_joint">
<command_interface name="position">
<param name="min">-0.45</param>
<param name="max">0.45</param>
</command_interface>
<state_interface name="position"/>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
</ros2_control>
I also added the gazebo_ros2_control plugin to the URDF file:
<gazebo>
<plugin filename="libgazebo-ros2_control.so" name="gazebo_ros2_control">
<parameters>$(find tunnel_bot)/config/steering_controller_position.yaml</parameters>
</plugin>
</gazebo>
And thats the used config file steering_controller_position.yaml
:
controller_manager:
ros__parameters:
update_rate: 1 # Hz
joint_trajectory_controller:
type: joint_trajectory_controller/JointTrajectoryController
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
joint_trajectory_controller:
ros__parameters:
joints:
- front_right_steer_joint
- front_left_steer_joint
interface_name: position
command_interfaces:
- position
state_interfaces:
- position
- velocity
Now lets get into the issue:
When using the ros2_control hardware plugin gazebo_ros2_control/GazeboSystem
im getting the following error:
[ros2_control_node-1] terminate called after throwing an instance of 'pluginlib::LibraryLoadException'
[ros2_control_node-1] what(): According to the loaded plugin descriptions the class gazebo_ros2_control/GazeboSystem with base class type hardware_interface::SystemInterface does not exist. Declared types are fake_components/GenericSystem test_hardware_components/TestSystemCommandModes test_hardware_components/TestTwoJointSystem test_system
what finally leads to:
[ERROR] [ros2_control_node-1]: process has died [pid 135528, exit code -6, cmd '/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_3n96b75a --params-file /home/ima-untow/dev_ws/install/tunnel_bot/share/tunnel_bot/config/steering_controller_position.yaml'].
but when i search for the gazebo_ros2_control package
i find inside /opt/ros/foxy/share/gazebo_ros2_control/gazebo_hardware_plugins.xml
this:
<library path="gazebo_hardware_plugins">
<class
name="gazebo_ros2_control/GazeboSystem"
type="gazebo_ros2_control::GazeboSystem"
base_class_type="gazebo_ros2_control::GazeboSystemInterface">
<description>
GazeboPositionJoint
</description>
</class>
</library>
which in my eyes indicates that the plugin indeed is available.
If i use the test_system plugin istead:
<ros2_control name="GazeboSystem" type="system">
<hardware>
<!-- <plugin>gazebo_ros2_control/GazeboSystem</plugin> -->
<plugin>test_system</plugin>
</hardware>
...(same as above)...
</ros2_control>
i get the following error:
[ros2_control_node-1] terminate called after throwing an instance of 'std::runtime_error'
[ros2_control_node-1] what(): Wrong state or command interface configuration.
[ros2_control_node-1] missing state interfaces:
[ros2_control_node-1] ' front_right_steer_joint/effort ' ' front_left_steer_joint/effort '
[ros2_control_node-1] missing command interfaces:
[ros2_control_node-1] ' front_right_steer_joint/position ' ' front_left_steer_joint/position '
So at this point i’m totally confused, because in my opinion the interfaces aren’t missing. Dont get me wrong, im trying to use the gazebo_ros2_control/GazeboSystem
but thought it may be relevant that the output changes when using the test_system
.
Can anyone help me out? Any hint is appreciated.
Thanks alot in advance.
P.S. If any further documentation or log-files are needed just say so - i’m quiet new to this.