(self, geom_type, size, mass=None, name=None)
Initializes this prop.

    Args:
      geom_type: a string, one of the types supported by MuJoCo.
      size: a list or numpy array of up to 3 numbers, depending on the type.
      mass: The mass for the primitive geom.
      name: (optional) A string, the name of this prop.
Initializes this prop.
Initializes this prop .
def _build(self, geom_type, size, mass=None, name=None):
    """Initializes this prop.

    Args:
      geom_type: a string, one of the types supported by MuJoCo.
      size: a list or numpy array of up to 3 numbers, depending on the type.
      mass: The mass for the primitive geom.
      name: (optional) A string, the name of this prop.
    """
    size = np.reshape(np.asarray(size), -1)
    self._mjcf_root = mjcf.element.RootElement(model=name)

    self._geom = self._mjcf_root.worldbody.add(
        'geom', name='body_geom', type=geom_type, size=size, mass=mass)

    touch_sensor = self._mjcf_root.worldbody.add(
        'site', type=geom_type, name='touch_sensor', size=size*1.05,
        rgba=[1, 1, 1, 0.1],  # touch sensor site is almost transparent
        group=composer.SENSOR_SITES_GROUP)

    self._touch = self._mjcf_root.sensor.add(
        'touch', site=touch_sensor)

    self._position = self._mjcf_root.sensor.add(
        'framepos', name='position', objtype='geom', objname=self.geom)

    self._orientation = self._mjcf_root.sensor.add(
        'framequat', name='orientation', objtype='geom',
        objname=self.geom)

    self._linear_velocity = self._mjcf_root.sensor.add(
        'framelinvel', name='linear_velocity', objtype='geom',
        objname=self.geom)

    self._angular_velocity = self._mjcf_root.sensor.add(
        'frameangvel', name='angular_velocity', objtype='geom',
        objname=self.geom)

    self._name = name
def _build ( self , geom_type , size , mass = None , name = None ) : size = np . reshape ( np . asarray ( size ) , - 1 ) self . _mjcf_root = mjcf . element . RootElement ( model = name ) self . _geom = self . _mjcf_root . worldbody . add ( 'geom' , name = 'body_geom' , type = geom_type , size = size , mass = mass ) touch_sensor = self . _mjcf_root . worldbody . add ( 'site' , type = geom_type , name = 'touch_sensor' , size = size * 1.05 , rgba = [ 1 , 1 , 1 , 0.1 ] , # touch sensor site is almost transparent group = composer . SENSOR_SITES_GROUP ) self . _touch = self . _mjcf_root . sensor . add ( 'touch' , site = touch_sensor ) self . _position = self . _mjcf_root . sensor . add ( 'framepos' , name = 'position' , objtype = 'geom' , objname = self . geom ) self . _orientation = self . _mjcf_root . sensor . add ( 'framequat' , name = 'orientation' , objtype = 'geom' , objname = self . geom ) self . _linear_velocity = self . _mjcf_root . sensor . add ( 'framelinvel' , name = 'linear_velocity' , objtype = 'geom' , objname = self . geom ) self . _angular_velocity = self . _mjcf_root . sensor . add ( 'frameangvel' , name = 'angular_velocity' , objtype = 'geom' , objname = self . geom ) self . _name = name