ControlAllocation: introduce convention for control surface deflection sign

- horizontal control surfaces: up=positive deflection
- vertical control surfaces (rudder): right=positive deflection
- mixed (V-Tail): up=positive deflection

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2021-12-24 20:06:13 -05:00
committed by Daniel Agar
parent 5259877b1b
commit 1ad66e606b
7 changed files with 109 additions and 78 deletions
@@ -82,8 +82,15 @@ void ActuatorEffectivenessControlSurfaces::updateParams()
param_get(_param_handles[i].trim, &_params[i].trim);
// TODO: enforce limits?
// TODO: enforce limits (note that tailsitter uses different limits)?
switch (_params[i].type) {
case Type::LeftAileron:
break;
case Type::RightAileron:
break;
case Type::Elevator:
break;
@@ -107,12 +114,6 @@ void ActuatorEffectivenessControlSurfaces::updateParams()
torque.setZero();
break;
case Type::LeftAileron:
break;
case Type::RightAileron:
break;
case Type::Airbrakes:
torque.setZero();
break;
@@ -45,16 +45,16 @@ public:
enum class Type : int32_t {
// This matches with the parameter
Elevator = 1,
Rudder = 2,
LeftElevon = 3,
RightElevon = 4,
LeftVTail = 5,
RightVTail = 6,
LeftFlaps = 7,
RightFlaps = 8,
LeftAileron = 9,
RightAileron = 10,
LeftAileron = 1,
RightAileron = 2,
Elevator = 3,
Rudder = 4,
LeftElevon = 5,
RightElevon = 6,
LeftVTail = 7,
RightVTail = 8,
LeftFlaps = 9,
RightFlaps = 10,
Airbrakes = 11,
Custom = 12,
};