예제 #1
0
 def getComponentPosition(self, robot, componentName):
     (state, _) = robot.getComponentState(componentName)
     if state == None or state == '':
         print "No named component state for: %s." % (componentName)
         state = 'Unknown'
     
     return (state, state)
예제 #2
0
    def getComponentPosition(self, robot, componentName):
        (stateName, state) = robot.getComponentState(componentName)
        if stateName == None or len(state['positions']) == 0:
            if len(state['positions']) == 0:
                #Error while retreiving state
                return (None, None)

        if stateName == '':
            #print "No named component state for: %s." % (componentName)
            stateName = 'Unknown'

        p = []
        for position in state['positions']:
            p.append(round(position, 3))

        return (p, stateName)
예제 #3
0
    def getComponentPosition(self, robot, componentName):
        (stateName, state) = robot.getComponentState(componentName)
        if stateName == None or len(state['positions']) == 0:
            if len(state['positions']) == 0:
                #Error while retreiving state
                return (None, None)

        if stateName == '':
            #print "No named component state for: %s." % (componentName)
            stateName = 'Unknown'
        
        p = []
        for position in state['positions']:
            p.append(round(position, 3))
        
        return (p, stateName)