Skip to content

Commit bc89eed

Browse files
committed
Consider rebounded Open state in door_query_state timeout
1 parent 696d2cb commit bc89eed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/ratgdo/ratgdo.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,11 @@ namespace ratgdo {
570570
// query state in case we don't get a status message
571571
set_timeout("door_query_state", (*this->closing_duration + 2) * 1000, [this]() {
572572
if (*this->door_state != DoorState::CLOSED && *this->door_state != DoorState::STOPPED) {
573-
this->received(DoorState::CLOSED); // probably missed a status mesage, assume it's closed
574-
this->query_status(); // query in case we're wrong and it's stopped
573+
// In case the door fully rebounded from an obstruction
574+
if (*this->door_state != DoorState::OPEN) {
575+
this->received(DoorState::CLOSED); // probably missed a status mesage, assume it's closed
576+
this->query_status(); // query in case we're wrong and it's stopped
577+
}
575578
}
576579
});
577580
}

0 commit comments

Comments
 (0)