FlightTaskOrbit: alert user about exceeded radius (mavlink_log)

This commit is contained in:
Matthias Grob
2022-03-28 13:58:00 +02:00
parent 3e8d2fea94
commit 7cd57b4415
2 changed files with 3 additions and 0 deletions
@@ -37,6 +37,7 @@
#include "FlightTaskOrbit.hpp"
#include <lib/systemlib/mavlink_log.h>
#include <mathlib/mathlib.h>
#include <px4_platform_common/events.h>
#include <lib/geo/geo.h>
@@ -78,6 +79,7 @@ bool FlightTaskOrbit::applyCommandParameters(const vehicle_command_s &command)
_orbit_velocity = new_velocity;
} else {
mavlink_log_critical(&_mavlink_log_pub, "Orbit radius limit exceeded\t");
events::send(events::ID("orbit_radius_exceeded"), events::Log::Alert, "Orbit radius limit exceeded");
ret = false;
}
@@ -128,6 +128,7 @@ private:
float _initial_heading = 0.f; /**< the heading of the drone when the orbit command was issued */
SlewRateYaw<float> _slew_rate_yaw;
orb_advert_t _mavlink_log_pub{nullptr};
uORB::PublicationMulti<orbit_status_s> _orbit_status_pub{ORB_ID(orbit_status)};
DEFINE_PARAMETERS(