forked from Archive/PX4-Autopilot
loiter: only accept reposition setpoint if commanded within last 0.5 sec
guards against left over reposition commands (potentially set via geofence) from previous flights
This commit is contained in:
parent
e5f4a6b074
commit
2d80291b43
|
@ -51,7 +51,8 @@ Loiter::Loiter(Navigator *navigator) :
|
|||
void
|
||||
Loiter::on_activation()
|
||||
{
|
||||
if (_navigator->get_reposition_triplet()->current.valid) {
|
||||
if (_navigator->get_reposition_triplet()->current.valid
|
||||
&& hrt_elapsed_time(&_navigator->get_reposition_triplet()->current.timestamp) < 500_ms) {
|
||||
reposition();
|
||||
|
||||
} else {
|
||||
|
@ -66,7 +67,8 @@ Loiter::on_activation()
|
|||
void
|
||||
Loiter::on_active()
|
||||
{
|
||||
if (_navigator->get_reposition_triplet()->current.valid) {
|
||||
if (_navigator->get_reposition_triplet()->current.valid
|
||||
&& hrt_elapsed_time(&_navigator->get_reposition_triplet()->current.timestamp) < 500_ms) {
|
||||
reposition();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue