navigator: RTL destination throttle dataman access

This commit is contained in:
Daniel Agar
2020-06-02 22:08:55 -04:00
parent 7aac0c5ac3
commit aca6be8b5c
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -46,6 +46,8 @@
static constexpr float DELAY_SIGMA = 0.01f;
using namespace time_literals;
RTL::RTL(Navigator *navigator) :
MissionBlock(navigator),
ModuleParams(navigator)
@@ -73,6 +75,13 @@ RTL::on_inactive()
void
RTL::find_RTL_destination()
{
// don't update RTL destination faster than 1 Hz
if (hrt_elapsed_time(&_destination_check_time) < 1_s) {
return;
}
_destination_check_time = hrt_absolute_time();
// get home position:
home_position_s &home_landing_position = *_navigator->get_home_position();
// get global position