Browse Source

airframe metadata sort by SYS_AUTOSTART and minor cleanup (#8009)

sbg
Daniel Agar 7 years ago committed by GitHub
parent
commit
d04d62c37e
  1. 2
      ROMFS/px4fmu_common/init.d/11001_hexa_cox
  2. 38
      ROMFS/px4fmu_common/init.d/13000_generic_vtol_standard
  3. 18
      ROMFS/px4fmu_common/init.d/3000_generic_wing
  4. 3
      ROMFS/px4fmu_common/init.d/3030_io_camflyer
  5. 2
      ROMFS/px4fmu_common/init.d/3032_skywalker_x5
  6. 2
      ROMFS/px4fmu_common/init.d/4001_quad_x
  7. 2
      ROMFS/px4fmu_common/init.d/4002_quad_x_mount
  8. 0
      ROMFS/px4fmu_common/init.d/4004_H4_680mm
  9. 0
      ROMFS/px4fmu_common/init.d/4030_3dr_solo
  10. 0
      ROMFS/px4fmu_common/init.d/4031_3dr_quad
  11. 61
      ROMFS/px4fmu_common/init.d/50000_generic_ground_vehicle
  12. 3
      ROMFS/px4fmu_common/init.d/50002_traxxas_stampede_2wd
  13. 0
      ROMFS/px4fmu_common/init.d/rc.ugv_apps
  14. 2
      ROMFS/px4fmu_common/init.d/rc.ugv_defaults
  15. 4
      ROMFS/px4fmu_common/init.d/rcS
  16. 51
      ROMFS/px4fmu_common/mixers/Q.main.mix
  17. 8
      ROMFS/px4fmu_common/mixers/fw_generic_wing.main.mix
  18. 37
      ROMFS/px4fmu_common/mixers/ugv_generic.main.mix
  19. 29
      Tools/px4airframes/srcparser.py
  20. 1
      Tools/px4airframes/xmlout.py

2
ROMFS/px4fmu_common/init.d/11001_hexa_cox

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!nsh
#
# @name Generic Hexa coaxial geometry
# @name Generic Hexarotor coaxial geometry
#
# @type Hexarotor Coaxial
# @class Copter

38
ROMFS/px4fmu_common/init.d/13000_generic_vtol_standard

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
#!nsh
#
# @name Generic Quadplane VTOL
#
# @type Standard VTOL
# @class VTOL
#
# @maintainer
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output AUX1 Aileron 1
# @output AUX2 Aileron 2
# @output AUX3 Elevator
# @output AUX4 Rudder
# @output AUX5 Throttle
#
# @board px4fmu-v1 exclude
sh /etc/init.d/rc.vtol_defaults
if [ $AUTOCNF == yes ]
then
param set VT_TYPE 2
param set VT_MOT_COUNT 4
fi
set MIXER quad_x
set PWM_OUT 1234
set PWM_RATE 400
set MIXER_AUX vtol_AAERT
set PWM_ACHDIS 5
set PWM_AUX_DISARMED 950
set MAV_TYPE 22

18
ROMFS/px4fmu_common/init.d/3000_generic_wing

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
#!nsh
#
# @name Generic Flying Wing
#
# @type Flying Wing
# @class Plane
#
# @maintainer
#
sh /etc/init.d/rc.fw_defaults
if [ $AUTOCNF == yes ]
then
fi
set MIXER fw_generic_wing

3
ROMFS/px4fmu_common/init.d/3030_io_camflyer

@ -43,7 +43,8 @@ then @@ -43,7 +43,8 @@ then
param set FW_RR_P 0.04
fi
set MIXER Q
set MIXER fw_generic_wing
# Provide ESC a constant 1000 us pulse while disarmed
set PWM_OUT 4
set PWM_DISARMED 1000

2
ROMFS/px4fmu_common/init.d/3032_skywalker_x5

@ -40,4 +40,4 @@ then @@ -40,4 +40,4 @@ then
param set FW_RR_P 0.04
fi
set MIXER X5
set MIXER fw_generic_wing

2
ROMFS/px4fmu_common/init.d/4001_quad_x

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!nsh
#
# @name Generic Quadrotor X config
# @name Generic Quadrotor x
#
# @type Quadrotor x
# @class Copter

2
ROMFS/px4fmu_common/init.d/4002_quad_x_mount

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#!nsh
#
# @name Generic Quadrotor X config with mount (e.g. gimbal)
# @name Generic Quadrotor x with mount (e.g. gimbal)
#
# @type Quadrotor x
# @class Copter

0
ROMFS/px4fmu_common/init.d/10021_H4_680mm → ROMFS/px4fmu_common/init.d/4004_H4_680mm

0
ROMFS/px4fmu_common/init.d/4030_solo → ROMFS/px4fmu_common/init.d/4030_3dr_solo

0
ROMFS/px4fmu_common/init.d/10020_3dr_quad → ROMFS/px4fmu_common/init.d/4031_3dr_quad

61
ROMFS/px4fmu_common/init.d/50000_generic_ground_vehicle

@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
#!nsh
#
# @name Generic Ground Vehicle
#
# @type Rover
# @class Rover
#
# @output MAIN2 steering
# @output MAIN4 throttle
#
# @maintainer
#
sh /etc/init.d/rc.ugv_defaults
if [ $AUTOCNF == yes ]
then
param set BAT_N_CELLS 2
param set FW_AIRSPD_MIN 0
param set FW_AIRSPD_TRIM 1
param set FW_AIRSPD_MAX 3
param set NAV_ACC_RAD 0.5
param set MIS_LTRMIN_ALT 0.01
param set MIS_TAKEOFF_ALT 0.01
param set EKF2_GBIAS_INIT 0.01
param set EKF2_ANGERR_INIT 0.01
param set EKF2_MAG_TYPE 1
param set GND_WR_P 2
param set GND_WR_I 0.9674
param set GND_WR_IMAX 0.1
param set GND_WR_D 1.2
param set GND_SP_CTRL_MODE 1
param set GND_L1_DIST 10
param set GND_THR_IDLE 0
param set GND_THR_CRUISE 0
param set GND_THR_MAX 0.5
param set GND_THR_MIN 0
param set GND_SPEED_P 0.25
param set GND_SPEED_I 0.001
param set GND_SPEED_D 3
param set GND_SPEED_IMAX 0.125
param set GND_SPEED_THR_SC 1
fi
# Configure this as ugv
set MAV_TYPE 10
# Set mixer
set MIXER ugv_generic
# Provide ESC a constant 1500 us pulse
set PWM_DISARMED 1500
set PWM_MAIN_REV2 1
set PWM_MAX 2000
set PWM_MIN 1000

3
ROMFS/px4fmu_common/init.d/50002_traxxas_stampede_2wd

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
# @maintainer Marco Zorzi
#
sh /etc/init.d/rc.gnd_defaults
sh /etc/init.d/rc.ugv_defaults
if [ $AUTOCNF == yes ]
then
@ -52,6 +52,7 @@ fi @@ -52,6 +52,7 @@ fi
# Configure this as ugv
set MAV_TYPE 10
# Set mixer
set MIXER stampede

0
ROMFS/px4fmu_common/init.d/rc.gnd_apps → ROMFS/px4fmu_common/init.d/rc.ugv_apps

2
ROMFS/px4fmu_common/init.d/rc.gnd_defaults → ROMFS/px4fmu_common/init.d/rc.ugv_defaults

@ -9,7 +9,7 @@ then @@ -9,7 +9,7 @@ then
#
param set NAV_DLL_ACT 0
param set NAV_ACC_RAD 2.0
# temporary
param set NAV_FW_ALT_RAD 1000

4
ROMFS/px4fmu_common/init.d/rcS

@ -865,7 +865,7 @@ then @@ -865,7 +865,7 @@ then
if [ $MIXER == none ]
then
# Set default mixer for UGV if not defined
set MIXER stampede
set MIXER ugv_generic
fi
if [ $MAV_TYPE == none ]
@ -880,7 +880,7 @@ then @@ -880,7 +880,7 @@ then
sh /etc/init.d/rc.interface
# Start standard UGV apps
sh /etc/init.d/rc.gnd_apps
sh /etc/init.d/rc.ugv_apps
fi
#

51
ROMFS/px4fmu_common/mixers/Q.main.mix

@ -1,51 +0,0 @@ @@ -1,51 +0,0 @@
Delta-wing mixer for PX4FMU
===========================
Designed for Bormatec Camflyer Q
This file defines mixers suitable for controlling a delta wing aircraft using
PX4FMU. The configuration assumes the elevon servos are connected to PX4FMU
servo outputs 0 and 1 and the motor speed control to output 3. Output 2 is
assumed to be unused.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch) and 3 (thrust).
See the README for more information on the scaler format.
Elevon mixers
-------------
Three scalers total (output, roll, pitch).
On the assumption that the two elevon servos are physically reversed, the pitch
input is inverted between the two servos.
The scaling factor for roll inputs is adjusted to implement differential travel
for the elevons.
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 -8000 -8000 0 -10000 10000
S: 0 1 6000 6000 0 -10000 10000
M: 2
O: 10000 10000 0 -10000 10000
S: 0 0 -8000 -8000 0 -10000 10000
S: 0 1 -6000 -6000 0 -10000 10000
Output 2
--------
This mixer is empty.
Z:
Motor speed mixer
-----------------
Two scalers total (output, thrust).
This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range. Inputs below zero are treated as zero.
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 0 20000 -10000 -10000 10000

