(self, leg_inertias)
Set the inertias of the legs.

    A leg includes leg_link and motor. 4 legs contain 16 links (4 links each)
    and 8 motors. First 16 numbers correspond to link inertia, last 8 correspond
    to motor inertia (24 total).

    Args:
      leg_inertias: The leg and motor inertias for all the leg links and motors.

    Raises:
      ValueError: It is raised when the length of inertias is not equal to
      the number of links + motors or leg_inertias contains negative values.
Set the inertias of the legs.
Set the inertias of the legs .
def SetLegInertias(self, leg_inertias):
    """Set the inertias of the legs.

    A leg includes leg_link and motor. 4 legs contain 16 links (4 links each)
    and 8 motors. First 16 numbers correspond to link inertia, last 8 correspond
    to motor inertia (24 total).

    Args:
      leg_inertias: The leg and motor inertias for all the leg links and motors.

    Raises:
      ValueError: It is raised when the length of inertias is not equal to
      the number of links + motors or leg_inertias contains negative values.
    """

    if len(leg_inertias) != len(self._leg_link_ids) + len(
        self._motor_link_ids):
      raise ValueError("The number of values passed to SetLegMasses are "
                       "different than number of leg links and motors.")
    for leg_id, leg_inertia in zip(self._leg_link_ids, leg_inertias):
      for inertia_value in leg_inertias:
        if (np.asarray(inertia_value) < 0).any():
          raise ValueError("Values in inertia matrix should be non-negative.")
      self._pybullet_client.changeDynamics(self.quadruped,
                                           leg_id,
                                           localInertiaDiagonal=leg_inertia)

    motor_inertias = leg_inertias[len(self._leg_link_ids):]
    for link_id, motor_inertia in zip(self._motor_link_ids, motor_inertias):
      for inertia_value in motor_inertias:
        if (np.asarray(inertia_value) < 0).any():
          raise ValueError("Values in inertia matrix should be non-negative.")
      self._pybullet_client.changeDynamics(self.quadruped,
                                           link_id,
                                           localInertiaDiagonal=motor_inertia)
def SetLegInertias ( self , leg_inertias ) : if len ( leg_inertias ) != len ( self . _leg_link_ids ) + len ( self . _motor_link_ids ) : raise ValueError ( "The number of values passed to SetLegMasses are " "different than number of leg links and motors." ) for leg_id , leg_inertia in zip ( self . _leg_link_ids , leg_inertias ) : for inertia_value in leg_inertias : if ( np . asarray ( inertia_value ) < 0 ) . any ( ) : raise ValueError ( "Values in inertia matrix should be non-negative." ) self . _pybullet_client . changeDynamics ( self . quadruped , leg_id , localInertiaDiagonal = leg_inertia ) motor_inertias = leg_inertias [ len ( self . _leg_link_ids ) : ] for link_id , motor_inertia in zip ( self . _motor_link_ids , motor_inertias ) : for inertia_value in motor_inertias : if ( np . asarray ( inertia_value ) < 0 ) . any ( ) : raise ValueError ( "Values in inertia matrix should be non-negative." ) self . _pybullet_client . changeDynamics ( self . quadruped , link_id , localInertiaDiagonal = motor_inertia )