Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

DiffDriveController (Skid Steering) isn't publishing to /cmd_vel

Hello!

I'm new to ROS and gazebo, and I've been facing some problems while trying to implement skid steering on my robot. Mainly, I am unable to move the robot at all. I tried to follow similar format to what was done on Jackal.

I am running ROS Melodic on Ubuntu 18.04.02 bionic

This is my transmission tag for the wheels:

<transmission name="${prefix}_${suffix}_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}_${suffix}_wheel_joint">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>  
    </joint>
    <actuator name="${prefix}_${suffix}_Motor">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface> 
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

This is my yaml file:

rover_joint_publisher:
  type: "joint_state_controller/JointStateController"
  publish_rate: 50

rover_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
  velocity_rolling_window_size: 2

  k_l: 0.1
  k_r: 0.1

  # Base frame_id
  base_frame_id: body

  # 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           : 1.0   # m/s
      has_acceleration_limits: true
      max_acceleration       : 3.0   # m/s^2
  angular:
    z:
      has_velocity_limits    : true
      max_velocity           : 2.0   # rad/s
      has_acceleration_limits: true
      max_acceleration       : 6.0 # rad/s^2

Since I've encountered some errors regarding the PID gains not being set, I have created a pid.yaml file and specified arbitrary pid gains:

/rover/gazebo_ros_control:
  pid_gains:
    front_left_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    front_right_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    rear_left_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    rear_right_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0

Afterwards, I loaded both files into launch file, spawned the controllers and started EKF localization:

  <!-- Spawn controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner"
args="rover_joint_publisher rover_velocity_controller"/>

  <!-- Start EKF for localization -->
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
    <rosparam command="load" file="$(find rover_control)/config/rover_localization.yaml" />
  </node>

After launching on Gazebo, I can see that the robot is slowly moving forward on its own. This is due to the set PID gain. If I increase the proportional gain then it moves faster.

I'm not sure what exactly is the problem, but I feel that the DiffDriveController isnt publishing to the /rover/cmd_vel.

Any help would be appreciated.

Thanks!

DiffDriveController (Skid Steering) isn't publishing to /cmd_vel

Hello!

I'm new to ROS and gazebo, and I've been facing some problems while trying to implement skid steering on my robot. Mainly, I am unable to move the robot at all. I tried to follow similar format to what was done on Jackal.

I am running ROS Melodic on Ubuntu 18.04.02 bionic

This is my transmission tag for the wheels:

<transmission name="${prefix}_${suffix}_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}_${suffix}_wheel_joint">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>  
    </joint>
    <actuator name="${prefix}_${suffix}_Motor">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface> 
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

This is my yaml file:

rover_joint_publisher:
  type: "joint_state_controller/JointStateController"
  publish_rate: 50

rover_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
  velocity_rolling_window_size: 2

  k_l: 0.1
  k_r: 0.1

  # Base frame_id
  base_frame_id: body

  # 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           : 1.0   # m/s
      has_acceleration_limits: true
      max_acceleration       : 3.0   # m/s^2
  angular:
    z:
      has_velocity_limits    : true
      max_velocity           : 2.0   # rad/s
      has_acceleration_limits: true
      max_acceleration       : 6.0 # rad/s^2

Since I've encountered some errors regarding the PID gains not being set, I have created a pid.yaml file and specified arbitrary pid gains:

/rover/gazebo_ros_control:
  pid_gains:
    front_left_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    front_right_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    rear_left_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    rear_right_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0

Afterwards, I loaded both files into launch file, spawned the controllers and started EKF localization:

  <!-- Spawn controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner"
args="rover_joint_publisher rover_velocity_controller"/>

  <!-- Start EKF for localization -->
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
    <rosparam command="load" file="$(find rover_control)/config/rover_localization.yaml" />
  </node>

After launching on Gazebo, I can see that the robot is slowly moving dragging forward on its own. This is due to the set PID gain. If I increase the proportional gain then it moves faster.

I'm not sure what exactly is the problem, but I feel that the DiffDriveController isnt publishing to the /rover/cmd_vel.

These are the listed active topics:

/client_count
/clock
/connected_clients
/diagnostics
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/imu/data
/odometry/filtered
/rosout
/rosout_agg
/rover/camera1/camera1_info
/rover/camera1/image_raw
/rover/camera1/image_raw/compressed
/rover/camera1/image_raw/compressed/parameter_descriptions
/rover/camera1/image_raw/compressed/parameter_updates
/rover/camera1/image_raw/compressedDepth
/rover/camera1/image_raw/compressedDepth/parameter_descriptions
/rover/camera1/image_raw/compressedDepth/parameter_updates
/rover/camera1/image_raw/theora
/rover/camera1/image_raw/theora/parameter_descriptions
/rover/camera1/image_raw/theora/parameter_updates
/rover/camera1/parameter_descriptions
/rover/camera1/parameter_updates
/rover/camera2/camera2_info
/rover/camera2/image_raw
/rover/camera2/image_raw/compressed
/rover/camera2/image_raw/compressed/parameter_descriptions
/rover/camera2/image_raw/compressed/parameter_updates
/rover/camera2/image_raw/compressedDepth
/rover/camera2/image_raw/compressedDepth/parameter_descriptions
/rover/camera2/image_raw/compressedDepth/parameter_updates
/rover/camera2/image_raw/theora
/rover/camera2/image_raw/theora/parameter_descriptions
/rover/camera2/image_raw/theora/parameter_updates
/rover/camera2/parameter_descriptions
/rover/camera2/parameter_updates
/rover/cmd_vel
/rover/gazebo_ros_control/pid_gains/front_left_wheel_joint/parameter_descriptions
/rover/gazebo_ros_control/pid_gains/front_left_wheel_joint/parameter_updates
/rover/gazebo_ros_control/pid_gains/front_right_wheel_joint/parameter_descriptions
/rover/gazebo_ros_control/pid_gains/front_right_wheel_joint/parameter_updates
/rover/gazebo_ros_control/pid_gains/rear_left_wheel_joint/parameter_descriptions
/rover/gazebo_ros_control/pid_gains/rear_left_wheel_joint/parameter_updates
/rover/gazebo_ros_control/pid_gains/rear_right_wheel_joint/parameter_descriptions
/rover/gazebo_ros_control/pid_gains/rear_right_wheel_joint/parameter_updates
/rover/imu
/rover/laser/scan
/rover_velocity_controller/odom
/set_pose
/tf
/tf_static

