Ejemplo 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)
Ejemplo n.º 2
0
 def getPointCloud(self):
     assert self.pointCloudSource in ('lidar', 'stereo')
     if self.pointCloudSource == 'stereo':
         return segmentation.getDisparityPointCloud(decimation=1,
                                                    removeOutliers=False)
     else:
         return segmentation.getCurrentRevolutionData()
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
 def getPointCloud(self):
     return segmentation.getDisparityPointCloud(decimation=1, removeOutliers=self.getProperty('Remove Outliers'))
Ejemplo n.º 5
0
 def getPointCloud(self):
     assert self.pointCloudSource in ('lidar', 'stereo')
     if self.pointCloudSource == 'stereo':
         return segmentation.getDisparityPointCloud(decimation=1, removeOutliers=False)
     else:
         return segmentation.getCurrentRevolutionData()
Ejemplo n.º 6
0
 def getPointCloud(self):
     return segmentation.getDisparityPointCloud(decimation=1, removeOutliers=self.getProperty('Remove Outliers'))