my 4wheel_bot is moving backwards when i set the goal behind the robot in rviz, but it reaches the goal tho. I did not notice this kinda behavior in any robot, normally it rotates and pursuit the goal moving forward. This is the diff_drive_controller.yaml file i used in my robot

type: "diff_drive_controller/DiffDriveController"
publish_rate: 50

left_wheel: ['front_left_wheel_joint', 'rear_left_wheel_joint']
right_wheel: ['front_right_wheel_joint', 'rear_right_wheel_joint']

wheel_separation: 0.45 #0.44
wheel_radius : 0.15
base_frame_id: base_link
odom_frame_id: odom
enable_odom_tf: true
estimate_velocity_from_position: false
cmd_vel_timeout: 0.55

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]

    has_velocity_limits    : true
    max_velocity           : 2.75   # m/s
    min_velocity           : -2.75   # m/s
    has_acceleration_limits: true
    max_acceleration       : 4.00   # m/s^2
    min_acceleration       : -4.00   # m/s^2

    has_velocity_limits    : true
    max_velocity           : 8.00   # rad/s
    has_acceleration_limits: true
    max_acceleration       : 8.00   # rad/s^2

also the laser scan is moving with the robot only when its rotating, but not when the robot is moving forward or backward.

there are two questions, why the robot moving backwards when i give the goal behind the robot in rviz? And the second one why the laser_scan also moving when the robot rotates?

It would be so helpful if i have some suggestions.

  • $\begingroup$ what is your specific question? ... please add a clear, answerable question to your post... do not add question in a comment $\endgroup$
    – jsotola
    Jan 9 at 7:26
  • $\begingroup$ there are two questions, why the robot moving backwards when i give the goal behind the robot in rviz? And the second one why the laser_scan also moving when the robot rotates? $\endgroup$
    – Vasanth
    Jan 9 at 7:58
  • $\begingroup$ please add the two questions to your post ... a comment is not the place for your questions $\endgroup$
    – jsotola
    Jan 9 at 15:47

1 Answer 1


If you have declared min_velocity and min_acceleration below 0 and at the same level as max_ it means that you don't mind going backwards. Also sometimes the planner has an option to turn on/off running backward. When most planners plan the road they consider possible velocities and calculate cost of many possible trajectories and choose the best. So if you would like to disable backward running, change the min_velocity and min_acceleration to 0 or a little bit below to allow only small corrections.

For laser_scan it should rotate during rotation, but when going through the room, walls and objects are not moving alongside the robot, so it may happen that if the range is enough, the scan won't move at all.

  • $\begingroup$ i tried setting both min_velocity and min_acceleration as you said, still the same behavior. And about the laser_scan, you can see this video in my github page, so you can see how the laser is behaving. $\endgroup$
    – Vasanth
    Jan 9 at 9:06
  • $\begingroup$ okey, it seems that something is wrong with TF tree. Because if you look closely, in rviz the robot is more rotated than in gazebo, and laser scan link is transformed to map frame probably through transform provided by gazebo. It seems that laser scan is properly aligned to robot rotation from gazebo, not from rviz. What is the source of odometry in your case? odometry is taken from tf or from wheel odometry and independent from tf tree? misalignment is caused by difference between transform presented in rviz and in gazebo. in the case of backward running, which planner do you use in nav2? $\endgroup$
    – Marabir
    Jan 9 at 9:17
  • $\begingroup$ Sorry for the delay. For the tf_tree this image would be helpful for you. i am also working on the planner one. So far, i added trajectory_planner, dwa_planner and navfn_planner. I know it has to be either one. Maybe it causes the robot moving backwards. I clearly don't know. $\endgroup$
    – Vasanth
    Jan 12 at 4:26
  • $\begingroup$ So, i changed the params file for the move_base package i included for my robot and modified the linear and angular parameters in the diff_drive_controller.yaml file. Now the robot is moving to the goal. still the laser scan moves whenever the robot moves. Note: the laser stays when the robot is generating the map. $\endgroup$
    – Vasanth
    Mar 1 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.