コード例 #1
0
ファイル: diag_line.py プロジェクト: yaochx/SeniorThesis2015
# Initialize the copter connection
api = local_connect()
cc = CopterControl(api)

# arm copter
cc.arm()

# change to guided mode
cc.set_mode("GUIDED")

# wait for changes to take effect
time.sleep(3)

# takeoff!
print "Taking off ..."
cc.takeoff(15)
time.sleep(10)

# going to start location
print "going to start loc"
cc.goto((start[0], start[1]), start[2])
cc.set_yaw(250)
time.sleep(10)

# start following the path
print "Following path ..."
for p in path[1:]:
	print "GOING TO ", p
	cc.goto((p[0], p[1]), p[2])
	while not at_loc((cc.get_current_location().lat, cc.get_current_location().lon), (p[0], p[1])):
		time.sleep(0.01)