battery: make time remaining estimation dependent on level flight cha… (#22401)

* battery: make time remaining estimation dependent on level flight characteristis for FW

* battery: fix that FW flight is also correctly detected when vehicle_status is not updated

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* FixedwingPositionControl: Move constant to header file

* flight phase estimation: use tecs height rate reference to check for level flight

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
KonradRudin
2024-02-06 17:32:09 +01:00
committed by GitHub
parent bf52d8adc9
commit 3576d513cd
8 changed files with 60 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ float32 voltage_v # Battery voltage in volts, 0 if unknown
float32 voltage_filtered_v # Battery voltage in volts, filtered, 0 if unknown
float32 current_a # Battery current in amperes, -1 if unknown
float32 current_filtered_a # Battery current in amperes, filtered, 0 if unknown
float32 current_average_a # Battery current average in amperes, -1 if unknown
float32 current_average_a # Battery current average in amperes (for FW average in level flight), -1 if unknown
float32 discharged_mah # Discharged amount in mAh, -1 if unknown
float32 remaining # From 1 to 0, -1 if unknown
float32 scale # Power scaling factor, >= 1, or -1 if unknown
+1
View File
@@ -93,6 +93,7 @@ set(msg_files
FigureEightStatus.msg
FailsafeFlags.msg
FailureDetectorStatus.msg
FlightPhaseEstimation.msg
FollowTarget.msg
FollowTargetEstimator.msg
FollowTargetStatus.msg
+8
View File
@@ -0,0 +1,8 @@
uint64 timestamp # time since system start (microseconds)
uint8 flight_phase # Estimate of current flight phase
uint8 FLIGHT_PHASE_UNKNOWN = 0 # vehicle flight phase is unknown
uint8 FLIGHT_PHASE_LEVEL = 1 # Vehicle is in level flight
uint8 FLIGHT_PHASE_DESCEND = 2 # vehicle is in descend
uint8 FLIGHT_PHASE_CLIMB = 3 # vehicle is climbing