ControlAllocator: explicitly reflect that rovers have no battery scaling

This commit is contained in:
Balduin 2026-01-26 12:23:22 +01:00
parent 6c2e6c6917
commit 3d8b2be5d1
2 changed files with 9 additions and 1 deletions

View File

@ -350,6 +350,7 @@ ControlAllocator::Run()
_armed = vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED;
_is_vtol = vehicle_status.is_vtol;
_vehicle_type = vehicle_status.vehicle_type;
ActuatorEffectiveness::FlightPhase flight_phase{ActuatorEffectiveness::FlightPhase::HOVER_FLIGHT};
@ -483,7 +484,13 @@ ControlAllocator::update_battery_scaling_modes()
const ActuatorEffectiveness::FlightPhase flight_phase = _actuator_effectiveness->getFlightPhase();
if (_param_ca_bat_scale_en.get()) {
if (_is_vtol) {
if (_vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROVER) {
// Currently there is no rover battery scaling. Add here if necessary.
_battery_scaling_modes[0] = BatteryScalingMode::NONE;
_battery_scaling_modes[1] = BatteryScalingMode::NONE;
} else if (_is_vtol) {
_battery_scaling_modes[0] = BatteryScalingMode::ALL;
_battery_scaling_modes[1] = BatteryScalingMode::FORWARD_THRUST_ONLY;

View File

@ -219,6 +219,7 @@ private:
bool _armed{false};
bool _is_vtol{false};
uint8_t _vehicle_type{vehicle_status_s::VEHICLE_TYPE_UNSPECIFIED};
hrt_abstime _last_run{0};
hrt_abstime _timestamp_sample{0};
hrt_abstime _last_status_pub{0};