示例#1
0
    def define_relations(self, map_bounds=None, pose=None):
        """Create a multimodal softmax model of spatial relationships.

        Defaults to: 'Front', 'Back', 'Left', and 'Right'.
        """
        if self.container_area is None or self.ignoring_containers:
            container_poly = None
        else:
            container_poly = Polygon(self.container_area.shape)

        # If not rectangular, approx. with rectangular
        shape = self.shape

        self.relations = binary_intrinsic_space_model(
            shape, container_poly=container_poly, bounds=map_bounds)
        brm = binary_range_model(shape, bounds=map_bounds)
        self.relations.binary_models['Near'] = brm.binary_models['Near']
示例#2
0
    def define_relations(self, map_bounds=None):
        """Create a multimodal softmax model of spatial relationships.

        Defaults to: 'Inside', 'Near', and 'Outside'.
        """
        self.relations = binary_range_model(self.shape, bounds=map_bounds)