Skip to content

Software

robstride_ros2

From github.com/s2015-turtle/robstride_ros2 (opens in a new tab)

  • Robot arms and industry
  • Driver or SDK
  • MIT

A ros2_control hardware component that drives RobStride actuators over CAN using RobStride's private protocol, with position, velocity and effort command modes.

Facts

GitHub stars
4read on 29 Nov 2026
Last update
4 Nov 2026Newest commit on main
Maintenance
Activea commit in the last 90 days
Difficulty
Intermediate
Hardware it needs, as the project states it
CAN interface at 1 Mbit/s with extended frames, and a RobStride actuator configured for the private protocol.

Checked on GitHub on 29 Nov 2026.

Licenses

Code
MIT (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (MIT) at commit 037be9f (opens in a new tab), on 6 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Provides one ros2_control SystemInterface that controls several RobStride actuators sharing one CAN bus.
  • Offers position, velocity and effort command interfaces, and different joints can use different modes at the same time.
  • Includes model profiles for RS00 through RS06 and EL05, with custom limits also supported.
  • Reports motor position, velocity, torque, temperature and fault flags, and checks for feedback timeouts.
  • Confirms motor enable at startup, recovers motors that leave Run mode, and sends stop commands on shutdown.
  • Publishes CAN traffic and per-motor diagnostics on /diagnostics.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
MIT. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Active, last commit on 4 Nov 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 037be9f

Robotheca read the repository at two versions: the summary at 47fa26d and the facts and the README at 037be9f (read on 29 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by @s2015-turtle, at commit 037be9f, under MIT (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

robstride_ros2

An unofficial, community-maintained ROS 2 ros2_control hardware component for RobStride actuators using the RobStride private CAN protocol. CAN frames are exchanged through can_msgs/msg/Frame topics. The core packages depend on can_msgs and do not require a specific SocketCAN bridge.

This project is not affiliated with or endorsed by RobStride. The protocol and model profiles were checked against the English manuals in RobStride's official Product_Information (opens in a new tab) repository. A Japanese README is available as doc/README.ja.md (opens in a new tab).

Features
  • One ros2_control SystemInterface for multiple actuators on one CAN bus
  • Position, velocity, and effort command interfaces for every joint
  • Different command modes for different motors at the same time
  • Model profiles for RS00, RS01, RS02, RS03, RS04, RS05, RS06, and EL05
  • Motor feedback for position, velocity, torque, temperature, and faults
  • Startup parameter readback and motor-enable confirmation
  • Feedback timeout handling and repeated stop commands during shutdown
  • Persistent transmit failure propagation to the ros2_control lifecycle
  • A nonzero motor-side CAN watchdog configured on every activation
  • CAN traffic, command-coalescing, and per-motor feedback diagnostics
Upgrading from 0.2.x to 0.3.0

Out-of-range commands now fail the complete multi-joint command batch instead of being clamped. Correct the command and reactivate the hardware/controller; position activation also requires fresh feedback within the operational limits.

The example now enables set_zero_on_activate, redefining mechanical zero at each hardware activation. The driver's default remains false. Review this setting before using the example on a robot with an existing calibrated reference. The plugin identifier and automatic Run-mode recovery policy are unchanged. See the changelog (opens in a new tab) for the full changes and remaining limitations.

Package structure

The repository contains four ROS 2 packages:

PackageResponsibility
robstride_driverPrivate protocol and can_msgs topic transport
robstride_ros2_controlros2_control Hardware Component
robstride_examplesController configuration and example launch
robstride_ros2Installs the complete set of packages

The plugin identifier robstride_ros2/RobStrideSystem remains compatible with existing robot descriptions.

CAN bridge compatibility

robstride_driver and robstride_ros2_control communicate only through can_msgs/msg/Frame topics. They can be used with any CAN bridge that provides compatible transmit and receive topics.

robstride_examples is the only package that directly depends on ros2_socketcan (opens in a new tab), because its example launch starts that bridge. The aggregate robstride_ros2 package installs the examples as well. To install only the bridge-independent Hardware Component and driver, build through robstride_ros2_control:

colcon build --packages-up-to robstride_ros2_control --symlink-install
Supported ROS 2 distributions

The same source branch targets all currently supported ROS 2 distributions. CI is configured to build and test every row independently with its Tier 1 Ubuntu platform.

ROS 2 distributionUbuntu
Humble22.04 (Jammy)
Jazzy24.04 (Noble)
Kilted24.04 (Noble)
Lyrical26.04 (Resolute)
Rolling26.04 (Resolute)

No distribution-specific source branch is required.

Rolling follows current upstream development and can introduce incompatible API changes before the next stable ROS 2 release. The Rolling CI job is the compatibility signal for the exact source revision being tested.

Protocol and firmware assumptions

This package uses the 29-bit extended-frame private protocol documented in the official RobStride manuals. The motor must therefore be configured for the private protocol, not CANopen or the separate 11-bit MIT protocol. The listed EL05 and RS-series profiles use the common command and feedback formats defined in those manuals.

The profile limits below are the ranges used to encode and decode CAN values, not recommended mechanical operating limits. Apply tighter joint, velocity, and effort limits in your robot description when required.

ModelPositionVelocityTorqueKpKd
RS00+/-4 pi rad+/-33 rad/s+/-14 Nm0..5000..5
RS01+/-4 pi rad+/-44 rad/s+/-17 Nm0..5000..5
RS02+/-4 pi rad+/-44 rad/s+/-17 Nm0..5000..5
RS03+/-4 pi rad+/-20 rad/s+/-60 Nm0..50000..100
RS04+/-4 pi rad+/-15 rad/s+/-120 Nm0..50000..100
RS05+/-4 pi rad+/-50 rad/s+/-5.5 Nm0..5000..5
RS06+/-4 pi rad+/-50 rad/s+/-36 Nm0..50000..100
EL05+/-4 pi rad+/-50 rad/s+/-6 Nm0..5000..5
Installation

Install the package in the src directory of a workspace for one of the supported distributions, then resolve dependencies and build it:

rosdep update
rosdep install --from-paths src --ignore-src -r -y
colcon build --packages-up-to robstride_ros2 --symlink-install
source install/setup.bash

Bring up the SocketCAN interface before launching the example. RobStride's private protocol uses 1 Mbit/s CAN and extended frames:

sudo ip link set can0 down 2>/dev/null || true
sudo ip link set can0 type can bitrate 1000000 restart-ms 100
sudo ip link set can0 up
Example launch

The example uses motor CAN ID 1 with the EL05 profile and starts the position controller. The canonical package is robstride_examples:

ros2 launch robstride_examples robstride_example.launch.py interface:=can0

Inspect the loaded hardware and feedback:

ros2 control list_controllers
ros2 control list_hardware_interfaces
ros2 topic echo /joint_states

Send a position command in radians:

ros2 topic pub --rate 20 \
  /robstride_position_controller/commands \
  std_msgs/msg/Float64MultiArray "{data: [0.2]}"
Hardware parameters

Place these parameters inside the <hardware> element of the ros2_control description.

ParameterDefaultDescription
host_can_id253Host CAN ID in the range 0..255
can_tx_topicto_can_busOutgoing can_msgs/msg/Frame topic
can_rx_topicfrom_can_busIncoming can_msgs/msg/Frame topic
can_rx_qos_depth32Reliable, volatile feedback QoS depth (1–4096); increase for large motor groups
feedback_timeout_ms3000Maximum time without motor feedback before returning ERROR
fail_on_feedback_timeouttrueStop the hardware when feedback times out
transmit_failure_timeout_ms1000Grace period before a missing transmit endpoint or stalled sender returns ERROR
run_mode_recovery_timeout_ms500Time allowed for an active motor to recover to Run mode before returning ERROR
run_mode_recovery_retry_interval_ms100Minimum interval between automatic enable retries
clear_faults_on_activatetrueClear motor faults during activation
set_zero_on_activatefalseSet the current motor position as mechanical zero
shutdown_stop_repetitions3Number of zero and stop commands sent at shutdown
shutdown_stop_interval_ms20Delay between repeated shutdown frames
shutdown_confirmation_timeout_ms300Wait for Reset mode feedback; 0 disables confirmation
startup_connection_timeout_ms3000Wait for the CAN bridge topic endpoints
startup_confirmation_timeout_ms500Per-attempt parameter and enable confirmation timeout
startup_retries3Number of startup parameter and enable attempts

While active, the hardware monitors each motor's operating state. If a motor unexpectedly leaves Run mode, the component logs a warning and attempts to enable it again. Commands resume after Run mode is confirmed. If recovery does not complete within run_mode_recovery_timeout_ms, the hardware reports an error and stops all motors.

The transmit path is also monitored while the hardware is active. A temporary loss of the CAN bridge's transmit topic endpoint produces a throttled warning. If the endpoint remains unavailable, or the transmit worker makes no progress, for transmit_failure_timeout_ms, write() returns ERROR to ros2_control. An unexpectedly stopped transmit worker returns ERROR immediately.

Minimal example using the default settings:

<hardware>
  <plugin>robstride_ros2/RobStrideSystem</plugin>
</hardware>
Joint parameters

Each <joint> requires its own motor settings.

ParameterDefaultDescription
can_idrequiredUnique motor CAN ID in the range 1..255
can_timeout_ticksrequiredNonzero motor-side CAN watchdog; 20,000 ticks equals 1 second
modelcustomKnown model name or custom (explicit numeric limits)
position_min/maxrequired for customCAN encoding range in radians
velocity_min/maxrequired for customCAN encoding range in rad/s
effort_min/maxrequired for customMotor-side effort command limits in Nm
effort_wire_min/maxeffort limitsMotor-side CAN encoding range in Nm
kp_max / kd_maxrequired for customGain encoding limits
kp / kdrequiredGains used for position and velocity command interfaces
direction1Joint direction; either 1 or -1
gear_ratio1.0Additional protocol-side rotations per ROS joint rotation
position_offset0.0ROS joint position offset in radians
command_position_min/maxfull position rangeOperational position-command limits in ROS joint radians
command_velocity_min/maxfull velocity rangeOperational velocity-command limits in ROS joint rad/s
command_effort_min/maxderived from effort limitsOperational effort-command limits in ROS joint Nm

gear_ratio is an additional transmission transform for the surrounding robot. It is not the actuator's built-in reduction ratio. Leave it at 1.0 when the private-protocol angle already represents the actuator output used as the ROS joint position.

Effort follows the same ideal transmission convention: motor command effort is ROS joint effort divided by gear_ratio, and ROS joint feedback effort is motor feedback effort multiplied by gear_ratio. direction is applied to both directions of the conversion. Transmission efficiency is not modeled.

Numeric parameters must contain a complete, finite value; trailing text and embedded whitespace are rejected. Surrounding whitespace and a leading + are accepted. Integer parameters reject a minus sign, including -0. CAN IDs and can_timeout_ticks retain decimal, 0x hexadecimal, and leading-zero octal notation; other integer parameters are decimal. Timeouts and retry counts are limited to 2147483647; only the shutdown interval and shutdown confirmation timeout permit zero. can_timeout_ticks must be 1–4294967295.

The optional command_* limits let a robot use a narrower operating envelope without changing the motor model's CAN encoding ranges. They are expressed in ROS joint coordinates. Configuration fails if a limit is non-finite, reversed, or falls outside the corresponding CAN range after applying direction, gear_ratio, and position_offset. Velocity and effort ranges (both operational limits and CAN ranges) must include zero so neutral commands remain within the configured limits. Zero may be either boundary. Position ranges do not have this requirement.

Position control activation requires recent, finite position feedback inside command_position_min/max. This is checked both when preparing and when applying the mode switch; a rejected switch leaves the previous mode unchanged. The initial position target is the latest measured position, not a limit boundary. The feedback must be newer than feedback_timeout_ms even if fail_on_feedback_timeout is disabled. Position transforms use the same strict joint-coordinate boundary checks during configuration, mode activation and command submission. A forward-transform boundary overshoot may be snapped to the motor endpoint only within eight adjacent double values; transforms that need a larger correction or collapse the joint range are rejected. This does not widen operational command limits or accept an adjacent outside joint value. Once active, a position, velocity, or effort command outside its command_* range (or the transformed motor range) is rejected, never clamped. The entire multi-joint CAN command batch is withheld, queued motion commands are cleared, and write() returns an error to ros2_control. Correct the command and reactivate the hardware/controller; do not rely on a clipped target.

Every joint must export all three command interfaces and the three required state interfaces. temperature and fault are optional state interfaces:

<command_interface name="position"/>
<command_interface name="velocity"/>
<command_interface name="effort"/>

<state_interface name="position"/>
<state_interface name="velocity"/>
<state_interface name="effort"/>
<state_interface name="temperature"/>
<state_interface name="fault"/>
Model profile macros

Known models resolve their protocol ranges from robstride_driver. Set the joint parameter model to RS00–RS06, EL05, or EduLite05; numeric protocol limits can be omitted. Supplied numeric limits must exactly match that model. Use command_* limits for tighter robot operating limits.

For custom hardware, set model to custom and supply the numeric protocol limits listed above. Omitting model preserves the existing explicit-limit configuration. Gains and watchdog settings remain required.

Existing macro names and arguments remain supported. The old include path in robstride_examples forwards to the production package. Expanded Xacro now contains model instead of numeric protocol ranges and requires this driver version or newer.

The predefined macros are in robstride_ros2_control/description/robstride_motor_profiles.xacro (opens in a new tab).

ModelMacroDefault watchdog ticks
RS00robstride_rs00_params4000
RS01robstride_rs01_params4000
RS02robstride_rs02_params4000
RS03robstride_rs03_params4000
RS04robstride_rs04_params4000
RS05robstride_rs05_params4000
RS06robstride_rs06_params4000
EL05robstride_edulite05_params4000

Example:

<xacro:include filename="$(find robstride_ros2_control)/description/robstride_motor_profiles.xacro"/>

<joint name="wheel_joint_1">
  <xacro:robstride_edulite05_params
    can_id="1" direction="1" kp="20.0" kd="0.8"
    command_velocity_min="-5.0" command_velocity_max="5.0"
    command_effort_min="-2.0" command_effort_max="2.0"/>
  <xacro:robstride_joint_interfaces/>
</joint>

kp and kd are required macro arguments because they are active control gains, not model defaults. Select and validate them for the robot mechanism and load. The values above are examples only.

The common 4000 watchdog value is a package safety default, not a factory default. The official manuals document 0 as the factory value, which disables the watchdog, and 20000 ticks as 1 second. This package rejects zero so that loss of host commands eventually forces the motor back to Reset mode.

Controllers and command modes
Command interfaceController typeUnitMotor command behavior
positionforward_command_controller/ForwardCommandController (interface_name: position)radposition, Kp, and Kd
velocityforward_command_controller/ForwardCommandController (interface_name: velocity)rad/svelocity and Kd; Kp is zero
effortforward_command_controller/ForwardCommandController (interface_name: effort)Nmtorque feed-forward; Kp and Kd are zero

The hardware maps the active ROS command interface to the corresponding motor command. A joint cannot claim more than one command interface at a time, but separate joints may use different modes simultaneously.

Switch one joint group from position to velocity control:

ros2 run controller_manager spawner robstride_velocity_controller \
  --inactive --controller-manager /controller_manager

ros2 control switch_controllers \
  --deactivate robstride_position_controller \
  --activate robstride_velocity_controller \
  --controller-manager /controller_manager

ros2 topic pub --rate 20 \
  /robstride_velocity_controller/commands \
  std_msgs/msg/Float64MultiArray "{data: [1.0]}"

Use the same procedure with robstride_effort_controller for effort commands.

CAN traffic diagnostics

While the Hardware Component is configured, the driver publishes standard diagnostic_msgs/msg/DiagnosticArray messages on /diagnostics once per second:

ros2 topic echo /diagnostics

The robstride_driver/CAN traffic entry reports transport health, transmitted motion, recovery, and lifecycle/parameter transaction frames separately. It also reports the number of motion commands replaced before transmission by the latest-command-wins queue. Each robstride_driver/<joint_name> entry reports motor mode, temperature, raw and decoded fault flags, recovery state and attempt count, recognized feedback count, average feedback rate, current feedback age, and maximum observed feedback age.

Diagnostic levels have the following meaning:

LevelMotor entryCAN traffic entry
OKFeedback is current, no fault is set, and an active motor is in Run modeTransport is healthy
WARNNo feedback yet, Run-mode recovery is active, or an active motor is outside Run modeEndpoint loss is still within its grace period, or hardware is inactive
ERRORFeedback is stale or a motor fault flag is setA persistent transport failure affects active hardware

Exceptions from receive callbacks, diagnostic providers/publication, and executor work are contained at the transport thread boundary. A failure latches executor failed health, disables active commands, wakes transaction waiters, and makes active hardware reads and writes return ERROR. A one-shot transport ERROR diagnostic is attempted without invoking the metrics provider; if ROS publication is unavailable, health remains latched and stderr reports the failure. Expected ROS context shutdown reports ROS context shutdown health and stops transport service without reporting an executor exception (active hardware still returns ERROR because service is unavailable). Transmit-thread exceptions likewise stop service, including failures during worker setup before its first publication.

Lifecycle start/stop must be called serially by the owning thread, never from a transport callback. Stop joins both threads before releasing ROS resources; restart reaps any failed run before creating new threads. The executor uses a finite idle wait rather than depending on cancellation during ROS shutdown. This does not bound a callback or publisher that blocks indefinitely: stop still waits for in-flight work, and no thread is detached. Transport failure cannot guarantee that motor stop commands reach the CAN bridge.

The six fault flags in the normal motor feedback are decoded as undervoltage, overcurrent, over-temperature, encoder fault, stall overload, and encoder uncalibrated. The fault_flags_raw field remains available for firmware-level troubleshooting. These names follow the private-protocol feedback definition in the RobStride manuals linked below.

The rates are averages since the CAN transport was opened. They are measured at the driver boundary, not inferred from the controller-manager update rate. In particular, a requested controller rate is not necessarily the physical per-motor CAN rate: when commands arrive faster than the transport sends them, the pending command for that motor is replaced and the coalesced counter increases.

For a multi-motor system, begin with a conservative update rate and observe the diagnostics under representative load. A rising coalesced count, falling per-motor feedback rate, or increasing feedback age indicates that the update rate or other CAN traffic should be reduced. These values do not claim total bus utilization: CAN bit stuffing, bitrate, motor response behavior, and unrelated traffic are outside the driver's measured counters.

Multiple motors

Give every motor a unique joint name and CAN ID, then group joints in controller configuration. For example, IDs 1-4 can use velocity control while IDs 5-6 use position control:

wheel_velocity_controller:
  ros__parameters:
    joints: [joint_1, joint_2, joint_3, joint_4]

steering_position_controller:
  ros__parameters:
    joints: [joint_5, joint_6]
ros2 topic pub --rate 20 \
  /wheel_velocity_controller/commands \
  std_msgs/msg/Float64MultiArray "{data: [1.0, 1.0, 1.0, 1.0]}"

ros2 topic pub --rate 20 \
  /steering_position_controller/commands \
  std_msgs/msg/Float64MultiArray "{data: [0.2, -0.2]}"
Timeout and shutdown behavior
SettingBehavior
can_timeout_ticksThe motor returns to Reset mode after host commands stop
feedback_timeout_msThe hardware returns ERROR after motor feedback stops
transmit_failure_timeout_msPersistent transmit endpoint loss or a stalled sender returns ERROR
shutdown_stop_repetitionsZero commands and stop commands are repeated
shutdown_confirmation_timeout_msThe hardware waits for Reset mode feedback

On deactivation, shutdown, error, or destruction while active, the component sends a zero command followed by a stop command to every motor. If the ROS transport cannot deliver those commands, the configured motor-side CAN watchdog is the final fallback.

Command submission passes through several independently observable stages. A controller update first replaces the latest value in the driver's local queue. A successful ROS publication means the frame was handed to DDS while a bridge subscriber was present; it does not by itself prove transmission on the physical CAN bus or execution by the motor. Recognized motor feedback is the end-to-end evidence available to this driver, and feedback_timeout_ms detects its loss independently of transmit-path monitoring.

CI additionally exercises both directions of the topic transport through ros2_socketcan and a Linux vcan interface. A simulated RobStride motor on that bus verifies startup parameter confirmation, enable and motion feedback, automatic Run-mode recovery, feedback timeout handling, and shutdown when stop confirmation is missing. The fake keeps explicitly injected measured position separate from captured commands: it does not model motion or teleport the shaft when a zero-gain startup command arrives. Tests include startup outside operational position limits and successful command activation after measured position returns inside those limits.

The fake simulates the configured CAN watchdog using a monotonic clock and 50-microsecond ticks (20,000 ticks/second). Enable starts the deadline; addressed motion commands refresh it. Parameter reads and traffic addressed to other motor IDs do not. Expiry changes the fake to Reset and emits feedback if enabled. Two-motor scenarios independently drop one motor's commands or feedback, verify per-ID recovery routing, and check both settings of fail_on_feedback_timeout. Polling has bounded deadlines; driver and worker-thread cleanup is RAII-managed, including failed assertions. These software simulations are not hardware-in-the-loop tests, a firmware-conformance claim, or evidence of physical safety. Real watchdog timing, bus failures, motor dynamics, and safe mechanical behavior require hardware validation.

Jazzy and Rolling CI also load the installed hardware plugin in a real controller_manager and exercise forward command controllers through vcan. These tests check position, velocity and effort commands at the fake motor, independent feedback on /joint_states, mode switching, and hardware deactivation/reactivation. See the integration test instructions (opens in a new tab).

License

MIT (opens in a new tab)

References

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.