diff options
author | Roman Bapst <romanbapst@yahoo.de> | 2014-12-02 10:30:26 +0100 |
---|---|---|
committer | Roman Bapst <romanbapst@yahoo.de> | 2014-12-02 10:30:26 +0100 |
commit | 48ba912f08b328d709965a4dd7acb878b598f961 (patch) | |
tree | e8cb2077f21ca1c05f8f1811a7bfb4c6f896a9da /ROMFS/px4fmu_common/init.d | |
parent | 39169c35fe00769016cef266ed491c6323fc8630 (diff) | |
download | px4-firmware-48ba912f08b328d709965a4dd7acb878b598f961.tar.gz px4-firmware-48ba912f08b328d709965a4dd7acb878b598f961.tar.bz2 px4-firmware-48ba912f08b328d709965a4dd7acb878b598f961.zip |
adapted and added ROMFS-scripts to support VTOL
Diffstat (limited to 'ROMFS/px4fmu_common/init.d')
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.autostart | 17 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.vtol_apps | 15 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.vtol_defaults | 39 | ||||
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rcS | 39 |
4 files changed, 110 insertions, 0 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rc.autostart b/ROMFS/px4fmu_common/init.d/rc.autostart index 496a52c5f..331ff4974 100644 --- a/ROMFS/px4fmu_common/init.d/rc.autostart +++ b/ROMFS/px4fmu_common/init.d/rc.autostart @@ -15,6 +15,7 @@ # 10000 .. 10999 Wide arm / H frame # 11000 .. 11999 Hexa Cox # 12000 .. 12999 Octo Cox +# 13000 .. 13999 VTOL # # Simulation @@ -237,3 +238,19 @@ if param compare SYS_AUTOSTART 12001 then sh /etc/init.d/12001_octo_cox fi + +# +# VTOL quadshot +# + if param compare SYS_AUTOSTART 13000 + then + sh /etc/init.d/13000_quadshot + fi + +# +# VTOL caipririnha +# + if param compare SYS_AUTOSTART 13001 + then + sh /etc/init.d/13001_caipirinha_vtol + fi diff --git a/ROMFS/px4fmu_common/init.d/rc.vtol_apps b/ROMFS/px4fmu_common/init.d/rc.vtol_apps new file mode 100644 index 000000000..23ade6d78 --- /dev/null +++ b/ROMFS/px4fmu_common/init.d/rc.vtol_apps @@ -0,0 +1,15 @@ +#!nsh +# +# Standard apps for vtol: +# att & pos estimator, att & pos control. +# + +attitude_estimator_ekf start +#ekf_att_pos_estimator start +position_estimator_inav start + +vtol_att_control start +mc_att_control start +mc_pos_control start +fw_att_control start +fw_pos_control_l1 start diff --git a/ROMFS/px4fmu_common/init.d/rc.vtol_defaults b/ROMFS/px4fmu_common/init.d/rc.vtol_defaults new file mode 100644 index 000000000..376a2e257 --- /dev/null +++ b/ROMFS/px4fmu_common/init.d/rc.vtol_defaults @@ -0,0 +1,39 @@ +#!nsh + +set VEHICLE_TYPE vtol + +if [ $DO_AUTOCONFIG == yes ] +then + # + #Default controller parameters for MC + # + param set MC_ROLL_P 6.0 + param set MC_ROLLRATE_P 0.1 + param set MC_ROLLRATE_I 0.0 + param set MC_ROLLRATE_D 0.003 + param set MC_PITCH_P 6.0 + param set MC_PITCHRATE_P 0.2 + param set MC_PITCHRATE_I 0.0 + param set MC_PITCHRATE_D 0.003 + param set MC_YAW_P 4 + param set MC_YAWRATE_P 0.2 + param set MC_YAWRATE_I 0.0 + param set MC_YAWRATE_D 0.0 + param set MC_YAW_FF 0.3 + + # + # Default parameters for FW + # + param set FW_PR_FF 0.3 + param set FW_PR_I 0.000 + param set FW_PR_IMAX 0.2 + param set FW_PR_P 0.02 + param set FW_RR_FF 0.3 + param set FW_RR_I 0.00 + param set FW_RR_IMAX 0.2 + param set FW_RR_P 0.02 +fi + +set PWM_DISARMED 900 +set PWM_MIN 1000 +set PWM_MAX 2000 diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 353f44877..ffef598c4 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -545,7 +545,46 @@ then sh /etc/init.d/rc.mc_apps fi fi + + # + # VTOL setup + # + if [ $VEHICLE_TYPE == vtol ] + then + echo "[init] Vehicle type: VTOL" + + if [ $MIXER == none ] + then + echo "Default mixer for vtol not defined" + fi + if [ $MAV_TYPE == none ] + then + # Use mixer to detect vehicle type + if [ $MIXER == FMU_quadshot ] + then + set MAV_TYPE 20 + fi + fi + + # Still no MAV_TYPE found + if [ $MAV_TYPE == none ] + then + echo "Unknown MAV_TYPE" + else + param set MAV_TYPE $MAV_TYPE + fi + + # Load mixer and configure outputs + sh /etc/init.d/rc.interface + + # Start standard vtol apps + if [ $LOAD_DEFAULT_APPS == yes ] + then + sh /etc/init.d/rc.vtol_apps + fi + fi + # # Start the navigator # |