(self, physics, close_factors)
Sets the finger position to the desired positions.

    Args:
      physics: An instance of `mjcf.Physics`.
      close_factors: A number or list of numbers defining the desired grasp
        position of each finger. A value of 0 corresponds to fully opening a
        finger, while a value of 1 corresponds to fully closing it. If a single
        number is specified, the same position is applied to all fingers.
Sets the finger position to the desired positions.
Sets the finger position to the desired positions .
def set_grasp(self, physics, close_factors):
    """Sets the finger position to the desired positions.

    Args:
      physics: An instance of `mjcf.Physics`.
      close_factors: A number or list of numbers defining the desired grasp
        position of each finger. A value of 0 corresponds to fully opening a
        finger, while a value of 1 corresponds to fully closing it. If a single
        number is specified, the same position is applied to all fingers.
    """
    if not isinstance(close_factors, collections.abc.Iterable):
      close_factors = (close_factors,) * len(self.joints)
    for joint, finger_factor in zip(self.joints, close_factors):
      joint_mj = physics.bind(joint)
      min_value, max_value = joint_mj.range
      joint_mj.qpos = min_value + (max_value - min_value) * finger_factor
    physics.after_reset()

    # Set target joint velocities to zero.
    physics.bind(self.actuators).ctrl = 0
def set_grasp ( self , physics , close_factors ) : if not isinstance ( close_factors , collections . abc . Iterable ) : close_factors = ( close_factors , ) * len ( self . joints ) for joint , finger_factor in zip ( self . joints , close_factors ) : joint_mj = physics . bind ( joint ) min_value , max_value = joint_mj . range joint_mj . qpos = min_value + ( max_value - min_value ) * finger_factor physics . after_reset ( ) # Set target joint velocities to zero. physics . bind ( self . actuators ) . ctrl = 0