(self)
return ref_model
Constructs simulated model for playing back the reference motion.

    Returns:
      Handle to the simulated model for the reference motion.
Constructs simulated model for playing back the reference motion.
Constructs simulated model for playing back the reference motion .
def _build_ref_model(self):
    """Constructs simulated model for playing back the reference motion.

    Returns:
      Handle to the simulated model for the reference motion.
    """
    ref_col = [1, 1, 1, self._draw_ref_model_alpha]

    pyb = self._get_pybullet_client()
    urdf_file = self._env.robot.GetURDFFile()
    ref_model = pyb.loadURDF(urdf_file, useFixedBase=True)

    pyb.changeDynamics(ref_model, -1, linearDamping=0, angularDamping=0)

    pyb.setCollisionFilterGroupMask(
        ref_model, -1, collisionFilterGroup=0, collisionFilterMask=0)

    pyb.changeDynamics(
        ref_model,
        -1,
        activationState=pyb.ACTIVATION_STATE_SLEEP +
        pyb.ACTIVATION_STATE_ENABLE_SLEEPING +
        pyb.ACTIVATION_STATE_DISABLE_WAKEUP)

    pyb.changeVisualShape(ref_model, -1, rgbaColor=ref_col)

    num_joints = pyb.getNumJoints(ref_model)
    num_joints_sim = pyb.getNumJoints(self._env.robot.quadruped)
    assert (
        num_joints == num_joints_sim
    ), "ref model must have the same number of joints as the simulated model."

    for j in range(num_joints):
      pyb.setCollisionFilterGroupMask(
          ref_model, j, collisionFilterGroup=0, collisionFilterMask=0)

      pyb.changeDynamics(
          ref_model,
          j,
          activationState=pyb.ACTIVATION_STATE_SLEEP +
          pyb.ACTIVATION_STATE_ENABLE_SLEEPING +
          pyb.ACTIVATION_STATE_DISABLE_WAKEUP)

      pyb.changeVisualShape(ref_model, j, rgbaColor=ref_col)

    return ref_model
def _build_ref_model ( self ) : ref_col = [ 1 , 1 , 1 , self . _draw_ref_model_alpha ] pyb = self . _get_pybullet_client ( ) urdf_file = self . _env . robot . GetURDFFile ( ) ref_model = pyb . loadURDF ( urdf_file , useFixedBase = True ) pyb . changeDynamics ( ref_model , - 1 , linearDamping = 0 , angularDamping = 0 ) pyb . setCollisionFilterGroupMask ( ref_model , - 1 , collisionFilterGroup = 0 , collisionFilterMask = 0 ) pyb . changeDynamics ( ref_model , - 1 , activationState = pyb . ACTIVATION_STATE_SLEEP + pyb . ACTIVATION_STATE_ENABLE_SLEEPING + pyb . ACTIVATION_STATE_DISABLE_WAKEUP ) pyb . changeVisualShape ( ref_model , - 1 , rgbaColor = ref_col ) num_joints = pyb . getNumJoints ( ref_model ) num_joints_sim = pyb . getNumJoints ( self . _env . robot . quadruped ) assert ( num_joints == num_joints_sim ) , "ref model must have the same number of joints as the simulated model." for j in range ( num_joints ) : pyb . setCollisionFilterGroupMask ( ref_model , j , collisionFilterGroup = 0 , collisionFilterMask = 0 ) pyb . changeDynamics ( ref_model , j , activationState = pyb . ACTIVATION_STATE_SLEEP + pyb . ACTIVATION_STATE_ENABLE_SLEEPING + pyb . ACTIVATION_STATE_DISABLE_WAKEUP ) pyb . changeVisualShape ( ref_model , j , rgbaColor = ref_col ) return ref_model