Install Python driver library

2.1. Statement before installing the driver library

The factory image system of the robot has already installed the latest driver library, so there is no need to install it again. If you are not using the factory image, or the driver library has updated content, you need to install the driver library.

The storage path of the driver library that comes with the factory system: /home/sunrise/sunriseRobot/SunriseRobotLib

Please refer to the following steps to install the driver library.

2.2. Download the Python driver library file

Visit the Yahboom official website and click [python driver library download] in the RDK-X5-Robot data download area to download the latest version of SunriseRobotLib.zip file.

image-20210904173442954-min

The compressed package contains the following files:

image-20230601121626735

2.3. Transfer files to the motherboard

If you use the system's built-in browser to download files from the Yabo Smart official website, please download the files to a user-operable path, such as the desktop.

If you use the driver library compressed package file in the data, or download the driver library file using a computer browser, you can use WinSCP software to drag the driver library compressed package file to the system desktop.

After successful installation, the driver library file can be deleted.

2.4. Start installation

Open the system terminal and enter the following command to decompress.

Go to the desktop and check if the file exists. The target file is in the red box.

Unzip the file

Note: If you store the compressed package in a different path, please enter the corresponding directory according to the actual path.

Enter the driver library folder

Run the installation command. If you see the installation version number at the end, it means the installation is successful. This command will overwrite the previously installed SunriseRobotLib driver library.

Run the query command. If the version number of SunriseRobotLib is printed, the installation is complete.

2.5. Import library files

The name of the RDK-X5-Robot robot driver library is SunriseRobotLib. Use SunriseRobotLib to import the library in the program.

2.6. Driver library usage example

Source code path: /home/sunrise/sunriseRobot/Samples/1_Basic/1_test_sunriseRobot.ipynb

Open jupyterlab, find and run the program to see the effect.

Create the SunriseRobot object bot.

Show the API interface of SunriseRobotLib library.

Start receiving data. It can only be started once. All functions that read data are based on this function. All function interfaces starting with get depend on this function. If this function is not run, all get functions cannot read data.

Read the version number.

Read the battery voltage value.

Please delete the object after the program ends to avoid conflicts caused by using the SunriseRobot library in other programs.

2.7, API Introduction

The following is an introduction to the API of the driver library. The function usage and parameter content will be introduced in the control course later.