commander: periodically republish home position if valid

This commit is contained in:
Daniel Agar
2023-06-06 14:58:55 -04:00
parent ff08536247
commit ffce9885ca
+6
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();
}
}