Skip to content

Configuration

Lupin3000 edited this page Mar 29, 2025 · 8 revisions

This Python solution uses 2 different libraries to communicate with the controllers.

  • macOS: hidapi
  • Linux: evdev

Therefore the controllers are configured differently for both systems!

Controller configuration

In the config folder you will find examples of predefined controllers. However, you can change/adjust existing configurations and add new ones.

hidapi template

[Identification]
vendor = <int>
product = <int>

# Max value from report buffer
report_length = <int>

[Buttons]
# Button assignment
btn_byte_index = <int>
btn_takeoff_value = <int>
btn_landing_value = <int>
btn_photo_value = <int>

[AnalogSticks]
# Analog stick assignment
analog_middle_value = <int>
analog_threshold_value = <int>
analog_left_x_index = <int>
analog_left_y_index = <int>
analog_right_x_index = <int>
analog_right_y_index = <int>

evdev template

[Identification]
name = <str>

[Buttons]
# Button assignment
btn_takeoff_value = <int>
btn_landing_value = <int>
btn_photo_value = <int>

[AnalogSticks]
# Analog stick assignment
analog_middle_value = <int>
analog_threshold_value = <int>
analog_left_x_index = <str>
analog_left_y_index = <str>
analog_right_x_index = <str>
analog_right_y_index = <str>

Constants

Inside file main.py you can modify following constants:

  • CONTROLLER_CONFIG: name of configuration file inside directory config/ (which controller you use to fly).
  • SPEED: integer value between 1 and 100 (the higher the value, the faster the drone flies).
  • STREAM: True to fly with HUD (video stream on) or False for no HUD (video stream off).
  • WINDOW_NAME: Title of HUD (video stream) window.

You should not change the values of the constants DELAY and SHUTDOWN. This can cause problems if you don't know 100% what you are changing.

Clone this wiki locally