Skip to content

Commit

Permalink
Add aborted checks when paused mowing
Browse files Browse the repository at this point in the history
Previously the mower would have to become unpaused before it would recognize that mowing had been aborted.
  • Loading branch information
jeremysalwen committed Sep 14, 2024
1 parent 1fea776 commit 6ed7c6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mower_logic/src/mower_logic/behaviors/MowingBehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ bool MowingBehavior::execute_mowing_plan() {
paused = true;
mowerEnabled = false;
u_int8_t last_requested_pause_flags = 0;
while (requested_pause_flag) // while emergency and/or manual pause not asked to continue, we wait
while (requested_pause_flag && !aborted) // while emergency and/or manual pause not asked to continue, we wait
{
if (last_requested_pause_flags != requested_pause_flag) {
update_actions();
Expand All @@ -293,7 +293,7 @@ bool MowingBehavior::execute_mowing_plan() {
}
if (paused) {
paused_time = ros::Time::now();
while (!this->hasGoodGPS()) // while no good GPS we wait
while (!this->hasGoodGPS() && !aborted) // while no good GPS we wait
{
ROS_INFO_STREAM("MowingBehavior: PAUSED (" << (ros::Time::now() - paused_time).toSec()
<< "s) (waiting for GPS)");
Expand Down

1 comment on commit 6ed7c6c

@rovo89
Copy link
Contributor

@rovo89 rovo89 commented on 6ed7c6c Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had exactly the same thought when I reviewing the code for https://wiki.openmower.de/index.php?title=Why_is_the_mower_not_mowing%3F and for my tasklist feature.
There's also a workaround in command_home() which might no longer be needed after this change.

Please sign in to comment.