Skip to content

Is there a way to control the drone with arrow keys to fly manually? #3544

Discussion options

You must be logged in to vote

Hi @jueunkwon , you could always use the C++ or Python APIs to write your own tool that would control the drone's velocities (as an example) on keypress.
Here's a crude example using python's keyboard library that I wrote a couple of months ago:

import airsim
import keyboard  # using module keyboard (install using pip3 install keyboard)
 
vx=0
vy=0
vz=0
 
client = airsim.MultirotorClient()
client.confirmConnection()
client.enableApiControl(True)
 
 
while True:  # making a loop
    try:  # used try so that if user pressed other than the given key error will not be shown
        if keyboard.is_pressed('w'):
            vx=5
        elif keyboard.is_pressed('s'):
            vx=-5
        else

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@thomasTUK
Comment options

@ahmed-elsaharti
Comment options

@jueunkwon
Comment options

Answer selected by jueunkwon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants