Exemplo n.º 1
0
    def updateFit(self):
        # get and display: .1sec
        polyData = segmentation.getDisparityPointCloud()
        if (polyData is None):
            return

        updatePolyData(polyData, 'pointcloud snapshot', colorByName='rgb_colors', visible=False)

        t0 = time.time()
        if (self.tableCentroid is None):
            # initial fit .75 sec
            print("Boot Strapping tracker")
            self.tableCentroid = segmentation.findAndFitDrillBarrel(polyData)
        else:
            # refit .07 sec
            #print "current centroid"
            #print self.tableCentroid

            viewFrame = segmentationroutines.SegmentationContext.getGlobalInstance().getViewFrame()
            forwardDirection = np.array([1.0, 0.0, 0.0])
            viewFrame.TransformVector(forwardDirection, forwardDirection)
            robotOrigin = viewFrame.GetPosition()
            robotForward =forwardDirection    

            fitResults = []
            drillFrame = segmentation.segmentDrillBarrelFrame(self.tableCentroid, polyData, robotForward)
            clusterObj = updatePolyData(polyData, 'surface cluster refit', color=[1,1,0], parent=segmentation.getDebugFolder(), visible=False)
            fitResults.append((clusterObj, drillFrame))

            segmentation.sortFittedDrills(fitResults, robotOrigin, robotForward)
Exemplo n.º 2
0
    def updateFit(self):
        # get and display: .1sec
        polyData = segmentation.getDisparityPointCloud()
        if polyData is None:
            return

        updatePolyData(polyData, "pointcloud snapshot", colorByName="rgb_colors", visible=False)

        t0 = time.time()
        if self.tableCentroid is None:
            # initial fit .75 sec
            print "Boot Strapping tracker"
            self.tableCentroid = segmentation.findAndFitDrillBarrel(polyData)
        else:
            # refit .07 sec
            # print "current centroid"
            # print self.tableCentroid

            viewFrame = segmentationroutines.SegmentationContext.getGlobalInstance().getViewFrame()
            forwardDirection = np.array([1.0, 0.0, 0.0])
            viewFrame.TransformVector(forwardDirection, forwardDirection)
            robotOrigin = viewFrame.GetPosition()
            robotForward = forwardDirection

            fitResults = []
            drillFrame = segmentation.segmentDrillBarrelFrame(self.tableCentroid, polyData, robotForward)
            clusterObj = updatePolyData(
                polyData, "surface cluster refit", color=[1, 1, 0], parent=segmentation.getDebugFolder(), visible=False
            )
            fitResults.append((clusterObj, drillFrame))

            segmentation.sortFittedDrills(fitResults, robotOrigin, robotForward)
Exemplo n.º 3
0
 def run(self):
     polyData = self.getPointCloud()
     segmentation.findAndFitDrillBarrel(polyData)
Exemplo n.º 4
0
 def fitDrillMultisense():
     pd = om.findObjectByName('Multisense').model.revPolyData
     om.removeFromObjectModel(om.findObjectByName('debug'))
     segmentation.findAndFitDrillBarrel(pd)
Exemplo n.º 5
0
 def fitDrillMultisense():
     pd = om.findObjectByName('Multisense').model.revPolyData
     om.removeFromObjectModel(om.findObjectByName('debug'))
     segmentation.findAndFitDrillBarrel(pd)
Exemplo n.º 6
0
 def run(self):
     polyData = self.getPointCloud()
     segmentation.findAndFitDrillBarrel(polyData)