Documentation Index
Fetch the complete documentation index at: https://motorbridge.seeedstudio.com/llms.txt
Use this file to discover all available pages before exploring further.
Source:
docs/en/abi.mdABI Guide (motor_abi)
Build
- Linux:
target/release/libmotor_abi.so,libmotor_abi.a - Windows:
target/release/motor_abi.dll,motor_abi.lib - Header:
motor_abi/include/motor_abi.h
Unified Surface
The ABI keeps one unified control surface across vendors. Unified mode IDs (motor_handle_ensure_mode):
1 = MIT2 = POS_VEL3 = VEL4 = FORCE_POS
- position:
rad - velocity:
rad/s - torque:
Nm
motor_handle_enablemotor_handle_disablemotor_handle_clear_errormotor_handle_set_zero_positionmotor_handle_ensure_modemotor_handle_send_mitmotor_handle_send_pos_velmotor_handle_send_velmotor_handle_send_force_posmotor_handle_request_feedbackmotor_handle_set_can_timeout_msmotor_handle_store_parametersmotor_handle_get_state
Vendor Entry Points
- Damiao:
motor_controller_add_damiao_motor(...) - Hexfellow:
motor_controller_add_hexfellow_motor(...)(CAN-FD path viasocketcanfd) - RobStride:
motor_controller_add_robstride_motor(...) - MyActuator:
motor_controller_add_myactuator_motor(...) - HighTorque:
motor_controller_add_hightorque_motor(...)
Unified Mode to Native Protocol Mapping
| Unified mode | Damiao native | Hexfellow native | RobStride native | MyActuator native | HighTorque native |
|---|---|---|---|---|---|
MIT | Mit | mode 5 | Mit | not available | mapped to native pos+vel+tqe |
POS_VEL | PosVel | mode 1 | mapped to Position (run_mode=1, limit_spd=0x7017, loc_ref=0x7016) | Position setpoint flow | mapped to native pos+vel+tqe |
VEL | Vel | not available | Velocity | Velocity setpoint flow | mapped to native velocity command |
FORCE_POS | ForcePos | not available | not available | not available | mapped to native pos+vel+tqe |
- Unsupported calls return non-zero and a readable message via
motor_last_error_message(). - Signatures stay stable even when a vendor ignores part of a signature.
- Example: HighTorque accepts
send_mit(pos, vel, kp, kd, tau)for interface consistency, but native protocol does not usekp/kd. - Hexfellow ABI path supports MIT and POS_VEL, and reports
VEL/FORCE_POSas unsupported. - RobStride supports MIT / POS_VEL / VEL on unified APIs; torque/current remains parameter-level (
robstride_write_param_*), not a unified mode. - Damiao set-zero sequence rule: call
motor_handle_disablebeforemotor_handle_set_zero_position; otherwise set-zero is rejected by core guard. - Damiao set-zero settle rule: core applies an internal fixed settle (
~20ms) after successfulset_zero_position(no extra ABI parameter).
Vendor-Specific Extensions
Damiao register APIs:motor_handle_write_register_f32motor_handle_write_register_u32motor_handle_get_register_f32motor_handle_get_register_u32
motor_handle_robstride_pingmotor_handle_robstride_set_device_idmotor_handle_robstride_write_param_i8/u8/u16/u32/f32motor_handle_robstride_get_param_i8/u8/u16/u32/f32
Typical Call Flow
- Transport constructor:
motor_controller_new_socketcan(channel)(general path)motor_controller_new_dm_serial(serial_port, baud)(Damiao-only serial bridge; cross-platform, e.g./dev/ttyACM0orCOM3)
motor_controller_add_<vendor>_motor- optional:
motor_controller_enable_all - optional:
motor_handle_ensure_mode - send control commands / read state / vendor-specific operations
motor_controller_shutdownmotor_handle_freemotor_controller_free
Examples
- C ABI demo:
examples/c/c_abi_demo.c - C++ ABI demo:
examples/cpp/cpp_abi_demo.cpp - Python ctypes demo:
examples/python/python_ctypes_demo.py