-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Add support for parsing CBAT message #24088
base: main
Are you sure you want to change the base?
Conversation
0540010
to
6efa3fa
Compare
#include <px4_platform_common/log.h> | ||
#include <px4_platform_common/tasks.h> | ||
#include <px4_platform_common/ | ||
#include <px4_platform_common/tasks.h>log.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix
1ad3ed4
to
647dc5a
Compare
bool connected # Whether or not a battery is connected, based on a voltage threshold | ||
float32 voltage_v # Battery voltage in volts, 0 if unknown | ||
float32 current_a # Battery current in amperes, -1 if unknown | ||
float32 current_average_a # Battery current average in amperes (for FW average in level flight), -1 if unknown | ||
float32 current_average_a # Battery current average in amperes (for FW average in level flight), -1 if unknown ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix
uint16 max_error # max error, expected margin of error in % in the state-of-charge calculation with a range of 1 to 100% | ||
uint8 id # ID number of a battery. Should be unique and consistent for the lifetime of a vehicle. 1-indexed. | ||
uint16 interface_error # interface error counter | ||
uint8 priority # Zero based priority is the connection on the Power Controller V1..Vn AKA BrickN-1 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix
|
||
float32[14] voltage_cell_v # Battery individual cell voltages, 0 if unknown | ||
float32 max_cell_voltage_delta # Max difference between individual cell voltages | ||
|
||
bool is_powering_off # Power off event imminent indication, false if unknown | ||
bool is_required # Set if the battery is explicitly required before arming | ||
|
||
uint8 MAX_INSTANCES = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to 3
Adding support for parsing CUAV's CBAT message in order to read serial numbers of certain smart batteries (e.g. Tattu).
Solved Problem
When trying to read the serial number of a Tattu smart battery, I found that the battery sends a CBAT message that contains valuable info about it (e.g., the serial number) but isn't parsed currently in PX4. To get the info in the message, the pasing logic is added in this PR.
Fixes #{Github issue ID}
Solution
Changelog Entry
For release notes:
Alternatives
We could also ...
Test coverage
Context
Related links, screenshot before/after, video