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 Oct 1, 2024
1 parent 0d31a8d commit debf216
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

0 comments on commit debf216

Please sign in to comment.