Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery message - extend with status, current, and fix percentage #290

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion protos/telemetry/telemetry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,38 @@ enum FixType {
FIX_TYPE_RTK_FIXED = 6; // RTK Fixed, 3D position
}




// Battery type.
message Battery {
uint32 id = 3 [(mavsdk.options.default_value)="0"]; // Battery ID, for systems with multiple batteries
float voltage_v = 1 [(mavsdk.options.default_value)="NaN"]; // Voltage in volts
float remaining_percent = 2 [(mavsdk.options.default_value)="NaN"]; // Estimated battery remaining (range: 0.0 to 1.0)
float remaining_percent = 2 [(mavsdk.options.default_value)="NaN"]; // Estimated battery remaining (range: 0 to 100)
float current_ma = 4 [(mavsdk.options.default_value)="NaN"]; // Current in mA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also be A instead of mA but then we are quite different from the MAVLink message.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change if you want. Just let me know.

bool status_not_ready_to_use = 5 [(mavsdk.options.default_value)="0"]; // Battery not ready to use
bool status_charging = 6 [(mavsdk.options.default_value)="0"]; // Battery charging

bool status_cell_balancing = 7 [(mavsdk.options.default_value)="0"]; // Battery is cell balancing (during charging)
bool battery_fault_cells_not_balanced = 8 [(mavsdk.options.default_value)="0"]; // Cells are not balanced
bool status_auto_discharging = 9 [(mavsdk.options.default_value)="0"]; // Battery is auto discharging (towards storage level)
bool status_requires_service = 10 [(mavsdk.options.default_value)="0"]; // Battery requires service (not safe to fly)
bool status_bad_battery = 11 [(mavsdk.options.default_value)="0"]; // Battery is faulty and cannot be repaired (not safe to fly)
bool status_protections_enabled = 12 [(mavsdk.options.default_value)="0"]; // Automatic battery protection monitoring is enabled.
bool battery_fault_protection_system = 13 [(mavsdk.options.default_value)="0"]; // The battery fault protection system had detected a fault and cut all power from the battery
bool battery_fault_over_volt = 14 [(mavsdk.options.default_value)="0"]; // One or more cells are above their maximum voltage rating
bool battery_fault_under_volt = 15 [(mavsdk.options.default_value)="0"]; // One or more cells are below their minimum voltage rating
bool battery_fault_over_temperature = 16 [(mavsdk.options.default_value)="0"]; // Over-temperature fault
bool battery_fault_under_temperature = 17 [(mavsdk.options.default_value)="0"]; // Under-temperature fault
bool battery_fault_over_current = 18 [(mavsdk.options.default_value)="0"]; // Over-current fault
bool battery_fault_short_curcuit = 19 [(mavsdk.options.default_value)="0"]; // Short circuit event detected
bool battery_fault_incompatible_voltage = 20 [(mavsdk.options.default_value)="0"]; // Voltage not compatible with power rail voltage (batteries on same power rail should have similar voltage)
bool battery_fault_incompatible_firmware = 21 [(mavsdk.options.default_value)="0"]; // Battery firmware is not compatible with current autopilot firmware
bool battery_fault_incompatible_cells_configuration = 22 [(mavsdk.options.default_value)="0"]; // Battery is not compatible due to cell configuration
bool status_capacity_relative_to_full = 23 [(mavsdk.options.default_value)="0"]; // Battery capacity values are relative to a known-full battery (smart battery) and not estimated
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved
}


/*
* Flight modes.
*
Expand Down