Skip to content

Commit a1097b3

Browse files
committed
pbio/control: Infinite maneuvers are always done.
1 parent 96b5d86 commit a1097b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/pbio/src/control.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,13 @@ static bool pbio_control_check_completion(const pbio_control_t *ctl, uint32_t ti
9292
// Check if we are passed the nominal maneuver time.
9393
bool time_completed = pbio_control_settings_time_is_later(time, end->time);
9494

95-
// Timed maneuvers are done when the full duration has passed.
9695
if (pbio_control_type_is_time(ctl)) {
96+
// Infinite maneuvers are always done (should never block).
97+
if (pbio_trajectory_get_duration(&ctl->trajectory) >= pbio_control_time_ms_to_ticks(PBIO_TRAJECTORY_DURATION_FOREVER_MS)) {
98+
return true;
99+
}
100+
101+
// Finite-time maneuvers are done when the full duration has passed.
97102
return time_completed;
98103
}
99104

0 commit comments

Comments
 (0)