46 lines
1012 B
Markdown
46 lines
1012 B
Markdown
# fast_lowcmd_cpp
|
|
|
|
Native CPython extension for the Go1 PRO LowCmd hot path.
|
|
|
|
It keeps the implementation separate from the main `go1_pro_sdk` package until
|
|
the robot-side timing and byte-equivalence checks are stable.
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cd /root/go1_pro_sdk/fast_lowcmd_cpp
|
|
PYTHONPATH=/root/go1_pro_sdk python3 setup.py build_ext --inplace
|
|
```
|
|
|
|
On the Mac conda environment:
|
|
|
|
```bash
|
|
cd /Users/chenyouyuan/cyy_ws/go1_pro_sdk/fast_lowcmd_cpp
|
|
PYTHONPATH=/Users/chenyouyuan/cyy_ws/go1_pro_sdk conda run -n free_dog_sdk python setup.py build_ext --inplace
|
|
```
|
|
|
|
## Test
|
|
|
|
```bash
|
|
PYTHONPATH=.:.. python3 -m pytest test_fast_lowcmd.py
|
|
```
|
|
|
|
## Benchmark
|
|
|
|
```bash
|
|
PYTHONPATH=.:.. python3 benchmark_fast_lowcmd.py
|
|
```
|
|
|
|
## API
|
|
|
|
```python
|
|
from fast_lowcmd import FastLowCmdBuilder
|
|
|
|
builder = FastLowCmdBuilder()
|
|
packet = builder.build_encrypted_servo12(q, kp=28.0, kd=0.7)
|
|
damping_packet = builder.build_encrypted_damping()
|
|
```
|
|
|
|
The generated bytes are expected to match the Python SDK exactly for the tested
|
|
packet forms.
|