diff options
author | Anton Matosov <anton.matosov@gmail.com> | 2015-01-06 00:57:54 +0200 |
---|---|---|
committer | Anton Matosov <anton.matosov@gmail.com> | 2015-01-08 13:58:46 +0200 |
commit | 7d528330d570fa4900b1a24c2a1f851c3a7dcba0 (patch) | |
tree | d2b68ae8cce39e5c47227c7d26b6f8dd92c018c7 /src/modules/systemlib/mixer/multi_tables.py | |
parent | aa2a00b56a0be0e20abfa54c311575f9e055f212 (diff) | |
download | px4-firmware-7d528330d570fa4900b1a24c2a1f851c3a7dcba0.tar.gz px4-firmware-7d528330d570fa4900b1a24c2a1f851c3a7dcba0.tar.bz2 px4-firmware-7d528330d570fa4900b1a24c2a1f851c3a7dcba0.zip |
Implemented SK450 DeadCat frame support
Implemented the way to specify motor output scale which is required for SK450 DeadCat as it has asymetrical arms (front arms are longer than back ones)
Diffstat (limited to 'src/modules/systemlib/mixer/multi_tables.py')
-rwxr-xr-x | src/modules/systemlib/mixer/multi_tables.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/modules/systemlib/mixer/multi_tables.py b/src/modules/systemlib/mixer/multi_tables.py index 21c0affd9..ba59e0536 100755 --- a/src/modules/systemlib/mixer/multi_tables.py +++ b/src/modules/systemlib/mixer/multi_tables.py @@ -69,6 +69,13 @@ quad_plus = [ [ 180, CW], ] +quad_deadcat = [ + [ 63, CCW, 1.0], + [-135, CCW, 0.964], + [ -63, CW, 1.0], + [ 135, CW, 0.964], +] + quad_v = [ [ 18.8, 0.4242], [ -18.8, 1.0], @@ -148,13 +155,18 @@ twin_engine = [ [-90, 0.0], ] + +tables = [quad_x, quad_plus, quad_v, quad_wide, quad_deadcat, hex_x, hex_plus, hex_cox, octa_x, octa_plus, octa_cox, twin_engine] + def variableName(variable): for variableName, value in list(globals().items()): if value is variable: return variableName -tables = [quad_x, quad_plus, quad_v, quad_wide, hex_x, hex_plus, hex_cox, octa_x, octa_plus, octa_cox, twin_engine] - +def unpackScales(scalesList): + if len(scalesList) == 2: + scalesList += [1.0] #Add thrust scale + return scalesList def printEnum(): print("enum class MultirotorGeometry : MultirotorGeometryUnderlyingType {") @@ -167,10 +179,11 @@ def printEnum(): def printScaleTables(): for table in tables: print("const MultirotorMixer::Rotor _config_{}[] = {{".format(variableName(table))) - for (angle, yawScale) in table: + for row in table: + angle, yawScale, thrustScale = unpackScales(row) rollScale = rcos(angle + 90) pitchScale = rcos(angle) - print("\t{{ {:9f}, {:9f}, {:9f} }},".format(rollScale, pitchScale, yawScale)) + print("\t{{ {:9f}, {:9f}, {:9f}, {:9f} }},".format(rollScale, pitchScale, yawScale, thrustScale)) print("};\n") def printScaleTablesIndex(): |