(self,
             radius=0.6,
             height_above_ground=1,
             rgb_initial=((0, 0.4, 0), (0, 0.7, 0)),
             rgb_interval=((1., 1., .4), (0.7, 0.7, 0.)),
             rgb_final=((.4, 0.7, 1.), (0, 0.4, .7)),
             touch_debounce=.2,
             specific_collision_geom_ids=None,
             name='target')
Builds this target sphere.

    Args:
      radius: The radius (in meters) of this target sphere.
      height_above_ground: The height (in meters) of this target above ground.
      rgb_initial: A tuple of two colors for the stripe pattern of the target.
      rgb_interval: A tuple of two colors for the stripe pattern of the target.
      rgb_final: A tuple of two colors for the stripe pattern of the target.
      touch_debounce: duration to not count second touch.
      specific_collision_geom_ids: Only activate if collides with these geoms.
      name: The name of this entity.
Builds this target sphere.
Builds this target sphere .
def _build(self,
             radius=0.6,
             height_above_ground=1,
             rgb_initial=((0, 0.4, 0), (0, 0.7, 0)),
             rgb_interval=((1., 1., .4), (0.7, 0.7, 0.)),
             rgb_final=((.4, 0.7, 1.), (0, 0.4, .7)),
             touch_debounce=.2,
             specific_collision_geom_ids=None,
             name='target'):
    """Builds this target sphere.

    Args:
      radius: The radius (in meters) of this target sphere.
      height_above_ground: The height (in meters) of this target above ground.
      rgb_initial: A tuple of two colors for the stripe pattern of the target.
      rgb_interval: A tuple of two colors for the stripe pattern of the target.
      rgb_final: A tuple of two colors for the stripe pattern of the target.
      touch_debounce: duration to not count second touch.
      specific_collision_geom_ids: Only activate if collides with these geoms.
      name: The name of this entity.
    """
    self._mjcf_root = mjcf.RootElement(model=name)
    self._texture_initial = self._mjcf_root.asset.add(
        'texture', name='target_sphere_init', type='cube',
        builtin='checker', rgb1=rgb_initial[0], rgb2=rgb_initial[1],
        width='100', height='100')
    self._texture_interval = self._mjcf_root.asset.add(
        'texture', name='target_sphere_inter', type='cube',
        builtin='checker', rgb1=rgb_interval[0], rgb2=rgb_interval[1],
        width='100', height='100')
    self._texture_final = self._mjcf_root.asset.add(
        'texture', name='target_sphere_final', type='cube',
        builtin='checker', rgb1=rgb_final[0], rgb2=rgb_final[1],
        width='100', height='100')
    self._material = self._mjcf_root.asset.add(
        'material', name='target_sphere_init', texture=self._texture_initial)
    self._geom = self._mjcf_root.worldbody.add(
        'geom', type='sphere', name='geom', gap=2*radius,
        pos=[0, 0, height_above_ground], size=[radius],
        material=self._material)
    self._geom_id = -1
    self._touched_once = False
    self._touched_twice = False
    self._touch_debounce = touch_debounce
    self._specific_collision_geom_ids = specific_collision_geom_ids
def _build ( self , radius = 0.6 , height_above_ground = 1 , rgb_initial = ( ( 0 , 0.4 , 0 ) , ( 0 , 0.7 , 0 ) ) , rgb_interval = ( ( 1. , 1. , .4 ) , ( 0.7 , 0.7 , 0. ) ) , rgb_final = ( ( .4 , 0.7 , 1. ) , ( 0 , 0.4 , .7 ) ) , touch_debounce = .2 , specific_collision_geom_ids = None , name = 'target' ) : self . _mjcf_root = mjcf . RootElement ( model = name ) self . _texture_initial = self . _mjcf_root . asset . add ( 'texture' , name = 'target_sphere_init' , type = 'cube' , builtin = 'checker' , rgb1 = rgb_initial [ 0 ] , rgb2 = rgb_initial [ 1 ] , width = '100' , height = '100' ) self . _texture_interval = self . _mjcf_root . asset . add ( 'texture' , name = 'target_sphere_inter' , type = 'cube' , builtin = 'checker' , rgb1 = rgb_interval [ 0 ] , rgb2 = rgb_interval [ 1 ] , width = '100' , height = '100' ) self . _texture_final = self . _mjcf_root . asset . add ( 'texture' , name = 'target_sphere_final' , type = 'cube' , builtin = 'checker' , rgb1 = rgb_final [ 0 ] , rgb2 = rgb_final [ 1 ] , width = '100' , height = '100' ) self . _material = self . _mjcf_root . asset . add ( 'material' , name = 'target_sphere_init' , texture = self . _texture_initial ) self . _geom = self . _mjcf_root . worldbody . add ( 'geom' , type = 'sphere' , name = 'geom' , gap = 2 * radius , pos = [ 0 , 0 , height_above_ground ] , size = [ radius ] , material = self . _material ) self . _geom_id = - 1 self . _touched_once = False self . _touched_twice = False self . _touch_debounce = touch_debounce self . _specific_collision_geom_ids = specific_collision_geom_ids