@@ -163,6 +163,8 @@ def driveInput(self):
163163 print "Taking control of self.ManualControl"
164164 self .objMan .ManualControlCommand .metadata .access = UAVMetaDataObject .Access .READONLY
165165 self .objMan .ManualControlCommand .metadata .updated ()
166+ self .objMan .ManualControlCommand .Connected .value = True
167+ self .objMan .ManualControlCommand .updated ()
166168
167169 print "Arming board using Yaw right"
168170 while (self .objMan .FlightStatus .Armed .value != 2 ):
@@ -179,6 +181,11 @@ def driveInput(self):
179181
180182 print "Applying Throttle"
181183 self .objMan .ManualControlCommand .Throttle .value = 0.01 # very small value for safety
184+ # Assuming board do not control a helicopter, Thrust value will be equal to Throttle value.
185+ # Because a 'high' value can be read from latest real RC input value,
186+ # initial value is set now to zero for safety reasons.
187+ self .objMan .ManualControlCommand .Thrust .value = 0
188+ # self.objMan.ManualControlCommand.Throttle.value = self.objMan.ManualControlCommand.Thrust.value
182189 self .objMan .ManualControlCommand .updated ()
183190 time .sleep (0.3 )
184191
@@ -235,6 +242,8 @@ def driveInput(self):
235242 print "Back to self.ManualControl, controlled by RC radio"
236243 self .objMan .ManualControlCommand .metadata .access = UAVMetaDataObject .Access .READWRITE
237244 self .objMan .ManualControlCommand .metadata .updated ()
245+ self .objMan .ManualControlCommand .Connected .value = False
246+ self .objMan .ManualControlCommand .updated ()
238247
239248
240249def printUsage ():
0 commit comments