Skip to main content

Using the Raspberry Pi Development Kit

Introduction

The PSDK developer kit is used to convert the UAV’s interfaces into various standard hardware interfaces, making it easier for developers to connect hardware devices and perform SDK development and debugging. The PSDK developer kit supports various UAV models and compatible airframe interfaces.

This example will use the Autel Alpha UAV, the PSDK developer kit, and the RPI (Raspberry Pi) 4B developer kit to demonstrate a series of development steps, including hardware connections, software environment setup, obtaining the development package, and compiling and running the software, to help you quickly get started with Payload SDK (hereafter referred to as PSDK) development.

Hardware Environment Preparation

1. Prepare Hardware Devices

HardwareQuantityPurpose
Raspberry Pi 4B Development Kit1Runtime platform for PSDK
HD Monitor (with HDMI interface)1Used to display the Ubuntu system interface on the board
Keyboard + Mouse1Human-machine interaction for the Ubuntu system on the board
PSDK Developer Kit1Provides standard hardware interfaces
Ethernet Cable1Used to connect the board to access network resources
Autel Alpha UAV + Accessories (RC + Battery + Payload + Charging Box)1Application development hardware platform

2. Hardware Connection

  1. Prepare an HD monitor, a set of keyboard and mouse, and a spacious desktop environment.
  2. Prepare an Autel Alpha UAV setup, and place the UAV on the desktop in a suitable position after installing the battery.
  3. Use coaxial cables or ribbon cables to connect the gimbal adapter ring to the PSDK adapter board.

图. 树莓派开发板

  1. Use an Ethernet cable to connect the PSDK adapter board to the Raspberry Pi development board.
  2. Power on the Raspberry Pi development board, connect the micro HDMI display output to the HD monitor, and plug the keyboard and mouse into the USB ports of the Raspberry Pi development board.
  3. Power on the UAV, turn on the power switch on the PSDK development board, and check if the power indicator light turns on. If it lights up, it indicates normal power supply.
  4. Observe the monitor and confirm if the Raspberry Pi development board enters the startup page.

Software Environment Setup

1. Install the Software Environment

  1. The Raspberry Pi 4B development kit does not include an SD card or a Raspberry Pi OS 64-bit system image by default. Please refer to the Raspberry Pi flashing guide to burn the image and configure the account. It is recommended to install a version of Ubuntu that supports the Raspberry Pi 4B development kit.
  2. After completing the hardware setup and booting up, enter the username and password you configured to check whether you can log in to the Raspberry Pi desktop system.

2. Register a PSDK Developer Account

You can register and apply to become a PSDK developer on the Autel Robotics Developer Platform.

3. Download the PSDK Software Package

Obtain the latest PSDK development package from the PSDK repository. The latest code is located on the master branch.

4. Modify Required Code

After creating an application in the developer center, you will receive the PSDK application information. You must fill this information into a designated file in the previously downloaded PSDK development package; otherwise, PSDK will not run properly.

  • example/uav_sdk_app_info.h
#define USER_APP_NAME           "your_app_name"
#define USER_APP_ID "your_app_id"
#define USER_APP_KEY "your_app_key"
#define USER_APP_LICENSE "your_app_license"
#define USER_DEVELOPER_ACCOUNT "your_account"
#define USER_BAUDRATE_RATE "460800"

5. Compilation and Execution

Generate the corresponding Linux version of the PSDK software package and execute the binary file.

FeatureFile NameDescription
Custom Widgetscustom_widget.cxxDescribes the initialization of custom widgets, how to set the configuration file path, and how to register callback functions.
Low-Speed Data Channeldata_channel.cxxDescribes the initialization and data transmission method of the low-speed channel.
High-Speed Data Channelhigh_speed_channel.cxxDescribes the initialization and data transmission method of the high-speed channel.
Standard Gimbal Payloadgimbal.cxxDescribes the initialization of the standard gimbal payload, basic function test methods, and how to register callback functions.
Standard Camera Payloadpayload_camera.cxxDescribes the initialization of the standard camera payload, basic function test methods, and how to register callback functions.
Precision Positioningpositioning.cxxDescribes the initialization of precision positioning, time synchronization methods, and how to obtain position information.
High-Frequency Messagessubscribe.cxxDescribes how to subscribe to high-frequency messages.
Tracertracer_example.cxxDescribes the initialization of Tracer and how to register basic function callback functions.