forked from microsoft/AirSim
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathgimbal.py
More file actions
23 lines (19 loc) · 708 Bytes
/
Copy pathgimbal.py
File metadata and controls
23 lines (19 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import setup_path
import airsim
import time
# connect to the AirSim simulator
client = airsim.MultirotorClient()
client.confirmConnection()
client.enableApiControl(True)
client.armDisarm(True)
# MultirotorClient.wait_key('Press any key to takeoff')
print("Taking off")
client.takeoffAsync().join()
print("Ready")
for i in range(5):
client.moveToPositionAsync(float(-50.00), float( 50.26), float( -20.58), float( 3.5))
time.sleep(6)
client.simSetCameraOrientation("0", airsim.to_quaternion(0.5, 0.5, 0.1))
client.moveToPositionAsync(float(50.00), float( -50.26), float( -10.58), float( 3.5))
time.sleep(6)
client.simSetCameraOrientation("0", airsim.to_quaternion(-0.5, -0.5, -0.1))