2. Install the Python driver library

2.1. Declaration before installing driver libraries

The factory image system of the car has been installed with the latest driver library, so there is no need to repeat the installation. You need to install the driver library only if you use a different image from the factory or if the driver library has updated content.

The drive system at factory inventory put path: / root/sunriseRobot/SunriseRobotLib

For details about how to install the driver library, see the following steps.

2.2. Download the Python driver library

Visit the Yahboom official website and click [python Driver Library Download] in the RDK-X3-Robot data download area to download the latest version of SunriseRobotLib.zip file.

image-20210904173442954

image-20210904173442954

The zip pack contains the following files.

image-20230601121626735

2.3 Transfer files to the motherboard

If you use the system browser to download the file, please download the file to the user's operable path, such as the desktop.

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

The driver library file can be deleted after the installation.

image-20230601121954814

 

2.4. Start the installation

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

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

Unzip the file

image-20230601140310471

Note: The entire documentation routine is based on the example of the SunriseRobotLib.zip package on the system desktop. If you save the compressed package in different paths, go to the corresponding directory based on the actual path.

Enter the drive library folder

Run the installation command. If the installation version number is displayed, the installation is successful.This command will cover has been installed before SunriseRobotLib drive library.

image-20230601140502376

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

image-20230601142927957

 

2.5 Import the library file

RDK-X3-Robot The name of the robot driver library is SunriseRobotLib, and SunriseRobotLib is used in the program to import the library

 

2.6, Driver library use example

Source path: / root/sunriseRobot _basic/Samples / 1/1 _test_sunriserobot. Ipynb

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

Create the SunriseRobot object bot.

Displays the API interface for the SunriseRobotLib library.

Start to receive data, can only start once, all read data function is based on this function. All function interfaces that start with get depend on this function, and no get function can read data without running this function.

Read the version number.

Read the battery voltage value.

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

 

2.7. Introduction to API

The following driver library API introduction, in the later control course to introduce the function usage and parameter content.