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 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()
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()
def xScan(self,openingDepth,y): x = middleware.request('xScan', [openingDepth,y]) print(x)
def cScan(self,openingDepth='0.3'): x = middleware.request('cScan', [openingDepth]) print(x)
def getScreenVector(self,x,y): x = middleware.request('getScreenVector',[x,y]) print(x)
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',[])
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', [])
def xScan(self, openingDepth, y): x = middleware.request('xScan', [openingDepth, y]) print(x)
def cScan(self, openingDepth='0.3'): x = middleware.request('cScan', [openingDepth]) print(x)
def getScreenVector(self, x, y): x = middleware.request('getScreenVector', [x, y]) print(x)
def process_image(self): img = middleware.request('get_image', [])