from navigation.rc import RCLib import time import navigation.imu as imu rc = RCLib() rc.setmode('MANUAL') rc.arm() while (True): try: rc.getDeg() except: print('in loop')
from navigation.rc import RCLib from navigation.ac import ACLib import time import navigation.imu as imu rc = RCLib() ac = ACLib() rc.setmode('MANUAL') rc.arm() print(rc.getDeg()) # global "origin" parameter START = 239 DEPTH_SEC = 5.2 SEC_PER_METER = 1 GATECENTER = 2500 def leftAlign(value): pingReturn = ac.get_distance_fwd() wallDist = pingReturn[0] confidence = pingReturn[1] counter = 0 while ((confidence < 70) and (counter < 50)): pingReturn = ac.get_distance_fwd() wallDist = pingReturn[0] confidence = pingReturn[1] counter = counter + 1
from navigation.rc import RCLib import time import navigation.imu as imu from navigation.log import * log = LogLib() rc = RCLib(log) rc.setmode('ALT_HOLD') rc.arm() print 'Throttle' rc.throttle("time", 3, -0.20) rc.throttle("time", 120, 0)