44 #include <uORB/topics/battery_status.h> 57 void reset(battery_status_s *battery_status);
85 bool connected,
bool selected_source,
int priority,
86 float throttle_normalized,
87 bool armed, battery_status_s *status);
90 void filterVoltage(
float voltage_v);
91 void filterThrottle(
float throttle);
92 void filterCurrent(
float current_a);
93 void sumDischarged(
hrt_abstime timestamp,
float current_a);
94 void estimateRemaining(
float voltage_v,
float current_a,
float throttle,
bool armed);
95 void determineWarning(
bool connected);
110 bool _battery_initialized =
false;
111 float _voltage_filtered_v = -1.f;
112 float _throttle_filtered = -1.f;
113 float _current_filtered_a = -1.f;
114 float _discharged_mah = 0.f;
115 float _discharged_mah_loop = 0.f;
116 float _remaining_voltage = -1.f;
117 float _remaining = -1.f;
Definition: px4_param.h:313
float full_cell_voltage()
Get the full voltage per cell.
Definition: battery.h:72
High-resolution timer with callouts and timekeeping.
void updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float current_a, bool connected, bool selected_source, int priority, float throttle_normalized, bool armed, battery_status_s *status)
Update current battery status message.
Definition: battery.cpp:68
Definition: px4_param.h:318
C++ base class for modules/classes using configuration parameters.
Definition: px4_module_params.h:46
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Definition: drv_hrt.h:58
void reset(battery_status_s *battery_status)
Reset all battery stats and report invalid/nothing.
Definition: battery.cpp:55
int cell_count()
Get the battery cell count.
Definition: battery.h:62
float empty_cell_voltage()
Get the empty voltage per cell.
Definition: battery.h:67