-
-
Save Dhulkarnayn/a33bf54cf2d224f9de6bff5303e39e46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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