commander: periodically republish home position if valid

This commit is contained in:
Daniel Agar 2023-06-06 14:57:01 -04:00
parent ff08536247
commit ffce9885ca
No known key found for this signature in database
GPG Key ID: FD3CBA98017A69DE
1 changed files with 6 additions and 0 deletions

View File

@ -343,4 +343,10 @@ void HomePosition::update(bool set_automatically, bool check_if_changed)
setHomePosition();
}
}
// periodically republish home position if valid
if (home.valid_alt && (hrt_elapsed_time(&home.timestamp) > 5_s)) {
_home_position_pub.get().timestamp = hrt_absolute_time();
_home_position_pub.update();
}
}