vehicles: add new vehicle type: Airship (#14862)

Co-authored-by: Anton Erasmus <anton@flycloudline.com>
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
This commit is contained in:
Daniel Leonard Robinson
2020-08-10 08:52:51 +02:00
committed by GitHub
co-authored by Anton Erasmus Beat Küng
parent 454433c2ef
commit fa4818e467
18 changed files with 687 additions and 2 deletions
@@ -0,0 +1,15 @@
#!/bin/sh
#
# @name Cloudship
# @type Airship
# @class Airship
#
# @output MAIN1 thrust tilt
# @output MAIN2 starboard thruster
# @output MAIN3 port thruster
# @output MAIN4 tail thruster
sh /etc/init.d/rc.airship_defaults
set MIXER cloudship
set PWM_OUT 1234
@@ -0,0 +1,21 @@
#!/bin/sh
#
# @name Cloudship
# @type Airship
# @class Airship
#
# @output MAIN1 starboard thruster
# @output MAIN2 port thruster
# @output MAIN3 thrust tilt
# @output MAIN4 tail thruster
sh /etc/init.d/rc.airship_defaults
if [ $AUTOCNF = yes ]
then
param set COM_PREARM_MODE 2
param set CBRK_IO_SAFETY 22027
fi
set MIXER cloudship
set PWM_OUT 1234
@@ -0,0 +1,59 @@
#!/bin/sh
#
# Standard apps for airships. Attitude/Position estimator, Attitude/Position control.
#
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#
###############################################################################
# Begin Estimator Group Selection #
###############################################################################
#
# LPE
#
if param compare SYS_MC_EST_GROUP 1
then
#
# Try to start LPE. If it fails, start EKF2 as a default.
# Unfortunately we do not build it on px4_fmu-v2 due to a limited flash.
#
if attitude_estimator_q start
then
echo "WARN [init] Estimator LPE unsupported, EKF2 recommended."
local_position_estimator start
else
echo "ERROR [init] Estimator LPE not available. Using EKF2"
param set SYS_MC_EST_GROUP 2
param save
reboot
fi
else
#
# Q estimator (attitude estimation only)
#
if param compare SYS_MC_EST_GROUP 3
then
attitude_estimator_q start
else
#
# EKF2
#
param set SYS_MC_EST_GROUP 2
ekf2 start
fi
fi
###############################################################################
# End Estimator Group Selection #
###############################################################################
#
# Start Airship Attitude Controller.
#
airship_att_control start
#
# Start Land Detector.
#
land_detector start airship
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Airship default parameters.
#
# NOTE: Script variables are declared/initialized/unset in the rcS script.
#
set VEHICLE_TYPE airship
#
# This is the gimbal pass mixer.
#
set MIXER_AUX pass
set PWM_AUX_OUT 1234
@@ -147,6 +147,32 @@ then
sh /etc/init.d/rc.vtol_apps
fi
#
# Airship setup.
#
if [ $VEHICLE_TYPE = airship ]
then
if [ $MIXER = none ]
then
echo "Airship mixer undefined"
fi
if [ $MAV_TYPE = none ]
then
# Set a default MAV_TYPE = 7 if not defined.
set MAV_TYPE 7
fi
# Set the mav type parameter.
param set MAV_TYPE ${MAV_TYPE}
# Load mixer and configure outputs.
sh /etc/init.d/rc.interface
# Start airship apps.
sh /etc/init.d/rc.airship_apps
fi
#
# UUV setup
#
@@ -0,0 +1,47 @@
Thrust tilt/ Starboard Thrust / Port Thrust / Tail Thrust mixer for PX4FMU
=======================================================
This file defines mixers suitable for controlling an airship with
a thrust tilt, starboard and port thruster and a tail thruster using PX4FMU.
The configuration assumes the starboard thruster is connected to PX4FMU
output 1, port thruster to output 2, tilt servo to output 3, and the
tail thruster to output 4.
Inputs to the mixer come from channel group 0 (vehicle attitude),
channels 0 (roll), 1 (pitch), 2 (yaw) and 3 (thrust).
Starboard and port thruster mixer
-----------------
Two scalers total (output, thrust).
By default mixer output is normalized. The input is in the (0 - 1) range.
M: 1
S: 0 3 0 20000 -10000 -10000 10000
M: 1
S: 0 3 0 20000 -10000 -10000 10000
Servo controlling tilt mixer
------------
Two scalers total (output, tilt angle).
This mixer assumes that the tilt servo is set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the servo movement) and adjust the offset, scaling and
endpoints to suit.
M: 1
S: 0 1 10000 10000 0 -10000 10000
Tail thruster mixer
------------
Two scalers total (output, yaw).
This mixer assumes that the tail thruster is set up correctly mechanically;
depending on the actual configuration it may be necessary to reverse the scaling
factors (to reverse the motor movement) and adjust the offset, scaling and
endpoints to suit.
M: 1
S: 0 2 10000 10000 0 -10000 10000