This reference describes unreleased code on main; no release documents it yet.

rlmesh::adapters::Actuator

structPreviewuse rlmesh::adapters::Actuator;[source]

One contiguous slice of an action vector.

struct Actuator

Fields

role

field[source]
role: Option<String>

Semantic role used for matching, e.g. action/gripper. None makes the actuator opaque: it occupies dim dims of the action with the constant fill, matched by no model output – the action-side mirror of a role-less Field. Use it for dims the env requires but no model produces (e.g. a control-mode selector). An opaque actuator carries only dim and fill.

dim

field[source]
dim: u32

Number of action dimensions occupied by this component.

encoding

field[source]
encoding: Option<ActionEncoding>

Rotation encoding when the component is a rotation.

range

field[source]
range: Option<(f64, f64)>

Optional (low, high) range of the component values.

binary

field[source]
binary: bool

Whether the component encodes a binary decision (resolved adapters snap the value to a definite side after range mapping: >= 0 opens (+1), below closes (-1); a value exactly on the boundary opens rather than emitting an undefined 0).

scale

field[source]
scale: Option<AxisValue>

Optional multiplier applied to the model value for this role: one float, or a sequence with one value per axis in this side’s own labels order (serialized as axis_scale).

invert

field[source]
invert: bool

Negate the model value for this role (equivalent to scale=-1 but explicit; the common gripper-sign correction).

threshold

field[source]
threshold: Option<f64>

Subtract this from the value, recentering the decision boundary – typically paired with binary so the snap splits at threshold instead of zero.

clip

field[source]
clip: bool

Clamp this actuator’s mapped value to its declared range. The per-component safety clamp the global Action.clip cannot give a mixed-range action: a global clip applies one bound to every dim, so it is wrong when dims have different ranges (e.g. delta-pos in [-1, 1] but rotation in [-pi/2, pi/2]). clip=True requires range.

fill

field[source]
fill: f64

Constant emitted for each dim of an opaque (role-less) actuator, and the fallback for an optional roled actuator. Defaults to 0.0; inert (must stay 0.0) on a roled, non- optional actuator.

optional

field[source]
optional: bool

On a roled actuator, make the role optional – if no model output declares it, fill the actuator’s dim dims with fill instead of failing resolution (the action-side mirror of a model input’s optional zero-fill). A model that does output the role drives it normally. Meaningless on a role-less actuator (already always filled).

frame

field[source]
frame: Option<Tolerant<Frame>>

Coordinate frame a Cartesian command’s axes are expressed in. Required of an absolute pose (action/eef_*) under the require-frames tier; a delta (action/delta_eef_*) may declare it too (a tool-frame delta and a base-frame delta are different commands), and when both sides do they must agree. Omitted from the wire when unset.

reference

field[source]
reference: Option<Tolerant<Reference>>

What a delta command is integrated against (action/delta_eef_*): an env declares what its Cartesian controller adds the delta to – the measured pose ("current") or the last commanded target ("target") – and a model declares what it was trained against. A disagreement is a hard resolve error, which is what stops an absolute-pose head from binding cleanly to a delta controller. reference says what a delta is added to; frame says which axes it is expressed in. Declare both unless the controller fixes the frame.

part

field[source]
part: Option<String>

The body part this actuator drives, when the role repeats across a body (LEFT_ARM, RIGHT_ARM, or any identifier both sides agree on): an identity key the resolver matches on, never a value it checks. Omitted from the wire when unset; an opaque actuator may not carry one.

offset

field[source]
offset: Option<AxisValue>

Optional addend applied after scale (value * scale + offset), a float or a per-axis sequence like scale: the stand pose a joint-position target is expressed around..

labels

field[source]
labels: Option<Vec<String>>

The axis names this actuator drives, dim of them in this side’s own order. When a model names labels the env actuator must name the same set; the model’s output is then reordered onto the env’s axes by name. Omitted from the wire when unset; an opaque actuator may not carry them.

Trait implementations

  • impl Clone for Actuator
  • impl Debug for Actuator
  • impl StructuralPartialEq for Actuator
  • impl PartialEq for Actuator
  • impl Serialize for Actuator
  • impl<'de> Deserialize<'de> for Actuator
  • impl Default for Actuator
  • impl Display for Actuator