rebot_control.backends.robstride¶
Real arm: RobStride motors over SocketCAN through motorbridge (pip install rebot-control[real]).
Notes on motorbridge and the RobStride motors (verified on the B601-RS):
motorbridge updates a RobStride motor’s state only from the reply to a command;
request_feedback()is a no-op for RobStride and the motors’ periodic active-report frames are not parsed. So feedback always comes from replies: the servo thread sends a frame to every motor every tick (zero-gain frames when torque is off), and reads the replies of the previous tick (poll_feedback_once+get_state).Disabled motors still answer MIT frames (within ~3 ms) and stay disabled.
The SocketCAN interface comes up DOWN after a reboot or a re-plug unless a systemd unit brings it up;
check_can_up()fails early with the command to fix it.
Holding through a dead program (docs/user/safety.md): with the drivers’ CAN timeout at 0 (the value found on
the B601-RS), an enabled motor keeps executing the last MIT frame it received for as long as it has power. The
library relies on this to keep the arm where it is when a program ends abnormally, and never sends a zero-gain
frame to a motor that may be enabled:
RobStrideBackend.read_positions()reads the angles through parameter reads, which do not replace the MIT frame a motor is executing;the feedback frames carry the driver’s mode;
RobStrideBackend.read()reports it asJointState.enabled;RobStrideBackend.close()withdisable=Falsereleases the bus without sending anything.
One program at a time: two programs streaming frames to the same motors fight over them (each replaces the other’s
frame 150 times a second). RobStrideBackend.connect() therefore takes an exclusive lock per CAN channel
(flock on a file in the temp directory). The operating system drops it when the process ends, however it ends.
Module Contents¶
Classes¶
Functions¶
Raise with a clear hint when the SocketCAN interface is missing or DOWN. Non-Linux hosts are not checked. |
Data¶
API¶
- rebot_control.backends.robstride.log = 'getLogger(...)'¶
- rebot_control.backends.robstride.PARAM_MECH_POS = 28697¶
- rebot_control.backends.robstride.PARAM_CAN_TIMEOUT = 28712¶
- rebot_control.backends.robstride.check_can_up(port: str = 'can0', sysfs: str = '/sys/class/net') None¶
Raise with a clear hint when the SocketCAN interface is missing or DOWN. Non-Linux hosts are not checked.
- class rebot_control.backends.robstride.RobStrideBackend(cfg: rebot_control.config.ArmConfig)¶
Bases:
rebot_control.backends.base.Backend- is_sim = False¶
- connect() None¶
- read_positions() numpy.ndarray¶
- enable() None¶
- disable() None¶
- close(disable: bool = True) None¶
- send_mit(q, dq, kp, kd, tau) None¶
- now() float¶
- set_zero(joints: list[int]) None¶
Store the current position as zero (same as Motorbridge Studio). Torque must be off; the arm must be in the zero pose. Overwrites the zero stored in the motors.