8
ROMFS/px4fmu_common/mixers/X5.main.mix → ROMFS/px4fmu_common/mixers/fw_generic_wing.main.mix

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
Delta-wing mixer for PX4FMU
Generic wing mixer
===========================
This file defines mixers suitable for controlling a delta wing aircraft using
PX4FMU. The configuration assumes the elevon servos are connected to PX4FMU
servo outputs 0 and 1 and the motor speed control to output 3. Output 2 is
This file defines mixers suitable for controlling a delta wing aircraft.
The configuration assumes the elevon servos are connected to servo
outputs 0 and 1 and the motor speed control to output 3. Output 2 is
assumed to be unused.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0

37
ROMFS/px4fmu_common/mixers/ugv_generic.main.mix

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
Generic car mixer (eg Traxxas Stampede RC Car)
===========================
Designed for Traxxas Stampede
This file defines mixers suitable for controlling a Traxxas Stampede rover using
PX4FMU. The configuration assumes the steering is connected to PX4FMU
servo outputs 1 and the motor speed control to output 3. Output 0 and 2 is
assumed to be unused.
Inputs to the mixer come from channel group 0 (vehicle attitude), channels 2 (yaw), and 3 (thrust).
See the README for more information on the scaler format.
Output 0
---------------------------------------
Z:
Steering mixer using roll on output 1
---------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 2 10000 10000 0 -10000 10000
Output 2
---------------------------------------
This mixer is empty.
Z:
Output 3
---------------------------------------
M: 1
O: 10000 10000 0 -10000 10000
S: 0 3 10000 10000 0 -10000 10000

