Esempio 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)
Esempio 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()
Esempio n. 3
0
    def updatePointcloudSnapshot(self):

        if (self.useLidar is True):
            return vis.updatePolyData(segmentation.getCurrentRevolutionData(),
                                      'pointcloud snapshot', parent='segmentation')
        else:
            return vis.updatePolyData(segmentation.getDisparityPointCloud(4),
                                      'pointcloud snapshot', parent='segmentation')
Esempio n. 4
0
    def updatePointcloudSnapshot(self):

        if (self.useLidar is True):
            return vis.updatePolyData(segmentation.getCurrentRevolutionData(),
                                      'pointcloud snapshot',
                                      parent='segmentation')
        else:
            return vis.updatePolyData(segmentation.getDisparityPointCloud(4),
                                      'pointcloud snapshot',
                                      parent='segmentation')
Esempio n. 5
0
 def getPointCloud(self):
     return segmentation.getDisparityPointCloud(decimation=1, removeOutliers=self.getProperty('Remove Outliers'))
Esempio n. 6
0
 def getPointCloud(self):
     return segmentation.getDisparityPointCloud(
         decimation=1, removeOutliers=self.getProperty('Remove Outliers'))
Esempio n. 7
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()