Controller for robots

asked 2018-07-27 09:36:37 -0500

vonunwerth gravatar image

Hi, i found two ways to setup a controller to drive around with my mobile platform robot and am a bit confused. First I found the way to create a new xacro file and will it with a gazebo-tag and options for the controller:

  <plugin name="skid_steer_drive_controller" filename="">

Whats this file

The second way is to load a controller in my gazebo launch file like that:

<rosparam command="load" file="$(find robot_description)/urdf/ROS/control.yaml" />
  <node name="controller_spawner" pkg="controller_manager" type="spawner" 
args="robot_joint_publisher robot_velocity_controller"/>

Then I had this .yaml file for all the settings:

  type: "joint_state_controller/JointStateController"
  publish_rate: 50

  type: "diff_drive_controller/DiffDriveController"
  left_wheel: ['joint_base_wheel_front_left', 'joint_base_wheel_rear_left']
  right_wheel: ['joint_base_wheel_front_right', 'joint_base_wheel_front_right']
  publish_rate: 100
  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.25

  # Base frame_id
  base_frame_id: robot_base_link

# 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: 0.580
  wheel_radius_multiplier    : 0.32

  # Velocity and acceleration limits
      has_velocity_limits    : true
      max_velocity           : 0.9   # m/s
      has_acceleration_limits: true
      max_acceleration       : 3.0   # m/s^2
      has_velocity_limits    : true
      max_velocity           : 2.0   # rad/s
      has_acceleration_limits: true
      max_acceleration       : 6.0   # rad/s^2

In option 1 I added the topic to publish the odometry and so on. In the second way i didnt. Where does ROS know how to publish those things?

To use all of this I have to add a transmission tag to my wheels like that. Is that right?

 <transmission name="trans_wheel_${front_rear}_${left_right}">
    <joint name="joint_base_wheel_${front_rear}_${left_right}">
    <actuator name="motor_wheel_${front_rear}_${left_right}">

Are this two described ways the same thing or does it make any difference to do it like one of this ways? Are these ways common to setup the control setting for a robot or did i do incorrect things?

Thanks for your help Max

edit retag flag offensive close merge delete



Not a complete answer, but: your "first way" is using the skid_steer_drive_controller plugin provided by Gazebo, while the "second way" is using the DiffDriveController plugin from ros_control (hosted by gazebo_ros_control in Gazebo).

Those are definitely not the same.

gvdhoorn gravatar image gvdhoorn  ( 2018-07-27 10:28:08 -0500 )edit