motorbridge C++ Bindings
For channel compatibility notes (PCAN, slcan, CAN-FD, Damiao serial bridge), see Channel Compatibility. RAII-style C++ wrapper on top ofmotor_abi.
Chinese version: reference.zh-CN.md
Damiao Set-Zero Rule (dm-serial)
- For Damiao, call
disable()beforeset_zero_position(). - Core guard rejects
set_zero_position()when motor is not disabled. - Core applies an internal fixed settle (
~20ms) afterset_zero_position(). - C++/ABI signatures are unchanged; this is behavior guard in core.
Controller Entrypoints
Controller(channel)(SocketCAN/PCAN path)Controller::from_socketcanfd(channel)(CAN-FD path, required by Hexfellow)Controller::from_dm_serial(serial_port, baud)(Damiao-only serial bridge)add_damiao_motor(motor_id, feedback_id, model)add_hexfellow_motor(motor_id, feedback_id, model)add_myactuator_motor(motor_id, feedback_id, model)add_robstride_motor(motor_id, feedback_id, model)add_hightorque_motor(motor_id, feedback_id, model)
Quick Start
Damiao:Example Programs
examples/cpp_wrapper_demo.cppexamples/hexfellow_canfd_demo.cpp(Hexfellow, CAN-FD, MIT / POS_VEL only)examples/robstride_wrapper_demo.cppexamples/full_modes_demo.cppexamples/pid_register_tune_demo.cppexamples/scan_ids_demo.cpp(Damiao legacy helper)examples/pos_ctrl_demo.cppexamples/pos_repl_demo.cpp
Experimental Windows Support (PCAN-USB)
Linux remains the primary target. Windows support is experimental and currently uses PEAK PCAN.- Install PEAK PCAN driver + PCAN-Basic runtime (
PCANBasic.dll). - Use
can0@1000000for channel/bitrate in Windows CLI validation.