mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
Merge branch 'master' of github.com:PX4/Firmware into sdlog_buffering
This commit is contained in:
@@ -1200,6 +1200,7 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
/* mark all signals lost as long as they haven't been found */
|
/* mark all signals lost as long as they haven't been found */
|
||||||
current_status.rc_signal_lost = true;
|
current_status.rc_signal_lost = true;
|
||||||
current_status.offboard_control_signal_lost = true;
|
current_status.offboard_control_signal_lost = true;
|
||||||
|
current_status.battery_warning = VEHICLE_BATTERY_WARNING_NONE;
|
||||||
|
|
||||||
/* advertise to ORB */
|
/* advertise to ORB */
|
||||||
stat_pub = orb_advertise(ORB_ID(vehicle_status), ¤t_status);
|
stat_pub = orb_advertise(ORB_ID(vehicle_status), ¤t_status);
|
||||||
@@ -1393,6 +1394,7 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (low_voltage_counter > LOW_VOLTAGE_BATTERY_COUNTER_LIMIT) {
|
if (low_voltage_counter > LOW_VOLTAGE_BATTERY_COUNTER_LIMIT) {
|
||||||
low_battery_voltage_actions_done = true;
|
low_battery_voltage_actions_done = true;
|
||||||
|
current_status.battery_warning = VEHICLE_BATTERY_WARNING_WARNING;
|
||||||
mavlink_log_critical(mavlink_fd, "[commander] WARNING! LOW BATTERY!");
|
mavlink_log_critical(mavlink_fd, "[commander] WARNING! LOW BATTERY!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1403,6 +1405,7 @@ int commander_thread_main(int argc, char *argv[])
|
|||||||
else if (battery_voltage_valid && (bat_remain < 0.1f /* XXX MAGIC NUMBER */) && (false == critical_battery_voltage_actions_done && true == low_battery_voltage_actions_done)) {
|
else if (battery_voltage_valid && (bat_remain < 0.1f /* XXX MAGIC NUMBER */) && (false == critical_battery_voltage_actions_done && true == low_battery_voltage_actions_done)) {
|
||||||
if (critical_voltage_counter > CRITICAL_VOLTAGE_BATTERY_COUNTER_LIMIT) {
|
if (critical_voltage_counter > CRITICAL_VOLTAGE_BATTERY_COUNTER_LIMIT) {
|
||||||
critical_battery_voltage_actions_done = true;
|
critical_battery_voltage_actions_done = true;
|
||||||
|
current_status.battery_warning = VEHICLE_BATTERY_WARNING_ALERT;
|
||||||
mavlink_log_critical(mavlink_fd, "[commander] EMERGENCY! CRITICAL BATTERY!");
|
mavlink_log_critical(mavlink_fd, "[commander] EMERGENCY! CRITICAL BATTERY!");
|
||||||
state_machine_emergency(stat_pub, ¤t_status, mavlink_fd);
|
state_machine_emergency(stat_pub, ¤t_status, mavlink_fd);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
#
|
#
|
||||||
# Find sources
|
# Find sources
|
||||||
#
|
#
|
||||||
DSPLIB_SRCDIR = $(dir $(lastword $(MAKEFILE_LIST)))
|
DSPLIB_SRCDIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||||
CSRCS := $(wildcard $(DSPLIB_SRCDIR)/DSP_Lib/Source/*/*.c)
|
CSRCS := $(wildcard $(DSPLIB_SRCDIR)/DSP_Lib/Source/*/*.c)
|
||||||
|
|
||||||
INCLUDES += $(DSPLIB_SRCDIR)/Include \
|
INCLUDES += $(DSPLIB_SRCDIR)/Include \
|
||||||
|
|||||||
@@ -99,6 +99,13 @@ enum VEHICLE_ATTITUDE_MODE {
|
|||||||
VEHICLE_ATTITUDE_MODE_ATTITUDE /**< tait-bryan attitude control mode */
|
VEHICLE_ATTITUDE_MODE_ATTITUDE /**< tait-bryan attitude control mode */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum VEHICLE_BATTERY_WARNING {
|
||||||
|
VEHICLE_BATTERY_WARNING_NONE = 0, /**< no battery low voltage warning active */
|
||||||
|
VEHICLE_BATTERY_WARNING_WARNING, /**< warning of low voltage 1. stage */
|
||||||
|
VEHICLE_BATTERY_WARNING_ALERT /**< aleting of low voltage 2. stage */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* state machine / state of vehicle.
|
* state machine / state of vehicle.
|
||||||
*
|
*
|
||||||
@@ -157,6 +164,7 @@ struct vehicle_status_s
|
|||||||
float voltage_battery;
|
float voltage_battery;
|
||||||
float current_battery;
|
float current_battery;
|
||||||
float battery_remaining;
|
float battery_remaining;
|
||||||
|
enum VEHICLE_BATTERY_WARNING battery_warning; /**< current battery warning mode, as defined by VEHICLE_BATTERY_WARNING enum */
|
||||||
uint16_t drop_rate_comm;
|
uint16_t drop_rate_comm;
|
||||||
uint16_t errors_comm;
|
uint16_t errors_comm;
|
||||||
uint16_t errors_count1;
|
uint16_t errors_count1;
|
||||||
|
|||||||
Reference in New Issue
Block a user