Please tell me how to control rpi4 and navi02 drone through keyboard

Before creating a new thread please refer to the documentation for Navio2 and Navio+.

In case you are creating a thread about an issue please specify the appropriate sub-category first!

Hello professors, I connected RPI4 and Navio2 to ardupilot UDP. I want to connect with the keyboard of the laptop and control the drone with the keyboard, not with the wireless controller. Currently, using drone simulator, mavproxy, and Python script functions, we have completed controlling virtual drones with a keyboard. But I don’t know how to control the drone with the keyboard when I connect it with the mission planner with udp. Please help me, if you have any function or reference documents, please help me.

Before creating a new thread please refer to the documentation for Navio2 and Navio+.

In case you are creating a thread about an issue please specify the appropriate sub-category first!

Hello, professors.
When I run Python grammar, the error appears like the picture.

The Python file is the same as the attachment below.
The contents of the error message are as shown in the picture.

Navio2 Raspberry pi4 is controlled through the keyboard.
We need to communicate via udp or tcp, but it’s connected by udp.


The goal is to compile and execute the keyboard control function on Raspberry Pi 4, and control it with the keyboard through the mission planner.

What should I do to catch an error like the picture? Please help me.

how_do_drones_work/02_control_with_arrow_keys.py at master · tizianofiorenzani/how_do_drones_work · GitHub <---- python funtion

Hi @jskang3456,

Sorry for keeping you silent for all this time!

We don’t have a ready solution for your task, and hardly can be of much help with your script specifics.

The only thing I can recommend is to take a look at Navio2 examples on Python and C++, ArduPilot docs on Joystick/Gamepad connection, and ArduPilot source code. Even if these sources wouldn’t give you a ready solution, they can provide some hints on what you trying to implement.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.