Global Planning and Stop Replanning
I have a ros robot working on Melodic devel.
When i start navigation, my robot generates global plan. When the robot see any obstacle in global plan, Robot replans the path and try to escape obstacle. It is normal behavior.
What I would like to do is to get the robot to stop if there is any obstacle in its global path. In this case, either the obstacle moves and the robot again continues to move towards the goal along the original path or the obstacle doesn't move and the robot keeps staying in its position.
Is there any parameters related about that? Or how can we do that ?
Asked by bfdmetu on 2021-07-30 06:19:02 UTC
Answers
Actually, i wanted to do the reverse :) My robot just stops when a dynamic obstacle is detected along the way. Was wondering how i change the behavior to recompute the plan and move past the obstacle through an alternate route. Which local planner are you using ? I'm using DWA. These are my parameters:
DWAPlannerROS:
# Robot configuration parameters
acc_lim_x: 0.1
acc_lim_y: 0
acc_lim_theta: 1.0
acc_lim_trans: 0.15
max_vel_x: 2.0
min_vel_x: 0.001
max_vel_y: 0
min_vel_y: 0
max_vel_trans: 2.0
min_vel_trans: 0.001
max_vel_theta: 1.0
min_vel_theta: 0.0
# Goal Tolerance Parameters
yaw_goal_tolerance: 0.3
xy_goal_tolerance: 0.1 #0.2
latch_xy_goal_tolerance: false
# Forward Simulation Parameters
sim_time: 4.0
sim_granularity: 0.02
vx_samples: 20
vy_samples: 1
vth_samples: 50
# Trajectory scoring parameters
path_distance_bias: 4.0
goal_distance_bias: 0.05
occdist_scale: 3.0
forward_point_distance: 0
stop_time_buffer: 0.2
scaling_speed: 0.25
max_scaling_factor: 0.2
oscillation_reset_dist: 0.25
publish_traj_pc : true
publish_cost_grid_pc: true
Asked by Werewolf_86 on 2021-07-30 09:37:53 UTC
Comments
I think you should decrease sim_time and path_distance_bias. TrajectoryPlannerROS # for details see: http://www.ros.org/wiki/base_local_planner
acc_lim_x: 0.6
acc_lim_theta: 0.9
max_vel_x: 0.55
min_vel_x: -0.5
max_vel_theta: 0.55
min_vel_theta: -0.55
min_in_place_vel_theta: 0.8
holonomic_robot: false
escape_vel: -0.2
yaw_goal_tolerance: 0.4
xy_goal_tolerance: 0.4
latch_xy_goal_tolerance: false
sim_time:
sim_granularity: 0.025
angular_sim_granularity: 0.025
vx_samples: 20
vtheta_samples: 20
meter_scoring: true
path_distance_bias: 0.6
goal_distance_bias: 0.8
occdist_scale: 0.01
heading_lookahead: 0.325
oscillation_reset_dist: 0.05
Asked by bfdmetu on 2021-08-05 02:57:44 UTC
Assume that the planner_frequency
is 0.0
and the obstacle escape is done by global plan replanning.
In that case, it should be possible to stop (abort) the robot by obstacle detection by setting recovery_behavior_enabled
to false
.
You may also need to empty the list of recovery_behaviors
.
ref: http://wiki.ros.org/move_base#Parameters
Asked by miura on 2021-08-01 18:57:48 UTC
Comments
From the linked documentation:
If the frequency is set to 0.0, the global planner will only run when a new goal is received or the local planner reports that its path is blocked.
so I read that planner_frequency does not help here. The recovery behaviors are for the case that no plan is found, but from what I have read in the question the goal is to stop when an obstacle is on the original planned path.
Asked by Humpelstilzchen on 2021-08-03 00:14:32 UTC
local planner may determine that the path is blocked because "an obstacle is on the planned path". Therefore, I think that we may be able to achieve this goal.
Asked by miura on 2021-08-03 18:27:11 UTC
Doubt. Unless you try e.g. pose_follower as local planner it constantly replans and if only the direct path is blocked it will find another path. Only if all allowed motions are blocked it does go to recovery.
Asked by Humpelstilzchen on 2021-08-04 00:30:13 UTC
I expected from the following that all the local planners might be blocked and the recovery might be replanning.
When i start navigation, my robot generates global plan. When the robot see any obstacle in global plan, Robot replans the path and try to escape obstacle.
In that case, the answer is that it would be possible to stop it by stopping the recovery. Depending on the situation of @bfdmetu's robot, this response may not be a solution.
Asked by miura on 2021-08-04 18:47:49 UTC
ah ok I read the question wrong then. I read "escape obstacle" as "evade obstacle" not as "running recovery"
Asked by Humpelstilzchen on 2021-08-05 00:30:31 UTC
Thank you for your answer. When i set the planner_frequency=0.0, global plan stop make a new plan. However Local planner try to escape obstacle. After that i set planner_frequency=0.0 and increase the path_distance_bias 2.2 , robot try to find suitable path but could not find so stop moving. Today i will continue at that point.
Asked by bfdmetu on 2021-08-05 03:20:32 UTC
Comments
With move_base I don't see how and personally I also don't see why you want that. But maybe move_base_flex can do that with a custom state machine. You might also need to tell the local planner to stop replanning.
Asked by Humpelstilzchen on 2021-08-01 02:11:49 UTC