Skip to content

Commit

Permalink
Add example Python script for spawn vehicle through API
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed Jan 19, 2020
1 parent 4cdd4dc commit 9cde560
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions PythonClient/multirotor/add_drone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import setup_path
import airsim

# connect to the AirSim simulator
client = airsim.MultirotorClient()
client.confirmConnection()

# add new vehicle
vehicle_name = "Drone2"
client.simAddVehicle(vehicle_name, "simpleflight", "", 0, 0, 0)
client.enableApiControl(True, vehicle_name)
client.armDisarm(True, vehicle_name)
client.takeoffAsync(10.0, vehicle_name)

0 comments on commit 9cde560

Please sign in to comment.