Problems with loading and configurating DiffDrive and JointStateBroadcaster controllers. [closed]
Hi. Sorry for all mistakes, English is not my native language. So I'm launching my gazebo simulation with JointStateBroadcaster and DiffDrive controllers. Gazebo loads without notable errors but then controllers start to load I receive following logs in terminal:
[gzserver-6] [INFO] [1670244707.718918444] [gazebo_ros2_control]: Loading controller_manager
[gzserver-6] [WARN] [1670244707.830804032] [gazebo_ros2_control]: Desired controller update period (0.02 s) is slower than the gazebo simulation period (0.001 s).
[gzserver-6] [INFO] [1670244707.831187703] [gazebo_ros2_control]: Loaded gazebo_ros2_control.
[gzserver-6] [INFO] [1670244707.880241583] [controller_manager]: Loading controller 'minicar_cll'
[gzserver-6] [INFO] [1670244707.969517659] [controller_manager]: Setting use_sim_time=True for minicar_cll to match controller manager (see ros2_control#325 for details)
[spawner.py-3] [INFO] [1670244707.973501681] [spawner_minicar_cll]: Loaded minicar_cll
[gzserver-6] [INFO] [1670244707.977437769] [controller_manager]: Configuring controller 'minicar_cll'
[gzserver-6] [INFO] [1670244708.048451910] [controller_manager]: Loading controller 'joint_s_b'
[gzserver-6] [INFO] [1670244708.178457173] [controller_manager]: Setting use_sim_time=True for joint_s_b to match controller manager (see ros2_control#325 for details)
[spawner.py-5] [INFO] [1670244708.200924658] [spawner_joint_s_b]: Loaded joint_s_b
[gzserver-6] [INFO] [1670244708.204831040] [controller_manager]: Loading controller 'joint_s_b'
[gzserver-6] [ERROR] [1670244708.205196239] [controller_manager]: A controller named 'joint_s_b' was already loaded inside the controller manager
[gzserver-6] [ERROR] [1670244708.226174298] [controller_manager]: Can't activate controller 'minicar_cll': Command interface with 'front_left_steering_joint/velocity' does not exist
[spawner.py-3] [INFO] [1670244708.255965445] [spawner_minicar_cll]: Configured and started minicar_cll
[gzserver-6] [INFO] [1670244708.262011951] [controller_manager]: Configuring controller 'joint_s_b'
[ERROR] [spawner.py-2]: process has died [pid 5069, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_s_b --ros-args'].
[INFO] [spawner.py-3]: process has finished cleanly [pid 5071]
[spawner.py-5] [INFO] [1670244708.351449614] [spawner_joint_s_b]: Configured and started joint_s_b
[INFO] [spawner.py-5]: process has finished cleanly [pid 5075]
[INFO] [spawner.py-9]: process started with pid [5305]
[gzclient-7] context mismatch in svga_surface_destroy
[gzclient-7] context mismatch in svga_surface_destroy
[spawner.py-9] [INFO] [1670244708.899426522] [spawner_minicar_cll]: Controller already loaded, skipping load_controller
[gzserver-6] [INFO] [1670244708.902372504] [controller_manager]: Configuring controller 'minicar_cll'
[gzserver-6] [ERROR] [1670244708.998457025] [controller_manager]: Can't activate controller 'minicar_cll': Command interface with 'front_left_steering_joint/velocity' does not exist
[spawner.py-9] [INFO] [1670244709.020476614] [spawner_minicar_cll]: Configured and started minicar_cll
minicar_cll here is diff_drive controller.
Here is yaml file with controllers settings:
controller_manager:
ros__parameters:
update_rate: 50 # Hz
use_sim_time: True
joint_s_b:
type: joint_state_broadcaster/JointStateBroadcaster
minicar_cll:
type: diff_drive_controller/DiffDriveController
minicar_cll:
ros__parameters:
left_wheel_names: ['front_left_wheel_joint', 'rear_left_wheel_joint', 'front_left_steering_joint', 'rear_left_steering_joint']
right_wheel_names: ['front_right_wheel_joint', 'rear_right_wheel_joint', 'front_right_steering_joint', 'rear_right_steering_joint']
publish_rate: 50.0
pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
twist_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
cmd_vel_timeout: 0.5
wheels_per_side: 1
preserve_turning_radius: true
base_frame_id: rs_t265_pose_frame
enable_odom_tf: false
angular:
steer:
front_max_angle: 1.047
rear_max_angle: 0.0
And that is transmission description:
<transmission name="${wheel_prefix}_steering_trans" type="SimpleTransmission">
<type>transmission_interface/SimpleTransmission</type>
<actuator name="${wheel_prefix}_steering_motor">
<hardwareInterface>PositionJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
<joint name="${wheel_prefix}_steering_joint">
<hardwareInterface>PositionJointInterface</hardwareInterface>
</joint>
</transmission>
<transmission name="${wheel_prefix}_wheel_trans" type="SimpleTransmission">
<type>transmission_interface/SimpleTransmission</type>
<actuator name="${wheel_prefix}_wheel_motor">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
<joint name="${wheel_prefix}_wheel_joint">
<hardwareInterface>VelocityJointInterface</hardwareInterface>
</joint>
</transmission>
</xacro:macro>
and ros2_control tag in robot description with gazebo plugin
<ros2_control name="GazeboSystem" type="system"> ...
would probably merit taking a second look at your launch file and your full URDF to make sure that you aren't accidentally including tags multiple times or starting controllers multiple times. Also, are you giving your model (and by extension the gazebo ros2 control plugin) enough time to load before trying to spawn your controller? The recommended way to launch would be using event handlers to make sure this is the case. Hard to give much more advice without seeing the launch file and the full terminal output.
Thank you for your help. I've updated the question.
Sorry, I noticed now that I'm trying to load my controllers from both of my launch files, suppose that was a reason for JointStateBroadcaster to be loaded twice. So only "Command interface with 'front_left_steering_joint/velocity' does not exist" is remains.