navigator: RTL destination throttle dataman access

This commit is contained in:
Daniel Agar
2020-06-02 09:08:00 -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
+2
View File
@@ -129,6 +129,8 @@ private:
RTLPosition _destination{}; ///< the RTL position to fly to (typically the home position or a safe point)
hrt_abstime _destination_check_time{0};
float _rtl_alt{0.0f}; // AMSL altitude at which the vehicle should return to the home position
bool _rtl_alt_min{false};