ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

[ROS2 foxy] Random speed when using navigation 2

asked 2021-02-09 04:27:08 -0500

Alrevan gravatar image


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 ?

edit retag flag offensive close merge delete


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.

stevemacenski gravatar image stevemacenski  ( 2021-02-09 13:02:32 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-04-16 02:28:40 -0500

Alrevan gravatar image

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.

edit flag offensive delete link more


Thats a good insight, thanks!

stevemacenski gravatar image stevemacenski  ( 2021-04-16 14:00:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-02-09 04:27:08 -0500

Seen: 219 times

Last updated: Apr 16 '21