(self)
Record the inertia of each body from URDF file.
Record the inertia of each body from URDF file.
Record the inertia of each body from URDF file .
def _RecordInertiaInfoFromURDF(self):
    """Record the inertia of each body from URDF file."""
    self._link_urdf = []
    num_bodies = self._pybullet_client.getNumJoints(self.quadruped)
    for body_id in range(-1, num_bodies):  # -1 is for the base link.
      inertia = self._pybullet_client.getDynamicsInfo(self.quadruped,
                                                      body_id)[2]
      self._link_urdf.append(inertia)
    # We need to use id+1 to index self._link_urdf because it has the base
    # (index = -1) at the first element.
    self._base_inertia_urdf = [
        self._link_urdf[chassis_id + 1]
        for chassis_id in self._chassis_link_ids
    ]
    self._leg_inertia_urdf = [
        self._link_urdf[leg_id + 1] for leg_id in self._leg_link_ids
    ]
    self._leg_inertia_urdf.extend(
        [self._link_urdf[motor_id + 1] for motor_id in self._motor_link_ids])
def _RecordInertiaInfoFromURDF ( self ) : self . _link_urdf = [ ] num_bodies = self . _pybullet_client . getNumJoints ( self . quadruped ) for body_id in range ( - 1 , num_bodies ) : # -1 is for the base link. inertia = self . _pybullet_client . getDynamicsInfo ( self . quadruped , body_id ) [ 2 ] self . _link_urdf . append ( inertia ) # We need to use id+1 to index self._link_urdf because it has the base # (index = -1) at the first element. self . _base_inertia_urdf = [ self . _link_urdf [ chassis_id + 1 ] for chassis_id in self . _chassis_link_ids ] self . _leg_inertia_urdf = [ self . _link_urdf [ leg_id + 1 ] for leg_id in self . _leg_link_ids ] self . _leg_inertia_urdf . extend ( [ self . _link_urdf [ motor_id + 1 ] for motor_id in self . _motor_link_ids ] )