mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 10:43:34 +08:00
This commit is an attempt to fix a race condition happening on takeoff between the land detector and the multicopter position controller. Previously, an auto-takeoff leads to the following events: 1. A takeoff setpoint is given. 2. The thrust setpoint spikes because we don't enter smooth takeoff yet. 3. The land detector detects a takeoff because of the high thrust. 4. The position controller sees the landed state transition and initiates the smooth takeoff. Thrust goes back down. 5. Depending on control gains the takeoff is successful or fails if the smoothing takes too long which causes thrust to be too low, so the land detector detects land again. The two obvious problems with this are: - The intermittent spike. - The failed takeoff because of the smoothing leads to a delay.. With this change, the logic for a takeoff detection is moved from the land detector to the position controller. The events are now: 1. A takeoff setpoint is given. 2. The position controller detects the takeoff setpoint and initiates the smooth takeoff. 3. As thrust ramps up, the land detector detects the take off. In the same way, we now detect the intent to takeoff in manual, altitude, control, position control in the position controller instead of in the land detector.
80 lines
1.7 KiB
Plaintext
80 lines
1.7 KiB
Plaintext
#!nsh
|
|
#
|
|
# @name Intel Aero Ready to Fly Drone
|
|
#
|
|
# @board px4fmu-v2 exclude
|
|
# @board px4fmu-v3 exclude
|
|
# @board px4fmu-v4 exclude
|
|
# @board px4fmu-v4pro exclude
|
|
# @board px4fmu-v5 exclude
|
|
#
|
|
# @type Quadrotor x
|
|
# @class Copter
|
|
#
|
|
# @maintainer Lucas de Marchi
|
|
#
|
|
|
|
sh /etc/init.d/rc.mc_defaults
|
|
|
|
#
|
|
# Load default params for this platform
|
|
#
|
|
if [ $AUTOCNF == yes ]
|
|
then
|
|
# Set all params here, then disable autoconfig
|
|
|
|
param set COM_DISARM_LAND 3
|
|
|
|
param set LNDMC_Z_VEL_MAX 2.0000
|
|
|
|
param set MC_ROLL_P 8.0000
|
|
param set MC_ROLLRATE_P 0.1300
|
|
param set MC_ROLLRATE_I 0.07
|
|
param set MC_ROLLRATE_D 0.0012
|
|
param set MC_ROLLRATE_MAX 360
|
|
param set MC_PITCH_P 8.0000
|
|
param set MC_PITCHRATE_P 0.1300
|
|
param set MC_PITCHRATE_I 0.07
|
|
param set MC_PITCHRATE_D 0.0012
|
|
param set MC_PITCHRATE_MAX 360
|
|
param set MC_YAW_P 4.0
|
|
param set MC_YAWRATE_P 0.119999997317790985
|
|
param set MC_YAWRATE_I 0.050000000745058060
|
|
param set MC_YAWRATE_D 0.0
|
|
param set MC_YAW_FF 0.5
|
|
|
|
param set MPC_LAND_SPEED 0.7000
|
|
param set MPC_MANTHR_MIN 0.0400
|
|
param set MPC_THR_HOVER 0.5000
|
|
param set MPC_THR_MAX 0.9400
|
|
param set MPC_THR_MIN 0.1000
|
|
param set MPC_XY_CRUISE 8.0000
|
|
param set MPC_XY_P 1.5000
|
|
param set MPC_XY_VEL_P 0.1500
|
|
param set MPC_Z_P 1.5000
|
|
param set MPC_Z_VEL_I 0.1500
|
|
param set MPC_Z_VEL_MAX_DN 4.0000
|
|
param set MPC_Z_VEL_MAX_UP 5.0000
|
|
param set MPC_Z_VEL_P 0.8000
|
|
|
|
param set EKF2_GPS_POS_X -0.0600
|
|
param set EKF2_GPS_POS_Z -0.1000
|
|
param set EKF2_MIN_OBS_DT 50
|
|
|
|
param set EKF2_BARO_GATE 10.0
|
|
param set EKF2_BARO_NOISE 5.0
|
|
param set EKF2_ACC_NOISE 0.7
|
|
|
|
param set SYS_LOGGER 1
|
|
fi
|
|
|
|
tap_esc start -d /dev/ttyS0 -n 4
|
|
usleep 300000
|
|
|
|
set OUTPUT_MODE tap_esc
|
|
set MIXER quad_x
|
|
set USE_IO no
|
|
|
|
param set SYS_COMPANION 921600
|
|
set MAVLINK_COMPANION_DEVICE /dev/ttyS1
|