Ejemplo n.º 1
0
lightbulb_detach() #unscrew light bulb
lightbulb_attach() #screw in light bulb



vehicle=connect_it(connection_string)    #Connect to Pixhawk via Pi
Get_Parameters(vehicle)        #Get start up parameters of UAS
Arm_it(vehicle)        #arm the motors
time.sleep(3)
print(vehicle.armed)

		
######################################

target=LocationGlobalRelative(29.7063637,-95.4502891,desiredAlt)
takeoff(vehicle,desiredAlt)
time.sleep(3)

print("\ngoing to...\n")
vehicle.simple_goto(target,groundspeed=1)
time.sleep(15)

print("Auto_Yaw")
flag =Auto_Yaw(vehicle) #auto face UAS north

if flag ==1:
	print ("\nTarget Reached.\n")
    Precision_Loiter(vehicle,desiredSig) #loiter on top of signature

        Precision_Land(vehicle,desiredSig)
else:
Ejemplo n.º 2
0
parser.add_argument('--desiredAlt', help='set desired altitude')
parser.add_argument('--duration', help='set duration')
parser.add_argument('--connect',
                    help='set connection string i.e. 127.0.0.1:14550')

args = parser.parse_args()
desiredAlt = float(args.desiredAlt)
speed = float(args.speed)
duration = int(args.duration)
connection_string = args.connect

vehicle = connect_it(connection_string)  #Connect to Pixhawk via Pi
Get_Parameters(vehicle)  #Get start up parameters of UAS
Arm_it(vehicle)  #arm the motors
time.sleep(1)
'''
print'***************'
print'\n battery level:',vehicle.battery

print'DesiredAlt: ',desiredAlt
print'speed: ',speed
print'duration: ',duration

takeoff(vehicle,desiredAlt)

time.sleep(3)



#velocity_x, velocity_y, velocity_z, duration