mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 13:10:36 +08:00
initial control allocation support
- control allocation module with multirotor, VTOL standard, and tiltrotor support - angular_velocity_controller - See https://github.com/PX4/PX4-Autopilot/pull/13351 for details Co-authored-by: Silvan Fuhrer <silvan@auterion.com> Co-authored-by: Roman Bapst <bapstroman@gmail.com>
This commit is contained in:
committed by
Daniel Agar
parent
fc6b61dad1
commit
343cf5603e
@@ -49,7 +49,9 @@ MixingOutput::MixingOutput(uint8_t max_num_outputs, OutputModuleInterface &inter
|
||||
{&interface, ORB_ID(actuator_controls_0)},
|
||||
{&interface, ORB_ID(actuator_controls_1)},
|
||||
{&interface, ORB_ID(actuator_controls_2)},
|
||||
{&interface, ORB_ID(actuator_controls_3)}
|
||||
{&interface, ORB_ID(actuator_controls_3)},
|
||||
{&interface, ORB_ID(actuator_controls_4)},
|
||||
{&interface, ORB_ID(actuator_controls_5)},
|
||||
},
|
||||
_scheduling_policy(scheduling_policy),
|
||||
_support_esc_calibration(support_esc_calibration),
|
||||
@@ -536,9 +538,11 @@ int MixingOutput::controlCallback(uintptr_t handle, uint8_t control_group, uint8
|
||||
|
||||
/* motor spinup phase - lock throttle to zero */
|
||||
if (output->_output_limit.state == OUTPUT_LIMIT_STATE_RAMP) {
|
||||
if ((control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE ||
|
||||
control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE_ALTERNATE) &&
|
||||
control_index == actuator_controls_s::INDEX_THROTTLE) {
|
||||
if (((control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE ||
|
||||
control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE_ALTERNATE) &&
|
||||
control_index == actuator_controls_s::INDEX_THROTTLE) ||
|
||||
(control_group == actuator_controls_s::GROUP_INDEX_ALLOCATED_PART1 ||
|
||||
control_group == actuator_controls_s::GROUP_INDEX_ALLOCATED_PART2)) {
|
||||
/* limit the throttle output to zero during motor spinup,
|
||||
* as the motors cannot follow any demand yet
|
||||
*/
|
||||
@@ -548,9 +552,11 @@ int MixingOutput::controlCallback(uintptr_t handle, uint8_t control_group, uint8
|
||||
|
||||
/* throttle not arming - mark throttle input as invalid */
|
||||
if (output->armNoThrottle() && !output->_armed.in_esc_calibration_mode) {
|
||||
if ((control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE ||
|
||||
control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE_ALTERNATE) &&
|
||||
control_index == actuator_controls_s::INDEX_THROTTLE) {
|
||||
if (((control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE ||
|
||||
control_group == actuator_controls_s::GROUP_INDEX_ATTITUDE_ALTERNATE) &&
|
||||
control_index == actuator_controls_s::INDEX_THROTTLE) ||
|
||||
(control_group == actuator_controls_s::GROUP_INDEX_ALLOCATED_PART1 ||
|
||||
control_group == actuator_controls_s::GROUP_INDEX_ALLOCATED_PART2)) {
|
||||
/* set the throttle to an invalid value */
|
||||
input = NAN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user