Ejemplo n.º 1
0
    def changes_callback(self, msg):
        inv = Invalidations()
        inv.node_ids_deleted = self.scene().remove(msg.changes.nodes_to_delete)
        inv.node_ids_updated = self.scene().update(msg.changes.nodes_to_update)

        inv.situation_ids_deleted = self.timeline().remove(
            msg.changes.situations_to_delete)
        inv.situation_ids_updated = self.timeline().update(
            msg.changes.situations_to_update)
        inv.mesh_ids_deleted = msg.changes.meshes_to_delete
        self.meshes().remove(msg.changes.meshes_to_delete)
        u = self.meshes().update(msg.changes.meshes_to_update)
        inv.mesh_ids_updated = u
        if self.__ever_connected:
            self.__on_changes(self.__world_name, msg.header, inv)
Ejemplo n.º 2
0
    def apply_changes(self, header, changes):
        invalidations = Invalidations()

        invalidations.node_ids_deleted = self.__scene.remove(
            changes.nodes_to_delete)
        invalidations.node_ids_updated = self.__scene.update(
            changes.nodes_to_update)

        invalidations.situation_ids_deleted = self.__timeline.remove(
            changes.situations_to_delete)
        invalidations.situation_ids_updated = self.__timeline.update(
            changes.situations_to_update)

        for mesh_id in changes.meshes_to_delete:
            del self.__meshes[mesh_id]
            invalidations.mesh_ids_deleted.append(mesh_id)
        for mesh in changes.meshes_to_update:
            self.__meshes[mesh.id] = mesh
            invalidations.mesh_ids_updated.append(mesh.id)
        return invalidations
Ejemplo n.º 3
0
    def changes_callback(self, msg):
        inv = Invalidations()
        inv.node_ids_deleted = self.scene().remove(msg.changes.nodes_to_delete)
        inv.node_ids_updated = self.scene().update(msg.changes.nodes_to_update)

        inv.situation_ids_updated = self.timeline().update(
            msg.changes.situations_to_update)

        for sit in self.timeline().situations():
            if sit.end.data != rospy.Time(0):
                msg.changes.situations_to_delete.append(sit.id)

        inv.situation_ids_deleted = self.timeline().remove(
            msg.changes.situations_to_delete)

        inv.mesh_ids_deleted = msg.changes.meshes_to_delete
        self.meshes().remove(msg.changes.meshes_to_delete)
        u = self.meshes().update(msg.changes.meshes_to_update)
        inv.mesh_ids_updated = u
        if self.__ever_connected:
            self.__on_changes(self.__world_name, msg.header, inv)