rlmesh::adapters::Actuator
One contiguous slice of an action vector.
struct ActuatorFields
- roleSemantic role used for matching, e.g.
- dimNumber of action dimensions occupied by this component.
- encodingRotation encoding when the component is a rotation.
- rangeOptional
(low, high)range of the component values. - binaryWhether the component encodes a binary decision (resolved adapters snap the value to a definite side after range mapping:
>= 0opens (+1), below closes (-1); a value exactly on the boundary opens rather than emitting an undefined0). - scaleOptional multiplier applied to the model value for this role: one float, or a sequence with one value per axis in this side's own
labelsorder (serialized asaxis_scale). - invertNegate the model value for this role (equivalent to
scale=-1but explicit; the common gripper-sign correction). - thresholdSubtract this from the value, recentering the decision boundary -- typically paired with
binaryso the snap splits atthresholdinstead of zero. - clipClamp this actuator's mapped value to its declared
range. - fillConstant emitted for each dim of an opaque (role-less) actuator, and the fallback for an
optionalroled actuator. - optionalOn a roled actuator, make the role optional -- if no model output declares it, fill the actuator's
dimdims withfillinstead of failing resolution (the action-side mirror of a model input'soptionalzero-fill). - frameCoordinate frame a Cartesian command's axes are expressed in.
- referenceWhat 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. - partThe 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. - offsetOptional addend applied after
scale(value * scale + offset), a float or a per-axis sequence likescale: the stand pose a joint-position target is expressed around.. - labelsThe axis names this actuator drives,
dimof them in this side's own order.
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: u32Number 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: boolWhether 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: boolNegate 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: boolClamp 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: f64Constant 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: boolOn 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>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