Beispiel #1
0
 def publish_state(self):
     state = DrinksStatus()
     for n in range(0,8):
         state.status.append((self.digital_state >> n) & 1)
     state.status =  map(lambda x: not (x[0] ^ x[1]), zip(MASK,state.status))
     reorder =  map(lambda x: state.status[x],  REORDER)
     state.status = reorder
     self._drinks_pub.publish(state)
Beispiel #2
0
 def publish_state(self):
     state = DrinksStatus()
     for n in range(0, 8):
         state.status.append((self.digital_state >> n) & 1)
     state.status = map(lambda x: not (x[0] ^ x[1]),
                        zip(MASK, state.status))
     reorder = map(lambda x: state.status[x], REORDER)
     state.status = reorder
     self._drinks_pub.publish(state)
Beispiel #3
0
    def request_digital(self, req):
        self._requested_digital=True
        self._serial.write("!R")
        while (self._requested_digital):
            rospy.sleep(0.1)
        state = DrinksStatus()
        for n in range(0,8):
            state.status.append((self.digital_state >> n) & 1)
        state.status =  map(lambda x: not (x[0] ^ x[1]), zip(MASK,state.status)) 
        state.status =  map(lambda x: state.status[x],  REORDER)

        resp = RequestDrinksStatusResponse(state)
        return resp
Beispiel #4
0
    def request_digital(self, req):
        self._requested_digital = True
        self._serial.write("!R")
        while (self._requested_digital):
            rospy.sleep(0.1)
        state = DrinksStatus()
        for n in range(0, 8):
            state.status.append((self.digital_state >> n) & 1)
        state.status = map(lambda x: not (x[0] ^ x[1]),
                           zip(MASK, state.status))
        state.status = map(lambda x: state.status[x], REORDER)

        resp = RequestDrinksStatusResponse(state)
        return resp