battery: delete unused armed

This commit is contained in:
Daniel Agar
2019-12-12 09:48:45 -05:00
parent 11bbc8ae34
commit de9e4dda4c
10 changed files with 16 additions and 33 deletions
+3 -4
View File
@@ -117,8 +117,7 @@ Battery::reset()
void
Battery::updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float current_a,
bool connected, bool selected_source, int priority,
float throttle_normalized,
bool armed, bool should_publish)
float throttle_normalized, bool should_publish)
{
reset();
_battery_status.timestamp = timestamp;
@@ -126,7 +125,7 @@ Battery::updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float curre
filterThrottle(throttle_normalized);
filterCurrent(current_a);
sumDischarged(timestamp, current_a);
estimateRemaining(_voltage_filtered_v, _current_filtered_a, _throttle_filtered, armed);
estimateRemaining(_voltage_filtered_v, _current_filtered_a, _throttle_filtered);
computeScale();
if (_battery_initialized) {
@@ -235,7 +234,7 @@ Battery::sumDischarged(hrt_abstime timestamp, float current_a)
}
void
Battery::estimateRemaining(float voltage_v, float current_a, float throttle, bool armed)
Battery::estimateRemaining(float voltage_v, float current_a, float throttle)
{
// remaining battery capacity based on voltage
float cell_voltage = voltage_v / _params.n_cells;
+2 -3
View File
@@ -96,11 +96,10 @@ public:
* @param selected_source: This battery is on the brick that the selected source for selected_source
* @param priority: The brick number -1. The term priority refers to the Vn connection on the LTC4417
* @param throttle_normalized: Throttle of the vehicle, between 0 and 1
* @param armed: Arming state of the vehicle
* @param should_publish If True, this function published a battery_status uORB message.
*/
void updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float current_a, bool connected,
bool selected_source, int priority, float throttle_normalized, bool armed, bool should_publish);
bool selected_source, int priority, float throttle_normalized, bool should_publish);
/**
* Publishes the uORB battery_status message with the most recently-updated data.
@@ -227,7 +226,7 @@ private:
void filterThrottle(float throttle);
void filterCurrent(float current_a);
void sumDischarged(hrt_abstime timestamp, float current_a);
void estimateRemaining(float voltage_v, float current_a, float throttle, bool armed);
void estimateRemaining(float voltage_v, float current_a, float throttle);
void determineWarning(bool connected);
void computeScale();