예제 #1
0
    def parse(self, raw_line):

        datalist = re.split("[\t =]+", raw_line.rstrip())
        print datalist
        name = datalist[0]
        if mapping.is_ha_joint(name):
            joint = {x: int(y) if not re.search("r", y[0]) else y for x, y in zip(self.dataorder[1:], datalist[1:])}
            self.joints[name] = joint
예제 #2
0
 def parse(self,raw_line):
     dataorder=['name','motNo','refEnc','drive','driven','harm','enc','dir','jmc','active','can','numMot','zeroed']
     datalist=re.split('[\t =]+',raw_line.rstrip())
     print datalist
     name=datalist[0]
     if mapping.is_ha_joint(name):
         joint = {x:int(y) if not re.search('[JE]',y[0]) else y for x,y in zip(dataorder[1:],datalist[1:])}
         self.joints[name]=joint
예제 #3
0
    def parse(self,raw_line):

        datalist=re.split('[\t =]+',raw_line.rstrip())
        print datalist
        name=datalist[0]
        if mapping.is_ha_joint(name):
            joint = {x:int(y) if not re.search('r',y[0]) else y for x,y in zip(self.dataorder[1:],datalist[1:])}
            self.joints[name]=joint
예제 #4
0
 def parse(self,raw_line):
     datalist=re.split('[\t =]+',raw_line)
     #print datalist
     name=datalist[0]
     if mapping.is_ha_joint(name):
         self.states[-1].insert_joint(name,[float(x) for x in datalist[3:12:2]])
     elif re.search('t',datalist[0]):
         try:
             t=float(datalist[1])
             self.states.append(hubo_state(t))
         except ValueError:
             print "time not found in "+datalist[1]
예제 #5
0
 def parse(self, raw_line):
     dataorder = ["cmd", "ref", "enc", "cur", "tmp"]
     datalist = re.split("[\t =]+", raw_line)
     # print datalist
     name = datalist[0]
     if mapping.is_ha_joint(name):
         self.states[-1].insert_joint(name, {x: float(y) for x, y in zip(dataorder, datalist[3:12:2])})
     elif re.search("t", datalist[0]):
         try:
             t = float(datalist[1])
             self.states.append(StateEntry(t))
         except ValueError:
             print "time not found in " + datalist[1]
예제 #6
0
 def parse(self,raw_line):
     dataorder=['cmd','ref','enc','cur','tmp']
     datalist=re.split('[\t =]+',raw_line)
     #print datalist
     name=datalist[0]
     if mapping.is_ha_joint(name):
         self.states[-1].insert_joint(name,{x:float(y) for x,y in zip(dataorder,datalist[3:12:2])})
     elif re.search('t',datalist[0]):
         try:
             t=float(datalist[1])
             self.states.append(StateEntry(t))
         except ValueError:
             print "time not found in "+datalist[1]
예제 #7
0
 def parse(self, raw_line):
     dataorder = [
         "name",
         "motNo",
         "refEnc",
         "drive",
         "driven",
         "harm",
         "enc",
         "dir",
         "jmc",
         "active",
         "can",
         "numMot",
         "zeroed",
     ]
     datalist = re.split("[\t =]+", raw_line.rstrip())
     print datalist
     name = datalist[0]
     if mapping.is_ha_joint(name):
         joint = {x: int(y) if not re.search("[JE]", y[0]) else y for x, y in zip(dataorder[1:], datalist[1:])}
         self.joints[name] = joint