Rosanswers logo


I have been trying to use the navigation2 stack with a real robot recently. The robot is diff-drive if it matters.

My issue is that the robot does not seem to follow the max_vel_x parameter value. I have been testing the robot making it plan in a straight line (no obstacles) and i have reduced the inflation parameter so the robot is always in free space for the test.

When I set different values for the parameter, the mesured output velocity on the /cmd_vel topic is totally unrelated to the value and seemingly random:

  • max_vel_x: 1.2 => cmd_vel: 0.55
  • max_vel_x: 0.6 => cmd_vel: 0.6
  • max_vel_x: 0.8 => cmd_vel: 0.575
  • max_vel_x: 1.0 => cmd_vel: 0.45

Here is my parameter file for the controller:

    use_sim_time: True
    controller_frequency: 10.0
    min_x_velocity_threshold: 0.001
    min_y_velocity_threshold: 0.5
    min_theta_velocity_threshold: 0.001
    progress_checker_plugin: "progress_checker"
    goal_checker_plugin: "goal_checker"
    controller_plugins: ["FollowPath"]

    plugin: "nav2_controller::SimpleProgressChecker"
    required_movement_radius: 0.5
    movement_time_allowance: 10.0

    plugin: "nav2_controller::SimpleGoalChecker"
    xy_goal_tolerance: 0.5
    yaw_goal_tolerance: 0.5
    stateful: True

    plugin: "dwb_core::DWBLocalPlanner"
    debug_trajectory_details: True
    min_vel_x: -0.1
    min_vel_y: 0.0
    max_vel_x: 1.2
    max_vel_y: 0.0
    max_vel_theta: 0.6
    min_speed_xy: 0.1
    max_speed_xy: 1.2
    min_speed_theta: 0.0
    acc_lim_x: 4.0
    acc_lim_y: 0.0
    acc_lim_theta: 5.0
    decel_lim_x: -2.5
    decel_lim_y: 0.0
    decel_lim_theta: -3.2
    vx_samples: 5
    vy_samples: 1
    vtheta_samples: 20
    sim_time: 1.7
    linear_granularity: 0.05
    angular_granularity: 0.025
    transform_tolerance: 0.2
    xy_goal_tolerance: 0.25
    trans_stopped_velocity: 0.25
    short_circuit_trajectory_evaluation: True
    stateful: True
    critics: ["RotateToGoal", "Oscillation", "ObstacleFootprint", "GoalAlign", "PathAlign", "PathDist", "GoalDist"]
    BaseObstacle.scale: 0.02
    PathAlign.scale: 12.0
    PathAlign.forward_point_distance: 0.1
    GoalAlign.scale: 64.0
    GoalAlign.forward_point_distance: 0.325
    PathDist.scale: 64.0
    GoalDist.scale: 12.0
    RotateToGoal.scale: 64.0
    RotateToGoal.slowing_factor: 5.0
    RotateToGoal.lookahead_time: -1.0

    use_sim_time: True

Any idea on what could cause this issue ?

Originally posted by Alrevan on ROS Answers with karma: 126 on 2021-02-09

Post score: 0

Original comments

Comment by stevemacenski on 2021-02-09:
I'd put some basic print statements and make sure that your parameters are being properly utilized in the DWB code. This hasn't been my experience, I've pushed up to 1.0m/s when doing some testing and it definitely appreciably sped up.

Distribution / release number / install method / etc would be helpful

Your sample count looks suspect at only 5.


1 Answer 1


Rosanswers logo

I forgot I had this question opened. If anyone stumbles upon the same issue my problem was the local costmap was too short for the sim_time/speed I wanted. So all trajectories having higher speed would get discarded.

Originally posted by Alrevan with karma: 126 on 2021-04-16

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by stevemacenski on 2021-04-16:
Thats a good insight, thanks!


Your Answer

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