mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 18:13:35 +08:00
battery: delete unused armed
This commit is contained in:
@@ -44,8 +44,7 @@ AnalogBattery::AnalogBattery(int index, ModuleParams *parent) :
|
||||
|
||||
void
|
||||
AnalogBattery::updateBatteryStatusRawADC(hrt_abstime timestamp, int32_t voltage_raw, int32_t current_raw,
|
||||
bool selected_source, int priority, float throttle_normalized,
|
||||
bool armed)
|
||||
bool selected_source, int priority, float throttle_normalized)
|
||||
{
|
||||
float voltage_v = (voltage_raw * _analog_params.cnt_v_volt) * _analog_params.v_div;
|
||||
float current_a = ((current_raw * _analog_params.cnt_v_curr) - _analog_params.v_offs_cur) * _analog_params.a_per_v;
|
||||
@@ -55,7 +54,7 @@ AnalogBattery::updateBatteryStatusRawADC(hrt_abstime timestamp, int32_t voltage_
|
||||
|
||||
|
||||
Battery::updateBatteryStatus(timestamp, voltage_v, current_a, connected,
|
||||
selected_source, priority, throttle_normalized, armed, _params.source == 0);
|
||||
selected_source, priority, throttle_normalized, _params.source == 0);
|
||||
}
|
||||
|
||||
bool AnalogBattery::is_valid()
|
||||
@@ -144,4 +143,4 @@ AnalogBattery::updateParams()
|
||||
}
|
||||
|
||||
Battery::updateParams();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,11 +50,9 @@ 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
|
||||
*/
|
||||
void updateBatteryStatusRawADC(hrt_abstime timestamp, int32_t voltage_raw, int32_t current_raw,
|
||||
bool selected_source, int priority, float throttle_normalized,
|
||||
bool armed);
|
||||
bool selected_source, int priority, float throttle_normalized);
|
||||
|
||||
/**
|
||||
* Whether the ADC channel for the voltage of this battery is valid.
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/Publication.hpp>
|
||||
#include <uORB/topics/actuator_controls.h>
|
||||
#include <uORB/topics/vehicle_control_mode.h>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
#include <uORB/topics/battery_status.h>
|
||||
#include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp>
|
||||
@@ -130,11 +129,8 @@ public:
|
||||
private:
|
||||
DevHandle _h_adc; /**< ADC driver handle */
|
||||
|
||||
bool _armed{false}; /**< arming status of the vehicle */
|
||||
|
||||
uORB::Subscription _actuator_ctrl_0_sub{ORB_ID(actuator_controls_0)}; /**< attitude controls sub */
|
||||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)}; /**< notification of parameter updates */
|
||||
uORB::Subscription _vcontrol_mode_sub{ORB_ID(vehicle_control_mode)}; /**< vehicle control mode subscription */
|
||||
|
||||
AnalogBattery _battery1;
|
||||
|
||||
@@ -296,8 +292,7 @@ BatteryStatus::adc_poll()
|
||||
bat_current_adc_readings[b],
|
||||
selected_source == b,
|
||||
b,
|
||||
ctrl.control[actuator_controls_s::INDEX_THROTTLE],
|
||||
_armed
|
||||
ctrl.control[actuator_controls_s::INDEX_THROTTLE]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -318,13 +313,6 @@ BatteryStatus::Run()
|
||||
|
||||
perf_begin(_loop_perf);
|
||||
|
||||
/* check vehicle status for changes to publication state */
|
||||
if (_vcontrol_mode_sub.updated()) {
|
||||
vehicle_control_mode_s vcontrol_mode{};
|
||||
_vcontrol_mode_sub.copy(&vcontrol_mode);
|
||||
_armed = vcontrol_mode.flag_armed;
|
||||
}
|
||||
|
||||
/* check parameters for updates */
|
||||
parameter_update_poll();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user