mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-15 03:00:35 +08:00
FixedwingRateControl: Remove old battery scaling
This commit is contained in:
@@ -394,20 +394,6 @@ void FixedwingRateControl::Run()
|
||||
|
||||
/* throttle passed through if it is finite */
|
||||
_vehicle_thrust_setpoint.xyz[0] = PX4_ISFINITE(_rates_sp.thrust_body[0]) ? _rates_sp.thrust_body[0] : 0.0f;
|
||||
|
||||
/* scale effort by battery status */
|
||||
if (_param_fw_bat_scale_en.get() && _vehicle_thrust_setpoint.xyz[0] > 0.1f) {
|
||||
|
||||
if (_battery_status_sub.updated()) {
|
||||
battery_status_s battery_status{};
|
||||
|
||||
if (_battery_status_sub.copy(&battery_status) && battery_status.connected && battery_status.scale > 0.f) {
|
||||
_battery_scale = battery_status.scale;
|
||||
}
|
||||
}
|
||||
|
||||
_vehicle_thrust_setpoint.xyz[0] *= _battery_scale;
|
||||
}
|
||||
}
|
||||
|
||||
// publish rate controller status
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
#include <uORB/SubscriptionCallback.hpp>
|
||||
#include <uORB/topics/actuator_controls_status.h>
|
||||
#include <uORB/topics/airspeed_validated.h>
|
||||
#include <uORB/topics/battery_status.h>
|
||||
#include <uORB/topics/control_allocator_status.h>
|
||||
#include <uORB/topics/manual_control_setpoint.h>
|
||||
#include <uORB/topics/normalized_unsigned_setpoint.h>
|
||||
@@ -103,7 +102,6 @@ private:
|
||||
|
||||
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
|
||||
|
||||
uORB::Subscription _battery_status_sub{ORB_ID(battery_status)};
|
||||
uORB::Subscription _manual_control_setpoint_sub{ORB_ID(manual_control_setpoint)};
|
||||
uORB::Subscription _rates_sp_sub{ORB_ID(vehicle_rates_setpoint)};
|
||||
uORB::Subscription _vehicle_control_mode_sub{ORB_ID(vehicle_control_mode)};
|
||||
@@ -141,8 +139,6 @@ private:
|
||||
|
||||
bool _landed{true};
|
||||
|
||||
float _battery_scale{1.0f};
|
||||
|
||||
float _energy_integration_time{0.0f};
|
||||
float _control_energy[4] {};
|
||||
float _control_prev[3] {};
|
||||
@@ -173,8 +169,6 @@ private:
|
||||
|
||||
(ParamInt<px4::params::FW_ARSP_SCALE_EN>) _param_fw_arsp_scale_en,
|
||||
|
||||
(ParamBool<px4::params::FW_BAT_SCALE_EN>) _param_fw_bat_scale_en,
|
||||
|
||||
(ParamFloat<px4::params::FW_DTRIM_P_VMAX>) _param_fw_dtrim_p_vmax,
|
||||
(ParamFloat<px4::params::FW_DTRIM_P_VMIN>) _param_fw_dtrim_p_vmin,
|
||||
(ParamFloat<px4::params::FW_DTRIM_R_VMAX>) _param_fw_dtrim_r_vmax,
|
||||
|
||||
@@ -269,17 +269,6 @@ PARAM_DEFINE_FLOAT(FW_ACRO_Y_MAX, 90);
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(FW_ACRO_Z_MAX, 45);
|
||||
|
||||
/**
|
||||
* Enable throttle scale by battery level
|
||||
*
|
||||
* This compensates for voltage drop of the battery over time by attempting to
|
||||
* normalize performance across the operating range of the battery.
|
||||
*
|
||||
* @boolean
|
||||
* @group FW Rate Control
|
||||
*/
|
||||
PARAM_DEFINE_INT32(FW_BAT_SCALE_EN, 0);
|
||||
|
||||
/**
|
||||
* Enable airspeed scaling
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user