Skip to content

Instantly share code, notes, and snippets.

@Dhulkarnayn
Created August 19, 2021 14:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Dhulkarnayn/a33bf54cf2d224f9de6bff5303e39e46 to your computer and use it in GitHub Desktop.
"""
Simple Program which gets ARM/DISARM command from the user and
ARM or DISARM the vehicle based on inputs entered
Inputs:
1. ARM - Arm all the motors of the drone
2. DISARM - Disarm all the motors of the drone
"""
# Importing necessary Packages
from dronekit import connect, VehicleMode
# Connecting the Vehicle
vehicle = connect('udpin:127.0.0.1:14551', baud=115200)
# Initially Changing the Vehicle to GUIDED mode
vehicle.mode = VehicleMode("GUIDED")
while True:
armCommand = input()
if armCommand == "ARM":
vehicle.armed = True
if armCommand == "DISARM":
vehicle.armed = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment