mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 21:03:34 +08:00
helicopter: add tail servo support
as a separate CA_AIRFRAME, as the UI cannot switch between servo/motor.
This commit is contained in:
+4
-4
@@ -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];
|
||||
|
||||
+3
-1
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user