ros2_control Actuators

If a robot’s URDF (or expanded Xacro) includes <ros2_control> blocks describing its joints’ command interfaces, ARMOR compiles those directly into real MuJoCo actuators when the model is simulated — the same actuator layer a physical robot’s controller stack drives, rather than a simplified stand-in.

Why this matters

Without actuator dynamics, moving a joint in simulation means overwriting its position directly (qpos[]) every frame — a robot behaves the same whether it weighs one kilogram or one hundred, and nothing resists gravity, momentum, or contact forces realistically. With ros2_control support, ARMOR instead gives the joint a genuine actuator that has to work against the model’s real inertia, the same way it would on hardware.

What gets compiled

For every joint with a <ros2_control> command interface, ARMOR adds a matching MuJoCo actuator:

ros2_control command interface MuJoCo actuator
position <position>
velocity <velocity>
effort <motor>

Automatic gain computation

Position and velocity actuators need gains (kp, kv) to behave sensibly. Too low and the joint sags under its own load; too high and the simulation becomes stiff or unstable. Rather than shipping the same static, near-zero default gains for every joint regardless of what it’s attached to, ARMOR computes a default gain per joint from that joint’s effective inertia: the combined inertia of every body on the far side of the joint, taken about the joint’s axis with the parallel axis theorem. The gains target critical damping at a fixed bandwidth of ω = 50 rad/s (kp = I·ω², kv = 2·I·ω), rounded to three significant figures. A shoulder that carries a whole arm gets a stiffer default than a fingertip joint, so an imported robot holds a reasonable pose under gravity immediately, without hand-tuning gains before it looks right.

Because the gains come from mass data, a robot with no usable mass cannot get computed gains. Run Estimate All Masses first.

ARMOR's Actuator Control panel showing a computed default of kp 2.5e+02, kv 10 for a joint's Position Interface, with editable kp, kv, forcerange, and state fields

The Actuator Control panel: the “Computed” line shows the physically derived default before you touch anything, and every field underneath is still yours to override.

Each joint’s own controller lives in its Actuator Control panel in the joint editor. Add ROS2 Control creates one with the computed gains, and Remove Controller deletes it. If the joint’s subtree has no mass data, the panel warns that there is no mass data and that adding a controller is not recommended. Adding one anyway uses fixed starting gains of kp 100 and kv 10, which you should tune.

You can still edit any joint’s dynamics manually — see Joints for the damping and friction fields exposed in the editor.

Add Default Controllers

Rather than adding a controller to each joint one at a time, use Add Default Controllers in the Joints section of the robot editor. It adds a position controller with computed gains to every joint that can move.

Action What it does
Add Default Controllers Adds a position controller (kp, kv, and a force limit) to every moving joint that has mass data. Floating joints and joints with no mass data are skipped.
Remove All Controllers Removes the controller from every joint in the robot, after a Remove All Controllers? confirmation. It appears only once at least one joint has a controller.

ARMOR's robot editor Joints section, showing the end of a joint list with the Add Joint, Add Default Controllers and Remove All Controllers buttons below it

The Joints section of the robot editor, with the bulk controller actions below the joint list.

Two prompts can appear first:

Force and torque limits

Every generated actuator also gets a force or torque limit (forcerange), so a controller can never apply unlimited effort. ARMOR picks the first of these that applies:

  1. The joint’s own URDF <limit effort="...">, when it is a real positive value. This is the robot’s actual actuator rating.
  2. The gain times the joint’s travel, kp × (upper − lower): the effort needed to correct an error spanning the whole range.
  3. The gain times π, for a joint with no limits at all (a bare continuous joint): the effort for a half-turn error.

Some URDFs, such as the NASA/JPL Mars rovers, store “no limit” as the largest possible number. ARMOR ignores that value and moves on to the next option.

Group states and controllers

When you activate a semantic group state on a robot with controllers, ARMOR updates the controller’s target along with the joint position. The pose you chose stays in place when you press Play instead of being pulled back toward an old target.

Unstable simulations

If a simulation becomes numerically unstable, ARMOR shows an error with an explanation and suggestions, such as reducing the solver timestep. It does not silently reset the pose. See Troubleshooting Simulation Errors.

Multi-robot worlds

In a multi-robot world, each robot instance’s ros2_control actuator blocks are extracted, namespaced (so two instances of the same robot never collide on actuator names — for example robot_0_joint_1 vs robot_1_joint_1), and composed into the single MJCF that drives the shared physics scene. This happens automatically; you don’t need to rename anything yourself when duplicating a robot that has ros2_control actuators.

If a robot has no ros2_control block

Nothing changes — the joint behaves as it always has in ARMOR. This is purely additive: robots that don’t declare ros2_control interfaces are unaffected.

Next Steps