newton.eval_mimic#

newton.eval_mimic(model, state_in, state_out=None)[source]#

Update follower joint coordinates from their reference joints.

For each follower, this function reads every position and velocity coordinate of the reference joint, then writes the matching follower coordinates according to Model.joint_mimic_coeffs. Independent joints are left unchanged. Only State.joint_q and State.joint_qd are written.

If state_out is omitted, state_in is updated in place. Otherwise, all joint coordinates are first copied from state_in to state_out and the followers are updated in state_out.

Parameters:
  • model (Model) – Model containing the joint mimic metadata.

  • state_in (State) – State providing the input joint coordinates.

  • state_out (State | None) – State receiving the updated joint coordinates. If None, update state_in in place.

Raises:

ValueError – If either state does not contain joint coordinate arrays.