mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 01:53:33 +08:00
vehicle_status_flags: cleanup message, move non-failsafe flags to vehicle_status
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
#include <uORB/topics/actuator_armed.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/vehicle_status_flags.h>
|
||||
|
||||
class MavlinkStreamHeartbeat : public MavlinkStream
|
||||
{
|
||||
@@ -63,7 +62,6 @@ private:
|
||||
uORB::Subscription _acturator_armed_sub{ORB_ID(actuator_armed)};
|
||||
uORB::Subscription _vehicle_control_mode_sub{ORB_ID(vehicle_control_mode)};
|
||||
uORB::Subscription _vehicle_status_sub{ORB_ID(vehicle_status)};
|
||||
uORB::Subscription _vehicle_status_flags_sub{ORB_ID(vehicle_status_flags)};
|
||||
|
||||
bool send() override
|
||||
{
|
||||
@@ -72,9 +70,6 @@ private:
|
||||
vehicle_status_s vehicle_status{};
|
||||
_vehicle_status_sub.copy(&vehicle_status);
|
||||
|
||||
vehicle_status_flags_s vehicle_status_flags{};
|
||||
_vehicle_status_flags_sub.copy(&vehicle_status_flags);
|
||||
|
||||
vehicle_control_mode_s vehicle_control_mode{};
|
||||
_vehicle_control_mode_sub.copy(&vehicle_control_mode);
|
||||
|
||||
@@ -131,7 +126,7 @@ private:
|
||||
|| vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_TERMINATION) {
|
||||
system_status = MAV_STATE_FLIGHT_TERMINATION;
|
||||
|
||||
} else if (vehicle_status_flags.calibration_enabled) {
|
||||
} else if (vehicle_status.calibration_enabled) {
|
||||
system_status = MAV_STATE_CALIBRATING;
|
||||
}
|
||||
|
||||
|
||||
@@ -429,10 +429,6 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
if (status.rc_signal_lost) {
|
||||
msg->failure_flags |= HL_FAILURE_FLAG_RC_RECEIVER;
|
||||
}
|
||||
|
||||
if (status.failure_detector_status & vehicle_status_s::FAILURE_MOTOR) {
|
||||
msg->failure_flags |= HL_FAILURE_FLAG_ENGINE;
|
||||
}
|
||||
@@ -452,7 +448,7 @@ private:
|
||||
vehicle_status_flags_s status_flags;
|
||||
|
||||
if (_status_flags_sub.update(&status_flags)) {
|
||||
if (!status_flags.global_position_valid) { //TODO check if there is a better way to get only GPS failure
|
||||
if (status_flags.gps_position_invalid) {
|
||||
msg->failure_flags |= HL_FAILURE_FLAG_GPS;
|
||||
}
|
||||
|
||||
@@ -464,6 +460,11 @@ private:
|
||||
msg->failure_flags |= HL_FAILURE_FLAG_MISSION;
|
||||
}
|
||||
|
||||
if (status_flags.rc_signal_lost) {
|
||||
msg->failure_flags |= HL_FAILURE_FLAG_RC_RECEIVER;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user