mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 18:23:34 +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
co-authored by
Silvan Fuhrer
Roman Bapst
parent
fc6b61dad1
commit
343cf5603e
@@ -54,4 +54,5 @@ px4_add_romfs_files(
|
||||
rc.vehicle_setup
|
||||
rc.vtol_apps
|
||||
rc.vtol_defaults
|
||||
rc.ctrlalloc
|
||||
)
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name S500 with control allocation
|
||||
#
|
||||
# @type Quadrotor x
|
||||
# @class Copter
|
||||
#
|
||||
# @maintainer Silvan Fuhrer
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
sh /etc/init.d/rc.ctrlalloc
|
||||
|
||||
if [ $AUTOCNF = yes ]
|
||||
then
|
||||
param set MPC_USE_HTE 0
|
||||
|
||||
param set VM_MASS 1.5
|
||||
param set VM_INERTIA_XX 0.03
|
||||
param set VM_INERTIA_YY 0.03
|
||||
param set VM_INERTIA_ZZ 0.05
|
||||
|
||||
param set CA_AIRFRAME 0
|
||||
param set CA_METHOD 1
|
||||
param set CA_ACT0_MIN 0.0
|
||||
param set CA_ACT1_MIN 0.0
|
||||
param set CA_ACT2_MIN 0.0
|
||||
param set CA_ACT3_MIN 0.0
|
||||
param set CA_ACT0_MAX 1.0
|
||||
param set CA_ACT1_MAX 1.0
|
||||
param set CA_ACT2_MAX 1.0
|
||||
param set CA_ACT3_MAX 1.0
|
||||
|
||||
param set CA_MC_R0_PX 0.177
|
||||
param set CA_MC_R0_PY 0.177
|
||||
param set CA_MC_R0_CT 6.5
|
||||
param set CA_MC_R0_KM 0.05
|
||||
param set CA_MC_R1_PX -0.177
|
||||
param set CA_MC_R1_PY -0.177
|
||||
param set CA_MC_R1_CT 6.5
|
||||
param set CA_MC_R1_KM 0.05
|
||||
param set CA_MC_R2_PX 0.177
|
||||
param set CA_MC_R2_PY -0.177
|
||||
param set CA_MC_R2_CT 6.5
|
||||
param set CA_MC_R2_KM -0.05
|
||||
param set CA_MC_R3_PX -0.177
|
||||
param set CA_MC_R3_PY 0.177
|
||||
param set CA_MC_R3_CT 6.5
|
||||
param set CA_MC_R3_KM -0.05
|
||||
|
||||
fi
|
||||
|
||||
set MIXER direct
|
||||
set PWM_OUT 1234
|
||||
|
||||
set MIXER_AUX direct_aux
|
||||
set PWM_AUX_OUT 1234
|
||||
@@ -0,0 +1,75 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @name Hex X with control allocation
|
||||
#
|
||||
# @type Hexarotor x
|
||||
# @class Copter
|
||||
#
|
||||
# @maintainer Silvan Fuhrer
|
||||
#
|
||||
|
||||
sh /etc/init.d/rc.mc_defaults
|
||||
sh /etc/init.d/rc.ctrlalloc
|
||||
|
||||
if [ $AUTOCNF = yes ]
|
||||
then
|
||||
param set MPC_USE_HTE 0
|
||||
|
||||
param set VM_MASS 1.5
|
||||
param set VM_INERTIA_XX 0.03
|
||||
param set VM_INERTIA_YY 0.03
|
||||
param set VM_INERTIA_ZZ 0.05
|
||||
|
||||
param set CA_AIRFRAME 0
|
||||
param set CA_METHOD 1
|
||||
param set CA_ACT0_MIN 0.0
|
||||
param set CA_ACT1_MIN 0.0
|
||||
param set CA_ACT2_MIN 0.0
|
||||
param set CA_ACT3_MIN 0.0
|
||||
param set CA_ACT4_MIN 0.0
|
||||
param set CA_ACT5_MIN 0.0
|
||||
|
||||
param set CA_ACT0_MAX 1.0
|
||||
param set CA_ACT1_MAX 1.0
|
||||
param set CA_ACT2_MAX 1.0
|
||||
param set CA_ACT3_MAX 1.0
|
||||
param set CA_ACT4_MAX 1.0
|
||||
param set CA_ACT5_MAX 1.0
|
||||
|
||||
param set CA_MC_R0_PX 0.0
|
||||
param set CA_MC_R0_PY 0.275
|
||||
param set CA_MC_R0_CT 6.5
|
||||
param set CA_MC_R0_KM -0.05
|
||||
|
||||
param set CA_MC_R1_PX 0.0
|
||||
param set CA_MC_R1_PY -0.275
|
||||
param set CA_MC_R1_CT 6.5
|
||||
param set CA_MC_R1_KM 0.05
|
||||
|
||||
param set CA_MC_R2_PX 0.238
|
||||
param set CA_MC_R2_PY -0.1375
|
||||
param set CA_MC_R2_CT 6.5
|
||||
param set CA_MC_R2_KM -0.05
|
||||
|
||||
param set CA_MC_R3_PX -0.238
|
||||
param set CA_MC_R3_PY 0.1375
|
||||
param set CA_MC_R3_CT 6.5
|
||||
param set CA_MC_R3_KM 0.05
|
||||
|
||||
param set CA_MC_R4_PX 0.238
|
||||
param set CA_MC_R4_PY 0.1375
|
||||
param set CA_MC_R4_CT 6.5
|
||||
param set CA_MC_R4_KM 0.05
|
||||
|
||||
param set CA_MC_R5_PX -0.238
|
||||
param set CA_MC_R5_PY -0.1375
|
||||
param set CA_MC_R5_CT 6.5
|
||||
param set CA_MC_R5_KM -0.05
|
||||
|
||||
fi
|
||||
|
||||
set MIXER direct
|
||||
set PWM_OUT 123456
|
||||
|
||||
set MIXER_AUX direct_aux
|
||||
set PWM_AUX_OUT 123456
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Standard apps for new control allocation and controllers
|
||||
#
|
||||
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
||||
#
|
||||
|
||||
#
|
||||
# Start angular velocity controller
|
||||
#
|
||||
angular_velocity_controller start
|
||||
mc_rate_control stop
|
||||
|
||||
#
|
||||
# Start Control Allocator
|
||||
#
|
||||
control_allocator start
|
||||
|
||||
#
|
||||
# Disable hover thrust estimator and prearming
|
||||
# These features are currently incompatible with control allocation
|
||||
#
|
||||
# TODO: fix
|
||||
#
|
||||
param set MPC_USE_HTE 0
|
||||
param set COM_PREARM_MODE 0
|
||||
Reference in New Issue
Block a user