(physics, walker, qpos, qvel, offset=0, null_xyz_and_yaw=False,
               position_shift=None, rotation_shift=None)
Set the freejoint and walker's joints angles and velocities.
Set the freejoint and walker's joints angles and velocities.
Set the freejoint and walker s joints angles and velocities .
def set_walker(physics, walker, qpos, qvel, offset=0, null_xyz_and_yaw=False,
               position_shift=None, rotation_shift=None):
  """Set the freejoint and walker's joints angles and velocities."""
  qpos = np.array(qpos)
  if null_xyz_and_yaw:
    qpos[:2] = 0.
    euler = tr.quat_to_euler(qpos[3:7], ordering='ZYX')
    euler[0] = 0.
    quat = tr.euler_to_quat(euler, ordering='ZYX')
    qpos[3:7] = quat
  qpos[:3] += offset

  freejoint = mjcf.get_attachment_frame(walker.mjcf_model).freejoint

  physics.bind(freejoint).qpos = qpos[:7]
  physics.bind(freejoint).qvel = qvel[:6]

  physics.bind(walker.mocap_joints).qpos = qpos[7:]
  physics.bind(walker.mocap_joints).qvel = qvel[6:]
  if position_shift is not None or rotation_shift is not None:
    walker.shift_pose(physics, position=position_shift,
                      quaternion=rotation_shift, rotate_velocity=True)
def set_walker ( physics , walker , qpos , qvel , offset = 0 , null_xyz_and_yaw = False , position_shift = None , rotation_shift = None ) : qpos = np . array ( qpos ) if null_xyz_and_yaw : qpos [ : 2 ] = 0. euler = tr . quat_to_euler ( qpos [ 3 : 7 ] , ordering = 'ZYX' ) euler [ 0 ] = 0. quat = tr . euler_to_quat ( euler , ordering = 'ZYX' ) qpos [ 3 : 7 ] = quat qpos [ : 3 ] += offset freejoint = mjcf . get_attachment_frame ( walker . mjcf_model ) . freejoint physics . bind ( freejoint ) . qpos = qpos [ : 7 ] physics . bind ( freejoint ) . qvel = qvel [ : 6 ] physics . bind ( walker . mocap_joints ) . qpos = qpos [ 7 : ] physics . bind ( walker . mocap_joints ) . qvel = qvel [ 6 : ] if position_shift is not None or rotation_shift is not None : walker . shift_pose ( physics , position = position_shift , quaternion = rotation_shift , rotate_velocity = True )