diff --git a/src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp b/src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp index beacc7007b..ca425cd110 100644 --- a/src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp +++ b/src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessHelicopter.cpp @@ -65,6 +65,8 @@ ActuatorEffectivenessHelicopter::ActuatorEffectivenessHelicopter(ModuleParams *p _param_handles.yaw_throttle_scale = param_find("CA_HELI_YAW_TH_S"); _param_handles.yaw_ccw = param_find("CA_HELI_YAW_CCW"); _param_handles.spoolup_time = param_find("COM_SPOOLUP_TIME"); + _param_handles.linearize_servos = param_find("CA_LIN_SERVO"); + _param_handles.max_sevo_throw = param_find("CA_MAX_SVO_THROW"); updateParams(); } @@ -101,6 +103,14 @@ void ActuatorEffectivenessHelicopter::updateParams() int32_t yaw_ccw = 0; param_get(_param_handles.yaw_ccw, &yaw_ccw); _geometry.yaw_sign = (yaw_ccw == 1) ? -1.f : 1.f; + int32_t linearize_servos = 0; + param_get(_param_handles.linearize_servos, &linearize_servos); + _geometry.linearize_servos = (linearize_servos != 0); + float max_sevo_throw = 0.f; + param_get(_param_handles.max_sevo_throw, &max_sevo_throw); + max_sevo_throw *= M_PI_F / 180.0f; //converting deg to rad + _geometry.max_sevo_height = sinf(max_sevo_throw); + _geometry.inverse_max_servo_throw = 1/max_sevo_throw; } bool ActuatorEffectivenessHelicopter::getEffectivenessMatrix(Configuration &configuration, @@ -168,6 +178,11 @@ void ActuatorEffectivenessHelicopter::updateSetpoint(const matrix::Vector