mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 11:53:34 +08:00
battery_status: report remaining flight time in seconds
This allows more accurate reporting and is compliant with the MAVLink interface.
This commit is contained in:
@@ -83,7 +83,7 @@ UavcanBatteryBridge::battery_sub_cb(const uavcan::ReceivedDataStructure<uavcan::
|
||||
// battery.priority = msg.;
|
||||
battery.capacity = msg.full_charge_capacity_wh;
|
||||
// battery.cycle_count = msg.;
|
||||
// battery.run_time_to_empty = msg.;
|
||||
// battery.time_remaining_s = msg.;
|
||||
// battery.average_time_to_empty = msg.;
|
||||
battery.serial_number = msg.model_instance_id;
|
||||
battery.id = msg.getSrcNodeID().get();
|
||||
|
||||
@@ -79,7 +79,7 @@ UavcanCBATBridge::battery_sub_cb(const uavcan::ReceivedDataStructure<cuav::equip
|
||||
// battery.priority = msg.;
|
||||
battery.capacity = msg.full_charge_capacity * 1000;
|
||||
battery.cycle_count = msg.cycle_count;
|
||||
battery.run_time_to_empty = msg.average_time_to_empty;
|
||||
battery.time_remaining_s = msg.average_time_to_empty * 60;
|
||||
battery.average_time_to_empty = msg.average_time_to_empty;
|
||||
battery.serial_number = msg.serial_number;
|
||||
battery.manufacture_date = msg.manufacture_date;
|
||||
|
||||
Reference in New Issue
Block a user