Skip to content

Python SDK Configuration

Windows

Runtime Environment Setup

1. Install Python

Install Python (compatible version: Python 3.7-Python 3.10, recommended version: Python 3.7.9). Download it from the following URL:

https://www.python.org/downloads/windows/

2. Upgrade pip

Go to PowerShell or Command Prompt and run the following command.

python.exe -m pip install --upgrade pip

3. Install NumPy and OpenCV-Python

Install NumPy:

pip3 install numpy

If the installation reports an error, run:

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy

Install OpenCV-Python:

pip3 install opencv-python

If the installation reports an error, run:

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python

If the installation continues to report errors, run:

pip3 install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.com 

Running the Examples

1. Install the PyRVC module

Go to PowerShell or Command Prompt and run the following command.

pip3 install PyRVC

2. Run the Python example

Once installed, the Python examples can be invoked.

Use the cd command, switch to the examples folder in the RVC SDK installation directory, using the CaptureGigE.py as an example: python . \CaptureGigE.py

When the program is finished, the captured point cloud and images will be saved in the Data folder under the current execution path.nst

Linux

Runtime Environment Setup

1. Install CMake

Open a Terminal window and run the following command.

sudo apt-get install cmake make

2. Install Python

sudo apt-get install python3 python3-pip

3. Install NumPy and OpenCV-Python

Install NumPy:

python3 -m pip install numpy

Install OpenCV-Python:

python3 -m pip install opencv-python

Running the Examples

1. Install the PyRVC module

Open a Terminal window and run the following command.

python3 -m pip install /opt/RVC/PyRVC/

When you are not connected to the Internet, you can execute the following command to generate a .whl file locally for installation.

cd /opt/RVC/PyRVC
python3 setup.py bdist_wheel

Before installation, you can check the name of the .whl file under the generated dist folder, then change the file name in the pip3 command.

cd dist
pip3 install ./PyRVC-1.11.0-cp37-cp37m-linux_x86_64.whl

2. Run the Python example

Use the cd command, switch to the directory where the Python example is located, and then you can call the example.

For example, to run the AdjustCaptureParameter.py example, enter the following command.

cd /opt/RVC/examples/Python
python3 ./AdjustCaptureParameter.py

After the example finishes running, the captured point cloud and images are saved in the Data folder of the current execution path by default.