helicopter: add tail servo support

as a separate CA_AIRFRAME, as the UI cannot switch between servo/motor.
This commit is contained in:
Beat Küng
2023-07-03 16:21:27 +02:00
parent bae413a332
commit 77d6c722a7
5 changed files with 46 additions and 10 deletions
@@ -37,8 +37,8 @@
using namespace matrix;
using namespace time_literals;
ActuatorEffectivenessHelicopter::ActuatorEffectivenessHelicopter(ModuleParams *parent)
: ModuleParams(parent)
ActuatorEffectivenessHelicopter::ActuatorEffectivenessHelicopter(ModuleParams *parent, ActuatorType tail_actuator_type)
: ModuleParams(parent), _tail_actuator_type(tail_actuator_type)
{
for (int i = 0; i < NUM_SWASH_PLATE_SERVOS_MAX; ++i) {
char buffer[17];
@@ -115,8 +115,8 @@ ActuatorEffectivenessHelicopter::getEffectivenessMatrix(Configuration &configura
// As the allocation is non-linear, we use updateSetpoint() instead of the matrix
configuration.addActuator(ActuatorType::MOTORS, Vector3f{}, Vector3f{});
// Tail (yaw) motor
configuration.addActuator(ActuatorType::MOTORS, Vector3f{}, Vector3f{});
// Tail (yaw) (either ESC or Servo)
configuration.addActuator(_tail_actuator_type, Vector3f{}, Vector3f{});
// N swash plate servos
_first_swash_plate_servo_index = configuration.num_actuators_matrix[0];
@@ -66,7 +66,7 @@ public:
float spoolup_time;
};
ActuatorEffectivenessHelicopter(ModuleParams *parent);
ActuatorEffectivenessHelicopter(ModuleParams *parent, ActuatorType tail_actuator_type);
virtual ~ActuatorEffectivenessHelicopter() = default;
bool getEffectivenessMatrix(Configuration &configuration, EffectivenessUpdateReason external_update) override;
@@ -129,4 +129,6 @@ private:
uORB::Subscription _manual_control_switches_sub{ORB_ID(manual_control_switches)};
bool _main_motor_engaged{true};
const ActuatorType _tail_actuator_type;
};