From 6897bfdc6bbafe202c65656f00bf539125145ec6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Apr 2015 08:05:29 +1000 Subject: [PATCH] autotest: fixes for crrcsim with heli model --- Tools/autotest/pysim/crrcsim.py | 51 ++++++++++++++------------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/Tools/autotest/pysim/crrcsim.py b/Tools/autotest/pysim/crrcsim.py index 836b1b528a..847f87af16 100644 --- a/Tools/autotest/pysim/crrcsim.py +++ b/Tools/autotest/pysim/crrcsim.py @@ -23,7 +23,6 @@ class CRRCSim(Aircraft): self.decode_servos = self.decode_servos_heli else: self.decode_servos = self.decode_servos_fixed_wing - self.rsc_setpoint = 0.8 def decode_servos_heli(self, servos): '''decode servos for heli''' @@ -32,42 +31,36 @@ class CRRCSim(Aircraft): swash3 = servos[2] tail_rotor = servos[3] rsc = servos[7] - rsc = util.constrain(rsc, 0, self.rsc_setpoint) - # get total thrust from 0 to 1 - rsc_scaling = (rsc/self.rsc_setpoint) - self.thrust = rsc_scaling*(swash1+swash2+swash3)/3.0 + col_pitch = (swash1+swash2+swash3)/6.0 + roll_rate = (swash1 - swash2)/2 + pitch_rate = -((swash1 + swash2)/2.0 - swash3)/2 + yaw_rate = -(tail_rotor - 0.5) + rsc_speed = rsc - # very simplistic mapping to body euler rates - self.roll_rate = (swash1 - swash2)*rsc_scaling - self.pitch_rate = -((swash1 + swash2)/2.0 - swash3)*rsc_scaling - self.yaw_rate = -(tail_rotor - 0.5)*rsc_scaling + buf = struct.pack('