diff --git a/src/modules/control_allocator/ControlAllocator.cpp b/src/modules/control_allocator/ControlAllocator.cpp index d8d52534e1..6beec7c590 100644 --- a/src/modules/control_allocator/ControlAllocator.cpp +++ b/src/modules/control_allocator/ControlAllocator.cpp @@ -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; diff --git a/src/modules/control_allocator/ControlAllocator.hpp b/src/modules/control_allocator/ControlAllocator.hpp index 9fb021aeb0..3918410a02 100644 --- a/src/modules/control_allocator/ControlAllocator.hpp +++ b/src/modules/control_allocator/ControlAllocator.hpp @@ -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};