Skip to content

Commit

Permalink
common: extend BATTERY_STATUS w/ low state
Browse files Browse the repository at this point in the history
Let the autopilot optionally publish its low battery state based on
its vehicle specific configuration. The same state should be used
internally for automatic low battery reactions.

This information is useful because the autopilot should be the instance
having the entire configuration and being the single instance deciding
about the vehicles current state. The state should then be used to update
UI or e.g. energy saving, risk minimizing behaviour of external components.
  • Loading branch information
MaEtUgR committed Mar 27, 2018
1 parent 31c0a68 commit 051bf25
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions message_definitions/v1.0/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2498,6 +2498,27 @@
<description>Payload battery</description>
</entry>
</enum>
<enum name="MAV_BATTERY_LOW_STATE">
<description>Enumeration for states of low battery extent</description>
<entry value="0" name="MAV_BATTERY_LOW_STATE_UNDEFINED">
<description>Low battery state is not provided</description>
</entry>
<entry value="1" name="MAV_BATTERY_LOW_STATE_OK">
<description>Battery is not nearly empty, normal operation</description>
</entry>
<entry value="2" name="MAV_BATTERY_LOW_STATE_LOW">
<description>Battery state is low, warn and monitor close</description>
</entry>
<entry value="3" name="MAV_BATTERY_LOW_STATE_CRITICAL">
<description>Battry state is critical, return / abort immediately</description>
</entry>
<entry value="4" name="MAV_BATTERY_LOW_STATE_EMERGENCY">
<description>Battry state is too low for ordinary abortion, fastest possible emergency stop preventing damage</description>
</entry>
<entry value="5" name="MAV_BATTERY_LOW_STATE_FAILED">
<description>Battry failed, damage unavoidable</description>
</entry>
</enum>
<enum name="MAV_VTOL_STATE">
<description>Enumeration of VTOL states</description>
<entry value="0" name="MAV_VTOL_STATE_UNDEFINED">
Expand Down Expand Up @@ -4114,6 +4135,7 @@
<field type="int8_t" name="battery_remaining" units="%">Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot does not estimate the remaining battery</field>
<extensions/>
<field type="int32_t" name="time_remaining" units="s">Remaining battery time, in seconds (0 = 0s = 0% energy left), -1: autopilot does not provide remaining battery time estimate</field>
<field type="uint8_t" name="battery_low_state" enum="MAV_BATTERY_LOW_STATE">Low battery extent state, provided by autopilot for warning or futher reactions.</field>
</message>
<message id="148" name="AUTOPILOT_VERSION">
<description>Version and capability of autopilot software</description>
Expand Down

0 comments on commit 051bf25

Please sign in to comment.