Skip to content

feat: add BB.Sensor.Mimic for mechanically-linked joints#34

Merged
jimsynz merged 1 commit intomainfrom
feat/mimic-sensor
Jan 17, 2026
Merged

feat: add BB.Sensor.Mimic for mechanically-linked joints#34
jimsynz merged 1 commit intomainfrom
feat/mimic-sensor

Conversation

@jimsynz
Copy link
Contributor

@jimsynz jimsynz commented Jan 17, 2026

Summary

  • Adds BB.Sensor.Mimic sensor that derives joint state from another joint
  • Subscribes to source joint's sensor messages and re-publishes transformed values
  • Useful for modelling parallel jaw grippers and other mechanically-coupled joints

Options

Option Type Default Description
source atom required Name of the source joint to follow
multiplier float 1.0 Scale factor for position values
offset float 0.0 Constant offset added after scaling
message_types list [JointState] Message types to forward

Example Usage

joint :right_finger do
  type(:prismatic)
  sensor(:mimic, {BB.Sensor.Mimic,
    source: :left_finger,
    multiplier: 1.0,
    offset: 0.0
  })
end

URDF Equivalent

Implements the equivalent of URDF mimic joints:

<joint name="right_finger_joint" type="prismatic">
  <mimic joint="left_finger_joint" multiplier="1" offset="0"/>
</joint>

Formula: mimic_position = source_position * multiplier + offset

Test plan

  • Unit tests for init, message transformation, and forwarding
  • Verified with bb_example_wx200 parallel jaw gripper
  • All existing tests pass
  • mix check passes

Adds a sensor that derives joint state from another joint by subscribing
to sensor messages and re-publishing transformed values. Useful for
modelling parallel jaw grippers and other mechanically-coupled joints.

Options:
- `source` - name of the source joint to follow (required)
- `multiplier` - scale factor for position values (default: 1.0)
- `offset` - constant offset added after scaling (default: 0.0)
- `message_types` - message types to forward (default: [JointState])

Implements the equivalent of URDF mimic joints:
`mimic_position = source_position * multiplier + offset`
@jimsynz jimsynz merged commit 4ca274c into main Jan 17, 2026
15 checks passed
@jimsynz jimsynz deleted the feat/mimic-sensor branch January 17, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant