rtl_direct: send out message to inform that rtl is avoiding geofence

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
RomanBapst
2026-04-29 14:27:46 +03:00
parent 1a7b579342
commit c3a152fbf2
+7
View File
@@ -94,6 +94,12 @@ void RtlDirect::on_activation()
events::send<int32_t, int32_t>(events::ID("vrtl_return_at"), events::Log::Info,
"RTL: start return at {1m_v} ({2m_v} above destination)",
(int32_t)ceilf(_rtl_alt), (int32_t)ceilf(_rtl_alt - _destination.alt));
// send out message only for the first point
if (_geofence_aware_return_path.num_points > 0) {
mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: avoiding geofence\t");
events::send(events::ID("rtl_avoiding_geofence"), events::Log::Info, "RTL: avoiding geofence");
}
}
void RtlDirect::on_active()
@@ -257,6 +263,7 @@ void RtlDirect::set_rtl_item()
case RTLState::AVOID_GEOFENCE: {
matrix::Vector2d point = _geofence_aware_return_path.getAndPopCurrentPoint();
if (point.isAllNan()) {