def get_position(self, id): AXposition = AXAngle() self.communication.flushInput() # to empty the data buffer bytesToRead = 0x02 positionRequestMsg = self.make_msg(id, Instruction.READ_DATA, [Register.CURRENT_POSITION, bytesToRead]) self.communication.send_msg(positionRequestMsg) ret = self.communication.recv_msg() positionHighByte = ret[4] positionHighByte = positionHighByte << 8 positionLowByte = ret[3] position = positionHighByte | positionLowByte AXposition.setValue(position) return AXposition