Any help would be appreciated.

Thanks!

DiffDriveController (Skid Steering) isn't publishing to /cmd_vel

Hello!

I'm new to ROS and gazebo, and I've been facing some problems while trying to implement skid steering on my robot. Mainly, I am unable to move the robot at all. I tried to follow similar format to what was done on Jackal.

I am running ROS Melodic on Ubuntu 18.04.02 bionic

This is my transmission tag for the wheels:

<transmission name="${prefix}_${suffix}_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="${prefix}_${suffix}_wheel_joint">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>  
    </joint>
    <actuator name="${prefix}_${suffix}_Motor">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface> 
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

This is my yaml file:

rover_joint_publisher:
  type: "joint_state_controller/JointStateController"
  publish_rate: 50

rover_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
  velocity_rolling_window_size: 2

  k_l: 0.1
  k_r: 0.1

  # Base frame_id
  base_frame_id: body

  # 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           : 1.0   # m/s
      has_acceleration_limits: true
      max_acceleration       : 3.0   # m/s^2
  angular:
    z:
      has_velocity_limits    : true
      max_velocity           : 2.0   # rad/s
      has_acceleration_limits: true
      max_acceleration       : 6.0 # rad/s^2

Since I've encountered some errors regarding the PID gains not being set, I have created a pid.yaml file and specified arbitrary pid gains:

/rover/gazebo_ros_control:
  pid_gains:
    front_left_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    front_right_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    rear_left_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0
    rear_right_wheel_joint:
      p: 1.0
      i: 0.0
      d: 0.0

Afterwards, I loaded both files into launch file, spawned the controllers and started EKF localization:

  <!-- Spawn controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner"
args="rover_joint_publisher rover_velocity_controller"/>

  <!-- Start EKF for localization -->
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
    <rosparam command="load" file="$(find rover_control)/config/rover_localization.yaml" />
  </node>

After launching on Gazebo, I can see that the robot is slowly dragging forward forward/backward on its own. This is due to the set PID gain. If I increase the proportional gain then it moves faster.faster in an unpredictable manner.

Here is a video demonstrating low proportional gain: https://youtu.be/BH7cUZeZc74

I'm not sure what exactly is the problem, but I feel that the DiffDriveController isnt publishing to the /rover/cmd_vel.

These are the listed active topics:

/client_count
/clock
/connected_clients
/diagnostics
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/imu/data
/odometry/filtered
/rosout
/rosout_agg
/rover/camera1/camera1_info
/rover/camera1/image_raw
/rover/camera1/image_raw/compressed
/rover/camera1/image_raw/compressed/parameter_descriptions
/rover/camera1/image_raw/compressed/parameter_updates
/rover/camera1/image_raw/compressedDepth
/rover/camera1/image_raw/compressedDepth/parameter_descriptions
/rover/camera1/image_raw/compressedDepth/parameter_updates
/rover/camera1/image_raw/theora
/rover/camera1/image_raw/theora/parameter_descriptions
/rover/camera1/image_raw/theora/parameter_updates
/rover/camera1/parameter_descriptions
/rover/camera1/parameter_updates
/rover/camera2/camera2_info
/rover/camera2/image_raw
/rover/camera2/image_raw/compressed
/rover/camera2/image_raw/compressed/parameter_descriptions
/rover/camera2/image_raw/compressed/parameter_updates
/rover/camera2/image_raw/compressedDepth
/rover/camera2/image_raw/compressedDepth/parameter_descriptions
/rover/camera2/image_raw/compressedDepth/parameter_updates
/rover/camera2/image_raw/theora
/rover/camera2/image_raw/theora/parameter_descriptions
/rover/camera2/image_raw/theora/parameter_updates
/rover/camera2/parameter_descriptions
/rover/camera2/parameter_updates
/rover/cmd_vel
/rover/gazebo_ros_control/pid_gains/front_left_wheel_joint/parameter_descriptions
/rover/gazebo_ros_control/pid_gains/front_left_wheel_joint/parameter_updates
/rover/gazebo_ros_control/pid_gains/front_right_wheel_joint/parameter_descriptions
/rover/gazebo_ros_control/pid_gains/front_right_wheel_joint/parameter_updates
/rover/gazebo_ros_control/pid_gains/rear_left_wheel_joint/parameter_descriptions
/rover/gazebo_ros_control/pid_gains/rear_left_wheel_joint/parameter_updates
/rover/gazebo_ros_control/pid_gains/rear_right_wheel_joint/parameter_descriptions
/rover/gazebo_ros_control/pid_gains/rear_right_wheel_joint/parameter_updates
/rover/imu
/rover/laser/scan
/rover_velocity_controller/odom
/set_pose
/tf
/tf_static

Any help would be appreciated.

Thanks!