mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 17:03:34 +08:00
refactor(control_allocation): Clarify and enforce that motors are in matrix 0
This commit is contained in:
@@ -50,6 +50,11 @@ int ActuatorEffectiveness::Configuration::addActuator(ActuatorType type, const m
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (type == ActuatorType::MOTORS && selected_matrix != 0) {
|
||||
PX4_ERR("Trying to add motors to matrix %d (add to matrix 0)", selected_matrix);
|
||||
return -1;
|
||||
}
|
||||
|
||||
effectiveness_matrices[selected_matrix](ActuatorEffectiveness::ControlAxis::ROLL, actuator_idx) = torque(0);
|
||||
effectiveness_matrices[selected_matrix](ActuatorEffectiveness::ControlAxis::PITCH, actuator_idx) = torque(1);
|
||||
effectiveness_matrices[selected_matrix](ActuatorEffectiveness::ControlAxis::YAW, actuator_idx) = torque(2);
|
||||
|
||||
Reference in New Issue
Block a user