From 9df96d0e07cd0408ad62dec8e639ca66d87a0ff5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jan 2012 21:45:58 +1100 Subject: [PATCH] pysim: added more frame types --- Tools/autotest/pysim/multicopter.py | 32 +++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/Tools/autotest/pysim/multicopter.py b/Tools/autotest/pysim/multicopter.py index 8403e75b19..9f69bc44d4 100755 --- a/Tools/autotest/pysim/multicopter.py +++ b/Tools/autotest/pysim/multicopter.py @@ -12,16 +12,44 @@ class Motor(object): def build_motors(frame): '''build a motors list given a frame type''' - if frame in [ '+', 'X' ]: + frame = frame.lower() + if frame in [ 'quad', '+', 'x' ]: motors = [ Motor(90, False, 1), Motor(270, False, 2), Motor(0, True, 3), Motor(180, True, 4), ] - if frame == 'X': + if frame in [ 'x', 'quadx' ]: for i in range(4): motors[i].angle -= 45.0 + elif frame in ["y6"]: + motors = [ + Motor(60, False, 1), + Motor(60, True, 7), + Motor(180, True, 4), + Motor(180, False, 8), + Motor(-60, True, 2), + Motor(-60, False, 3), + ] + elif frame in ["hexa", "hexa+"]: + motors = [ + Motor(0, True, 1), + Motor(60, False, 4), + Motor(120, True, 8), + Motor(180, False, 2), + Motor(240, True, 3), + Motor(300, False, 7), + ] + elif frame in ["hexax"]: + motors = [ + Motor(30, False, 7), + Motor(90, True, 1), + Motor(150, False, 4), + Motor(210, True, 8), + Motor(270, False, 2), + Motor(330, True, 3), + ] elif frame in ["octa", "octa+"]: motors = [ Motor(0, True, 1),