mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 01:13:34 +08:00
Added Power Brick related battery_status.msg fields
system_source - This battery status is for the brick that is
supplying VDD_5V_IN
priority - Zero based, This battery status is for the brick
that is connected to the Power controller's
N-1 priority input. V1..VN. 0 would normally be
Brick1, 1 for Brick2 etc
Battery now assigns connected from the api in the
updateBatteryStatus, as well as system_source and priority
This commit is contained in:
@@ -83,7 +83,9 @@ Battery::reset(battery_status_s *battery_status)
|
||||
}
|
||||
|
||||
void
|
||||
Battery::updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float current_a, float throttle_normalized,
|
||||
Battery::updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float current_a,
|
||||
bool connected, bool selected_source, int priority,
|
||||
float throttle_normalized,
|
||||
bool armed, battery_status_s *battery_status)
|
||||
{
|
||||
reset(battery_status);
|
||||
@@ -104,7 +106,9 @@ Battery::updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float curre
|
||||
battery_status->discharged_mah = _discharged_mah;
|
||||
battery_status->warning = _warning;
|
||||
battery_status->remaining = _remaining;
|
||||
battery_status->connected = true;
|
||||
battery_status->connected = connected;
|
||||
battery_status->system_source = selected_source;
|
||||
battery_status->priority = priority;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,9 +85,14 @@ public:
|
||||
*
|
||||
* @param voltage_v: current voltage in V
|
||||
* @param current_a: current current in A
|
||||
* @param connected: Battery is connected
|
||||
* @param selected_source: This battery is on the brick that the selected source for selected_source
|
||||
* @param priority: The brick number -1. The term priority refers to the Vn connection on the LTC4417
|
||||
* @param throttle_normalized: throttle from 0 to 1
|
||||
*/
|
||||
void updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float current_a, float throttle_normalized,
|
||||
void updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float current_a,
|
||||
bool connected, bool selected_source, int priority,
|
||||
float throttle_normalized,
|
||||
bool armed, battery_status_s *status);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user