ROS Controllers for Mobile Robot
A very common ROS controller used to control a mobile ground robot is diff_drive_controller. This controller can be used for two types of mobile ground robots:
- Mobile ground robot with two wheels using differential drive
- Mobile ground robot with four wheels using skid steering
This controller is basically a velocity controller as it commands the mobile robot by using velocity commands.
Differential Drive
A minimum YAML file for the controller looks like this:
1 2 3 4 5 6 |
mobile_base_controller: type: "diff_drive_controller/DiffDriveController" left_wheel: 'wheel_left_joint' right_wheel: 'wheel_right_joint' pose_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0] twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0] |
A complete YAML file for the controller looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
mobile_base_controller: type : "diff_drive_controller/DiffDriveController" left_wheel : 'wheel_left_joint' right_wheel : 'wheel_right_joint' publish_rate: 50.0 # default: 50 pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0] twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0] # Wheel separation and diameter. These are both optional. # diff_drive_controller will attempt to read either one or both from the # URDF if not specified as a parameter wheel_separation : 1.0 wheel_radius : 0.3 # Wheel separation and radius multipliers wheel_separation_multiplier: 1.0 # default: 1.0 wheel_radius_multiplier : 1.0 # default: 1.0 # Velocity commands timeout [s], default 0.5 cmd_vel_timeout: 0.25 # Base frame_id base_frame_id: base_footprint #default: base_link # Velocity and acceleration limits # Whenever a min_* is unspecified, default to -max_* linear: x: has_velocity_limits : true max_velocity : 1.0 # m/s min_velocity : -0.5 # m/s has_acceleration_limits: true max_acceleration : 0.8 # m/s^2 min_acceleration : -0.4 # m/s^2 has_jerk_limits : true max_jerk : 5.0 # m/s^3 angular: z: has_velocity_limits : true max_velocity : 1.7 # rad/s has_acceleration_limits: true max_acceleration : 1.5 # rad/s^2 has_jerk_limits : true max_jerk : 2.5 # rad/s^3 |
Skid Steering
The YAML file for skid steering looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
jackal_velocity_controller: type: "diff_drive_controller/DiffDriveController" left_wheel: ['front_left_wheel', 'rear_left_wheel'] right_wheel: ['front_right_wheel', 'rear_right_wheel'] publish_rate: 50 pose_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 0.03] twist_covariance_diagonal: [0.001, 0.001, 0.001, 1000000.0, 1000000.0, 0.03] cmd_vel_timeout: 0.25 # Odometry fused with IMU is published by robot_localization, so # no need to publish a TF based on encoders alone. enable_odom_tf: false # Wheel separation and radius multipliers wheel_separation_multiplier: 1.5 # default: 1.0 wheel_radius_multiplier : 1.0 # default: 1.0 # Velocity and acceleration limits # Whenever a min_* is unspecified, default to -max_* linear: x: has_velocity_limits : true max_velocity : 2.0 # m/s has_acceleration_limits: true max_acceleration : 20.0 # m/s^2 angular: z: has_velocity_limits : true max_velocity : 4.0 # rad/s has_acceleration_limits: true max_acceleration : 25.0 # rad/s^2 |
Ackermann Steering
For a mobile robot with Ackermann steering, the ackermann_steering_controller can be used.