# `BB.Sensor.Mimic`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/sensor/mimic.ex#L5)

A sensor that derives joint state from another joint.

Subscribes to sensor messages from a source joint and re-publishes
transformed messages for the mimic joint. This is useful for modelling
parallel jaw grippers and other mechanically-linked joint pairs.

## Options

  * `:source` - (required) The name of the source joint to follow
  * `:multiplier` - (optional, default 1.0) Scale factor applied to position values
  * `:offset` - (optional, default 0.0) Constant offset added after scaling
  * `:message_types` - (optional, default [JointState]) List of message types to forward

For JointState messages: `mimic_position = source_position * multiplier + offset`

## Example

    joint :right_finger do
      type(:prismatic)
      sensor(:mimic, {BB.Sensor.Mimic,
        source: :left_finger,
        multiplier: 1.0,
        message_types: [JointState]
      })
    end

## URDF Mimic Joints

This sensor implements the equivalent of URDF mimic joints:

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

Forward kinematics and visualisation automatically work since they
consume JointState messages published by this sensor.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
