Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly cleanup emergency pullover task #258

Merged
merged 3 commits into from
Jan 31, 2023
Merged

Conversation

luca-della-vedova
Copy link
Member

Bug fix

Fixed bug

Early return in the _resume_from_emergency function caused the _emergency_pullover task not to be cleared. This would happen when the _emergency_pullover_interrupt_token was not set, which would happen when the fire alarm was triggered and a robot was not executing any task.
The emergency pullover still being active created spurious requests for replanning in the fleet adapter, which are quite harmless in simulation but can be troublesome in real deployments since they would stop the robot on the spot, then send a new path.

Fix applied

Just move the clearing of the emergency pullover task to before the early return.

To test in office world:

  • Set the fleet adapter to do nothing on task finish.
  • Assign a task, i.e. ros2 run rmf_demos_tasks dispatch_patrol -p patrol_A1 -n 1 --use_sim_time
  • Wait for the task to be finished.
  • Set the fire alarm: ros2 topic pub /fire_alarm_trigger std_msgs/msg/Bool "data: true"
  • Wait for emergency pullover to be finished
  • Clear the fire alarm ros2 topic pub /fire_alarm_trigger std_msgs/msg/Bool "data: false"
  • Submit a new task: ros2 run rmf_demos_tasks dispatch_patrol -p coe lounge -n 3 --use_sim_time

Without this PR, replanning will be triggered regularly for the robot, with this PR this won't happen.

Signed-off-by: Luca Della Vedova <luca@openrobotics.org>
Signed-off-by: Luca Della Vedova <luca@openrobotics.org>
Signed-off-by: Luca Della Vedova <luca@openrobotics.org>
@mxgrey mxgrey merged commit 84f96d1 into main Jan 31, 2023
@mxgrey mxgrey deleted the luca/kill_emergency_pullover branch January 31, 2023 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants