mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 12:00:34 +08:00
Merge master into linux
This commit is contained in:
@@ -1509,7 +1509,9 @@ int commander_thread_main(int argc, char *argv[])
|
||||
if (hrt_absolute_time() > commander_boot_timestamp + 2000000 && battery.voltage_filtered_v > 0.0f) {
|
||||
status.battery_voltage = battery.voltage_filtered_v;
|
||||
status.battery_current = battery.current_a;
|
||||
status.battery_discharged_mah = battery.discharged_mah;
|
||||
status.condition_battery_voltage_valid = true;
|
||||
status.battery_cell_count = battery_get_n_cells();
|
||||
|
||||
/* get throttle (if armed), as we only care about energy negative throttle also counts */
|
||||
float throttle = (armed.armed) ? fabsf(actuator_controls.control[3]) : 0.0f;
|
||||
|
||||
@@ -332,6 +332,10 @@ void rgbled_set_pattern(rgbled_pattern_t *pattern)
|
||||
px4_ioctl(rgbleds, RGBLED_SET_PATTERN, (unsigned long)pattern);
|
||||
}
|
||||
|
||||
unsigned battery_get_n_cells() {
|
||||
return bat_n_cells;
|
||||
}
|
||||
|
||||
float battery_remaining_estimate_voltage(float voltage, float discharged, float throttle_normalized)
|
||||
{
|
||||
float ret = 0;
|
||||
|
||||
@@ -89,4 +89,6 @@ int battery_init();
|
||||
*/
|
||||
float battery_remaining_estimate_voltage(float voltage, float discharged, float throttle_normalized);
|
||||
|
||||
unsigned battery_get_n_cells();
|
||||
|
||||
#endif /* COMMANDER_HELPER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user