Skip to content

diff_drive_controller publishes non-zero floating-point residual velocities when robot is stopped #1972

@NTques

Description

@NTques

Describe the bug
When the robot is stationary, the diff_drive_controller continues publishing non-zero linear.x and angular.z values in the odometry message.
After motion stops, both fields remain constant at fixed values instead of returning to 0.0.

Example observed values

header:
  stamp:
    sec: 1761177527
    nanosec: 808381212
  frame_id: odom
child_frame_id: base_footprint
pose:
  pose:
    position:
      x: 3.77347847014605
      y: -1.7794038560525278
      z: 0.0
    orientation:
      x: 0.0
      y: 0.0
      z: 0.2781463257552604
      w: 0.9605387141957624
  covariance: '<array type: double[36]>'
twist:
  twist:
    linear:
      x: 5.185908126537075e-14
      y: 0.0
      z: 0.0
    angular:
      x: 0.0
      y: 0.0
      z: 1.1719097914308918e-12
  covariance: '<array type: double[36]>'

Paramters

controller_manager:
  ros__parameters:
    update_rate: 20  # Hz

    joint_state_broadcaster:
      type: joint_state_broadcaster/JointStateBroadcaster

tankbot_base_controller:
  ros__parameters:
    type: diff_drive_controller/DiffDriveController

    left_wheel_names: ["left_wheel_joint"]
    right_wheel_names: ["right_wheel_joint"]

    wheel_separation: 0.191
    wheel_radius: 0.02675

    wheel_separation_multiplier: 1.0
    left_wheel_radius_multiplier: 1.0
    right_wheel_radius_multiplier: 1.0

    publish_rate: 50.0
    odom_frame_id: odom
    base_frame_id: base_footprint
    pose_covariance_diagonal : [0.001, 0.001, 0.001, 0.001, 0.001, 0.01]
    twist_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.01]

    open_loop: false
    enable_odom_tf: false

    cmd_vel_timeout: 0.5
    # publish_limited_velocity: true
    # velocity_rolling_window_size: 10

    linear.x.has_velocity_limits: true
    linear.x.has_acceleration_limits: true
    linear.x.has_jerk_limits: false
    linear.x.max_velocity: 0.3
    linear.x.min_velocity: -0.3
    linear.x.max_acceleration: 0.3
    linear.x.max_deceleration: -1.0

    angular.z.has_velocity_limits: true
    angular.z.has_acceleration_limits: true
    angular.z.has_jerk_limits: false
    angular.z.max_velocity: 1.3
    angular.z.min_velocity: -1.3
    angular.z.max_acceleration: 1.3
    angular.z.max_deceleration: -3.0

Video

Screencast.from.2025-10-23.08-55-11.mp4

Environment (please complete the following information):

  • OS: Ubuntu 24.04
  • Version: Jazzy
  • ros2_controller Version: 4.33.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions