ravens/tasks/defs_cloth.py
def add_zone(self, env, zone_pose=None):
        """Adds a square target (green) zone.

        To handle goal-conditioned cloth flattening, we save `zone_pose` and
        provide it as input, to avoid re-sampling. This means starting cloth
        states are sampled at a correct distance, and that the same IoU
        metric can be used as the reward.
        """
        zone_template = 'assets/zone/zone-template.urdf'
        replace = {'LENGTH': (self._zone_scale, self._zone_scale)}
        zone_urdf = self.fill_template(zone_template, replace)

        # Pre-assign zone pose _only_ if loading goal-conditioned policies.
        if zone_pose is not None:
            self.zone_pose = zone_pose
        else:
            self.zone_pose = self.random_pose(env, self.zone_size)

        # For tracking IDs and consistency with existing ravens code.
        zone_id = env.add_object(zone_urdf, self.zone_pose, fixed=True)
        self._IDs[zone_id] = 'zone'
        self.get_masks_target(env, zone_id)
        os.remove(zone_urdf)

        # To reference it later for IoUs/coverage, or to remove if needed.
        self.zone_ID = zone_id
Adds a square target (green) zone.

        To handle goal-conditioned cloth flattening, we save `zone_pose` and
        provide it as input, to avoid re-sampling. This means starting cloth
        states are sampled at a correct distance, and that the same IoU
        metric can be used as the reward.
        
Adds a square target (green) zone.
To handle goal-conditioned cloth flattening, we save `zone_pose` and
provide it as input, to avoid re-sampling. This means starting cloth
states are sampled at a correct distance, and that the same IoU
metric can be used as the reward.
Adds a square target ( green ) zone . To handle goal - conditioned cloth flattening we save ` zone_pose ` and provide it as input to avoid re - sampling . This means starting cloth states are sampled at a correct distance and that the same IoU metric can be used as the reward .
def add_zone(self, env, zone_pose=None):
        zone_template = 'assets/zone/zone-template.urdf'
        replace = {'LENGTH': (self._zone_scale, self._zone_scale)}
        zone_urdf = self.fill_template(zone_template, replace)
        if zone_pose is not None:
            self.zone_pose = zone_pose
        else:
            self.zone_pose = self.random_pose(env, self.zone_size)
        zone_id = env.add_object(zone_urdf, self.zone_pose, fixed=True)
        self._IDs[zone_id] = 'zone'
        self.get_masks_target(env, zone_id)
        os.remove(zone_urdf)
        self.zone_ID = zone_id
def add_zone ( self , env , zone_pose = None ) : zone_template = 'assets/zone/zone-template.urdf' replace = { 'LENGTH' : ( self . _zone_scale , self . _zone_scale ) } zone_urdf = self . fill_template ( zone_template , replace ) if zone_pose is not None : self . zone_pose = zone_pose else : self . zone_pose = self . random_pose ( env , self . zone_size ) zone_id = env . add_object ( zone_urdf , self . zone_pose , fixed = True ) self . _IDs [ zone_id ] = 'zone' self . get_masks_target ( env , zone_id ) os . remove ( zone_urdf ) self . zone_ID = zone_id
Adds a square target (green) zone.
Adds a square target ( green ) zone .
"""Adds a square target (green) zone.

        To handle goal-conditioned cloth flattening, we save `zone_pose` and
        provide it as input, to avoid re-sampling. This means starting cloth
        states are sampled at a correct distance, and that the same IoU
        metric can be used as the reward.
        """ # Pre-assign zone pose _only_ if loading goal-conditioned policies. # For tracking IDs and consistency with existing ravens code. # To reference it later for IoUs/coverage, or to remove if needed.
self
env
zone_pose