29
Tools/px4airframes/srcparser.py

@ -90,16 +90,14 @@ class ParameterGroup(object): @@ -90,16 +90,14 @@ class ParameterGroup(object):
return "Boat"
return "AirframeUnknown"
def GetParams(self):
"""
Returns the parsed list of parameters. Every parameter is a Parameter
object. Note that returned object is not a copy. Modifications affect
state of the parser.
"""
return sorted(self.params,
key=lambda x: x.GetFieldValue("code"))
return sorted(self.params, key=lambda x: x.GetId())
class Parameter(object):
"""
@ -443,28 +441,7 @@ class SourceParser(object): @@ -443,28 +441,7 @@ class SourceParser(object):
sys.stderr.write("Duplicate parameter definition: {0}\n".format(name_plus_board))
return False
seenParamNames.append(name_plus_board)
# Validate values
default = param.GetDefault()
min = param.GetFieldValue("min")
max = param.GetFieldValue("max")
#sys.stderr.write("{0} default:{1} min:{2} max:{3}\n".format(name, default, min, max))
if default != "" and not self.IsNumber(default):
sys.stderr.write("Default value not number: {0} {1}\n".format(name, default))
return False
if min != "":
if not self.IsNumber(min):
sys.stderr.write("Min value not number: {0} {1}\n".format(name, min))
return False
if default != "" and float(default) < float(min):
sys.stderr.write("Default value is smaller than min: {0} default:{1} min:{2}\n".format(name, default, min))
return False
if max != "":
if not self.IsNumber(max):
sys.stderr.write("Max value not number: {0} {1}\n".format(name, max))
return False
if default != "" and float(default) > float(max):
sys.stderr.write("Default value is larger than max: {0} default:{1} max:{2}\n".format(name, default, max))
return False
return True
def GetParamGroups(self):

1
Tools/px4airframes/xmlout.py

@ -57,6 +57,7 @@ class XMLOutput(): @@ -57,6 +57,7 @@ class XMLOutput():
attribstrs = attrib.split(":")
xml_field.attrib[attribstrs[0].strip()] = attribstrs[1].strip()
xml_field.text = valstrs[0]
indent(xml_parameters)
self.xml_document = ET.ElementTree(xml_parameters)

Loading…
Cancel
Save