(self,
             radius=0.35,
             mass=0.045,
             friction=(0.7, 0.075, 0.075),
             damp_ratio=1.0,
             name='soccer_ball')
Builds this soccer ball.

    Args:
      radius: The radius (in meters) of this target sphere.
      mass: Mass (in kilograms) of the ball.
      friction: Friction parameters of the ball geom with the three dimensions
        corresponding to (slide, spin, roll) frictions.
      damp_ratio: A real positive number. Lower implies less dampening upon
        contacts.
      name: The name of this entity.
Builds this soccer ball.
Builds this soccer ball .
def _build(self,
             radius=0.35,
             mass=0.045,
             friction=(0.7, 0.075, 0.075),
             damp_ratio=1.0,
             name='soccer_ball'):
    """Builds this soccer ball.

    Args:
      radius: The radius (in meters) of this target sphere.
      mass: Mass (in kilograms) of the ball.
      friction: Friction parameters of the ball geom with the three dimensions
        corresponding to (slide, spin, roll) frictions.
      damp_ratio: A real positive number. Lower implies less dampening upon
        contacts.
      name: The name of this entity.
    """
    super()._build(geom_type='sphere', size=(radius,), name=name)
    texture = self._mjcf_root.asset.add(
        'texture',
        name='soccer_ball',
        type='cube',
        fileup=_get_texture('up'),
        filedown=_get_texture('down'),
        filefront=_get_texture('front'),
        fileback=_get_texture('back'),
        fileleft=_get_texture('left'),
        fileright=_get_texture('right'))
    material = self._mjcf_root.asset.add(
        'material', name='soccer_ball', texture=texture)

    if damp_ratio < 0.0:
      raise ValueError(
          f'Invalid `damp_ratio` parameter ({damp_ratio} is not positive).')

    self._geom.set_attributes(
        pos=[0, 0, radius],
        size=[radius],
        condim=6,
        priority=1,
        mass=mass,
        friction=friction,
        solref=[0.02, damp_ratio],
        material=material)

    # Add some tracking cameras for visualization and logging.
    self._mjcf_root.worldbody.add(
        'camera',
        name='ball_cam_near',
        pos=[0, -2, 2],
        zaxis=[0, -1, 1],
        fovy=70,
        mode='trackcom')
    self._mjcf_root.worldbody.add(
        'camera',
        name='ball_cam',
        pos=[0, -7, 7],
        zaxis=[0, -1, 1],
        fovy=70,
        mode='trackcom')
    self._mjcf_root.worldbody.add(
        'camera',
        name='ball_cam_far',
        pos=[0, -10, 10],
        zaxis=[0, -1, 1],
        fovy=70,
        mode='trackcom')

    # Keep track of entities to team mapping.
    self._players = []

    # Initialize tracker attributes.
    self.initialize_entity_trackers()
def _build ( self , radius = 0.35 , mass = 0.045 , friction = ( 0.7 , 0.075 , 0.075 ) , damp_ratio = 1.0 , name = 'soccer_ball' ) : super ( ) . _build ( geom_type = 'sphere' , size = ( radius , ) , name = name ) texture = self . _mjcf_root . asset . add ( 'texture' , name = 'soccer_ball' , type = 'cube' , fileup = _get_texture ( 'up' ) , filedown = _get_texture ( 'down' ) , filefront = _get_texture ( 'front' ) , fileback = _get_texture ( 'back' ) , fileleft = _get_texture ( 'left' ) , fileright = _get_texture ( 'right' ) ) material = self . _mjcf_root . asset . add ( 'material' , name = 'soccer_ball' , texture = texture ) if damp_ratio < 0.0 : raise ValueError ( f'Invalid `damp_ratio` parameter ({damp_ratio} is not positive).' ) self . _geom . set_attributes ( pos = [ 0 , 0 , radius ] , size = [ radius ] , condim = 6 , priority = 1 , mass = mass , friction = friction , solref = [ 0.02 , damp_ratio ] , material = material ) # Add some tracking cameras for visualization and logging. self . _mjcf_root . worldbody . add ( 'camera' , name = 'ball_cam_near' , pos = [ 0 , - 2 , 2 ] , zaxis = [ 0 , - 1 , 1 ] , fovy = 70 , mode = 'trackcom' ) self . _mjcf_root . worldbody . add ( 'camera' , name = 'ball_cam' , pos = [ 0 , - 7 , 7 ] , zaxis = [ 0 , - 1 , 1 ] , fovy = 70 , mode = 'trackcom' ) self . _mjcf_root . worldbody . add ( 'camera' , name = 'ball_cam_far' , pos = [ 0 , - 10 , 10 ] , zaxis = [ 0 , - 1 , 1 ] , fovy = 70 , mode = 'trackcom' ) # Keep track of entities to team mapping. self . _players = [ ] # Initialize tracker attributes. self . initialize_entity_trackers ( )