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
39351acbcb
commit
3e68e806b8
|
@ -57,7 +57,8 @@ Loiter::on_inactive()
|
|||
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 {
|
||||
|
@ -72,7 +73,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