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
Copter & Plane: Report battery failsafe via the sys_status message #5574
Copter & Plane: Report battery failsafe via the sys_status message #5574
Conversation
It's a slight stretch of the intended usage if we're talking about the new enum representing the battery monitor but it's ok if we consider it's the battery itself. Basically I'm ok with it. |
@@ -215,6 +219,10 @@ void Plane::update_sensor_status_flags(void) | |||
control_sensors_enabled |= MAV_SYS_STATUS_LOGGING; | |||
} | |||
|
|||
if (g.fs_batt_voltage != 0 || g.fs_batt_mah != 0) { |
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.
Isnt using >0 better here?
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.
Not sure, 0 was the enable value, although on reflection I think the voltage one is a float so that should change to is_zero(). I'm not sure if there is any logical reason, but I'm pretty sure you could be looking at negative voltages if you had a negative multiplier.
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.
On reflection we do it as if current < fs_batt_voltage so that doesn't matter. Will change to > 0
d41d35f
to
783abe0
Compare
Rover doesn't have a battery failsafe yet, so this is good to be merged now. |
Merged. |
@DonLakeFlyer Do you have any suggestions ? |
Adds a MAVLink enum for the SYS_STATUS_SENSOR_BATTERY field, reports as present if the AP_BattMonitor primary instance is healthy, reports enabled if either of the battery failsafes are enabled, reports healthy as long as battery failsafe hasn't been triggered.
This is meant to address the fact that there is 0 persistent indication to the GCS that the aircraft is in a low battery/failsafe state. If everyone is fine with it I can extend it to Copter/Rover. Long term we still need a proper failsafe reporting system, however this is an easy fix for the larger problem, and actually is very consistent with the current reporting mechanisms.