示例#1
0
    def scan(self,delay=0.00):

        #print(ccm.middle)
        #import time
        #now = time.time()

        #'scan_image' will now use scan_image_multi
        #a new multiprocessing version of scan_image
        self._objects = middleware.request('scan_image',[])

        ###!!!Note the keys here are strings, not floats
        ###!!Converti them to float below
        #self._objects = dict((float(k), v) for k,v in self._objects.items())
        self._objects = dict((Decimal(k).quantize(Decimal('.001'),rounding=ROUND_HALF_UP), dict((kk,[Decimal(x).quantize(Decimal('.001'),rounding=ROUND_HALF_UP) for x in kv]) for kk,kv in v.items())) for k,v in self._objects.items())
        self._ignoreLabels = ['None','Ground']
示例#2
0
    def scan(self, delay=0.00):

        #print(ccm.middle)
        #import time
        #now = time.time()

        #'scan_image' will now use scan_image_multi
        #a new multiprocessing version of scan_image
        self._objects = middleware.request('scan_image', [])

        ###!!!Note the keys here are strings, not floats
        ###!!Converti them to float below
        #self._objects = dict((float(k), v) for k,v in self._objects.items())
        self._objects = dict(
            (Decimal(k).quantize(Decimal('.001'), rounding=ROUND_HALF_UP),
             dict((kk, [
                 Decimal(x).quantize(Decimal('.001'), rounding=ROUND_HALF_UP)
                 for x in kv
             ]) for kk, kv in v.items())) for k, v in self._objects.items())
        self._ignoreLabels = ['None', 'Ground']
    def get_bounding_box(self):
        print("get_bounding_box")
        if self.busy:
            return

        self.busy = True
        self._boundingBox = [x * 1.00 for x in middleware.request('getBoundingBox', [])]

        pattern='type:proprioception feature:bounding_box'
        matcher=Pattern(pattern)
        objs = 0
        for obj in self._internalChunks:
            if matcher.match(obj)!= None:
                objs+=1
                obj.width=repr(self._boundingBox[0])
                obj.depth=repr(self._boundingBox[1])
                obj.height=repr(self._boundingBox[2])
            if objs > 1:
                raise Exception("There shouldn't be more than one match...")
        print("get_bounding_box done.")
        self.busy = False
        self.update_posture()
示例#4
0
    def get_bounding_box(self):
        print("get_bounding_box")
        if self.busy:
            return

        self.busy = True
        self._boundingBox = [
            x * 1.00 for x in middleware.request('getBoundingBox', [])
        ]

        pattern = 'type:proprioception feature:bounding_box'
        matcher = Pattern(pattern)
        objs = 0
        for obj in self._internalChunks:
            if matcher.match(obj) != None:
                objs += 1
                obj.width = repr(self._boundingBox[0])
                obj.depth = repr(self._boundingBox[1])
                obj.height = repr(self._boundingBox[2])
            if objs > 1:
                raise Exception("There shouldn't be more than one match...")
        print("get_bounding_box done.")
        self.busy = False
        self.update_posture()
示例#5
0
 def xScan(self,openingDepth,y):
     x = middleware.request('xScan', [openingDepth,y])
     print(x)
示例#6
0
 def cScan(self,openingDepth='0.3'):
     x  = middleware.request('cScan', [openingDepth])
     print(x)
示例#7
0
 def getScreenVector(self,x,y):
     x = middleware.request('getScreenVector',[x,y])
     print(x)
示例#8
0
 def process_image(self):
     img = middleware.request('get_image',[])
 def get_time(self):
     print (middleware.request('get_time',[]))
 def get_bones(self):
     '''This will retrieve all the bones' names'''
     return middleware.request('get_bones',[])
示例#11
0
 def get_time(self):
     print(middleware.request('get_time', []))
示例#12
0
 def get_bones(self):
     '''This will retrieve all the bones' names'''
     return middleware.request('get_bones', [])
示例#13
0
 def xScan(self, openingDepth, y):
     x = middleware.request('xScan', [openingDepth, y])
     print(x)
示例#14
0
 def cScan(self, openingDepth='0.3'):
     x = middleware.request('cScan', [openingDepth])
     print(x)
示例#15
0
 def getScreenVector(self, x, y):
     x = middleware.request('getScreenVector', [x, y])
     print(x)
示例#16
0
 def process_image(self):
     img = middleware.request('get_image', [])