API: motorbridge-cli
Installation
The CLI is installed automatically with the Python package:Global Options
| Option | Description |
|---|---|
--help | Show help message and exit |
--version | Show version and exit |
Commands Overview
| Command | Description |
|---|---|
run | Send control commands to a motor |
scan | Scan CAN bus for active motors |
id-dump | Read Damiao ID/mode registers |
id-set | Write Damiao ID registers |
robstride-read-param | Read RobStride parameter |
robstride-write-param | Write RobStride parameter |
run
Run motor control commands in a loop.Usage
Options
| Option | Default | Description |
|---|---|---|
--vendor | damiao | Motor vendor: damiao, myactuator, robstride, hightorque, hexfellow |
--channel | can0 | CAN interface name |
--transport | auto | Transport: auto, socketcan, socketcanfd, dm-serial |
--serial-port | /dev/ttyACM0 | Serial port (for dm-serial transport) |
--serial-baud | 921600 | Serial baud rate |
--model | 4340 | Motor model string |
--motor-id | 0x01 | Motor CAN ID (hex supported) |
--feedback-id | 0x11 | Feedback CAN ID (hex supported) |
--mode | mit | Control mode: enable, disable, mit, pos-vel, vel, force-pos, ping |
--loop | 100 | Number of control iterations |
--dt-ms | 20 | Control period in milliseconds |
--ensure-mode | 1 | Whether to ensure mode before control |
--ensure-strict | 0 | Fail if mode switch fails |
--ensure-timeout-ms | 1000 | Mode switch timeout |
--print-state | 1 | Print state each iteration |
--pos | 0.0 | Target position (rad) |
--vel | 0.0 | Target velocity (rad/s) |
--kp | 30.0 | Position stiffness (MIT mode) |
--kd | 1.0 | Velocity damping (MIT mode) |
--tau | 0.0 | Feedforward torque (Nm) |
--vlim | 1.0 | Velocity limit (rad/s) |
--ratio | 0.3 | Force ratio (force-pos mode) |
Examples
Enable Motor Only
Disable Motor
MIT Mode Control
Position-Velocity Mode
RobStride Motor
Using Serial Transport
scan
Scan CAN bus for active motors.Usage
Options
| Option | Default | Description |
|---|---|---|
--vendor | damiao | Vendor to scan: damiao, myactuator, robstride, hightorque, hexfellow, all |
--channel | can0 | CAN interface |
--transport | auto | Transport type |
--serial-port | /dev/ttyACM0 | Serial port |
--serial-baud | 921600 | Serial baud rate |
--model | 4340 | Motor model |
--start-id | 0x01 | Start ID for scan |
--end-id | 0x10 | End ID for scan |
--feedback-ids | 0xFF,0xFE,0x00,0xAA | RobStride feedback IDs to try |
--feedback-base | 0x10 | Damiao feedback ID base |
--timeout-ms | 80 | Per-ID timeout |
--param-id | 0x7019 | RobStride parameter ID for probe |
--param-timeout-ms | 120 | RobStride parameter timeout |
Examples
Scan All Vendors
Scan Damiao Only
Scan RobStride
Scan MyActuator
Scan via Serial
Output Format
id-dump
Read key ID and configuration registers from Damiao motors.Usage
Options
| Option | Default | Description |
|---|---|---|
--vendor | damiao | Must be damiao |
--channel | can0 | CAN interface |
--transport | auto | Transport type |
--model | 4340 | Motor model |
--motor-id | 0x01 | Motor ID |
--feedback-id | 0x11 | Feedback ID |
--timeout-ms | 500 | Register read timeout |
--rids | 7,8,9,10,21,22,23 | Register IDs to read |
Register IDs
| RID | Name | Description |
|---|---|---|
| 7 | MST_ID | Feedback ID |
| 8 | ESC_ID | Motor ID |
| 9 | TIMEOUT | Communication timeout |
| 10 | CTRL_MODE | Control mode |
| 21 | PMAX | Position mapping range |
| 22 | VMAX | Velocity mapping range |
| 23 | TMAX | Torque mapping range |
Example
Output
id-set
Write ID registers to Damiao motors and optionally store to flash.Usage
Options
| Option | Default | Description |
|---|---|---|
--vendor | damiao | Must be damiao |
--channel | can0 | CAN interface |
--transport | auto | Transport type |
--model | 4340 | Motor model |
--motor-id | 0x01 | Current motor ID |
--feedback-id | 0x11 | Current feedback ID |
--new-motor-id | (same) | New motor ID to set |
--new-feedback-id | (same) | New feedback ID to set |
--store | 1 | Store to flash after write |
--verify | 1 | Verify after write |
--timeout-ms | 800 | Verify timeout |
Example
Output
robstride-read-param
Read a parameter from RobStride motor.Usage
Options
| Option | Default | Description |
|---|---|---|
--channel | can0 | CAN interface |
--model | rs-00 | Motor model |
--motor-id | 127 | Motor ID |
--param-id | (required) | Parameter ID to read |
--type | (required) | Data type: i8, u8, u16, u32, f32 |
--timeout-ms | 500 | Read timeout |
Example
Output
robstride-write-param
Write a parameter to RobStride motor.Usage
Options
| Option | Default | Description |
|---|---|---|
--channel | can0 | CAN interface |
--model | rs-00 | Motor model |
--motor-id | 127 | Motor ID |
--param-id | (required) | Parameter ID to write |
--type | (required) | Data type: i8, u8, u16, u32, f32 |
--value | (required) | Value to write |
--verify | 1 | Read back and verify |
--timeout-ms | 500 | Verify timeout |
Example
Output
Common Workflows
Initial Setup
Changing Motor ID
RobStride Parameter Tuning
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
See Also
- Quickstart - Getting started guide
- Tutorials - Step-by-step tutorials
- API Reference - Python API documentation