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 Apr 7, 2020
1 parent 100b662 commit 4de892e
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 4de892e

Please sign in to comment.