Metadata-Version: 2.4
Name: rbq_sdk_py
Version: 1.0.1
Summary: RBQ robot SDK for Python (CycloneDDS-based pub/sub & RPC client for Rainbow Robotics quadruped)
Project-URL: Homepage, https://github.com/RainbowRobotics/RBQ
Project-URL: Repository, https://github.com/RainbowRobotics/RBQ
Author-email: Gurban <gurban@rainbow-robotics.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: cyclonedds,dds,quadruped,rainbow-robotics,rbq,robotics,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: cyclonedds==0.10.2
Requires-Dist: numpy
Requires-Dist: opencv-python
Provides-Extra: dev
Requires-Dist: build>=1; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: twine>=5; extra == 'dev'
Description-Content-Type: text/markdown

# rbq_sdk_python
Standalone Python interface for rbq_sdk

# Installation
## Dependencies
- Python >= 3.10 (cyclonedds 0.10.2 ships wheels only through CPython 3.10)
- cyclonedds == 0.10.2
- numpy
- opencv-python

### Installing from PyPI
```bash
pip install rbq_sdk_py
```

### Installing from source
Enter the rbq_sdk directory, and then install cyclonedds and rbq_sdk:
```bash
sudo bash scripts/build_dds.bash
sudo bash scripts/build.bash
```
Enter the rbq_sdk_python directory, and then install rbq_sdk_python.
```bash
sudo apt install python3-pip
pip3 install -e .
```

# Usage
The Python interface maintains consistency with the rbq_sdk interface, achieving robot status acquisition and control through request-response or topic subscription/publishing. Example programs are located in the `/example` directory.
## DDS Communication
In the terminal, execute:
```bash
python3 ./example/helloworld/publisher.py
```
Open a new terminal and execute:
```bash
python3 ./example/helloworld/subscriber.py
```
You will see the data output in the terminal. The data structure transmitted between `publisher.py` and `subscriber.py` is defined in `user_data.py`, and users can define the required data structure as needed.
## High-Level Status and Control
The high-level interface maintains consistency with rbq_sdk in terms of data structure and control methods.
### High-Level Status
Execute the following command in the terminal:
```bash
python3 ./example/high_level/read_highstate.py lo
```
Replace `lo` with the name of the network interface to which the robot is connected,.
### High-Level Control
Execute the following command in the terminal:
```bash
python3 ./example/high_level/sportmode_test.py lo
```
Replace `lo` with the name of the network interface to which the robot is connected. This example program provides several test methods, and you can choose the required tests as follows:
```python
test.StandUpDown() # Stand up and lie down
```
## Front Camera
Use OpenCV to obtain the front camera (ensure to run on a system with a graphical interface, and press ESC to exit the program):
```bash
python3 ./example/front_camera/camera_opencv.py lo
```
Replace `lo` with the name of the network interface to which the robot is connected.
