problem of v_x and v_th in move_base
i use move_base in my robot for navigation,
situation 1: the robot can get the goal but it almost move very very slow, even if there is no obstacles nearby.
situation 2: robot rotate frequently even there is no obstacles around.
i try: echo the cmd_vel msg i found the v_x stays around the min_vel_x 0.1 m/s and there are unexpected points the speed approach max_vel_x 0.5m/s, that is so strange. (the control frequency is set 15Hz)
see the figure below:
the blue line is cmd_vel_x, and red line is cmd_vel_theta
Q1: why not the velocity changed smoothly? Q2:why the velocity always stay around 0.1 m/s,(0.1m/s is the min_vel_x setting in base_local_planner_params.yaml)
update 1: the base_local_planner_params.yaml
base_global_planner: navfn/NavfnROS
controller_frequency: 15
recovery_behavior_enabled: true
clearing_rotation_allowed: true
TrajectoryPlannerROS:
acc_lim_x: 1.0
acc_lim_y: 0.0 # zero for a differential drive robot
acc_lim_theta: 1.6
max_vel_x: 0.6 #0.2
min_vel_x: 0.2 #0.1
max_vel_y: 0.0 # zero for a differential drive robot
min_vel_y: 0.0
max_vel_theta: 1.0 #0.3
min_vel_theta: -1.0 #0.15
min_in_place_vel_theta: 0.4
escape_vel: -0.1
holonomic_robot: false
yaw_goal_tolerance: 0.2 # about 11 degrees
xy_goal_tolerance: 0.3 # 20 cm
latch_xy_goal_tolerance: true #false
sim_time: 1.5 # 2
sim_granularity: 0.05 #It basically means how frequent should the points on this trajectory be examined;
angular_sim_granularity: 0.025
vx_samples: 10
vy_samples: 0 # zero for a differential drive robot
vtheta_samples: 20 #
controller_frequency: 15
meter_scoring: true
pdist_scale: 0.8 #0.8
gdist_scale: 0.4 #0.4
occdist_scale: 0.01 #0.1
oscillation_reset_dist: 0.2 #0.05
heading_scoring: false
heading_lookahead: 0.1 #how far look ahead in meters in-place-rotation
heading_scoring_timestep: 0.8
dwa: true
publish_cost_grid_pc: false
global_frame_id: odom
simple_attractor: false
reset_distance: 4
prune_plan: true
NavfnROS:
allow_unknown: true
recovery_behavior_enabled: true
visualize_potential: true
cost_factor: 0.55
neutral_cost: 66
lethal_cost: 253
I have the exact same issue. Either the robot moves straight, but very slow, or moves at decent speed but is always rotating. I have found that changing my
sim_time
from 2 (for fast but rotating) to 5 (slow but straight) affects it. Not able to look into it further at this stage, but interested.please add information on what planners you are using and what is your ROS version.
@Procópio i think i use the dwa local planner which enable the dwa in base_local_planner_params.yaml, and i use indigo, i have paste the base_local_planner_params.yaml
@ufr3c_tjc i think increase
sim_time
, robot look long distance ahead, he think it's fine to move fast, but when you decrease thesim_time
,robot look short distance ahead, he think it's not ok move too fast because he dont know the situation. i adjust the sim_time but has little help, and rotation@marine0131 No, my behavior is opposite. A larger sim_time means a slower speed. I think it has to do with the parameterization and v_x samples, and the acceleration limits. But don't have the time at the moment to look into it in depth.
So today I tried the TEB Local Planner, and it works much better! Out robot is diff-drive and TEB is specifically built for this. The others are more for holonomic robots like the PR2. Very easy to install and probably worth your time to try it out. Links in next comment.
Package here and a tutorial is here. We used almost all the default values, just changed the footprint. Hope it helps!
I'ld recommend to compare the odometry output to the cmd_vel input and try to increase the acc limits.