예제 #1
0
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')
예제 #2
0
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()

rc.throttle("time", 1, -0.5)

start = rc.getDeg()
rc.imu_turn(start + 90)

#i=0
#while (i<50) :
#   rc.getDeg()
#   rc.raw("yaw", 1555)
#   i = i+1

#start = rc.getDeg()
#print(start)
#print('Now Yawing')
#rc.yaw("imu", 45, 0.2)

#turn=90