def __init__(self, baud_rate: int = 115200): # todo see if we still need the baud_rate, ask embedded! MGL 2017/05/29 self.mcu_communicator = McuCommunicator() self.command_queue = deque() self.terminate = threading.Event() self.comm_thread = threading.Thread(target=self.send_loop) self.comm_thread.start()
def __init__(self): self.mcu_com = McuCommunicator(timeout=0.1) self.last_time = 0 self.command_queue = deque() self.command_dict = {} self.terminate = threading.Event() self.comm_thread = threading.Thread(target=self.send_loop, name="SerialCommandSender") self.comm_thread.start()
def package_command(self, mcu_communicator: McuCommunicator) -> None: mcu_communicator.charge(self.player.id)
def package_command(self, mcu_communicator: McuCommunicator) -> None: mcu_communicator.sendSpeed(self.player.id, 0, 0, 0)
def package_command(self, mcu_communicator: McuCommunicator) -> None: mcu_communicator.kick(self.player.id, self.kick_speed)
def package_command(self, mcu_communicator: McuCommunicator) -> None: mcu_communicator.sendSpeed(self.player.id, self.cmd_repr.position.x, self.cmd_repr.position.y, self.cmd_repr.orientation)
def package_command(self, mcu_communicator: McuCommunicator): return mcu_communicator.getBatterie(self.player.id)
def package_command(self, mcu_communicator: McuCommunicator) -> None: print("in package command dribble") #if self.activate: mcu_communicator.turnOnDribbler(self.player.id)
def package_command(self, mcu_communicator: McuCommunicator) -> None: if self.activate: mcu_communicator.turnOnDribbler(self.player.id) else: mcu_communicator.turnOffDribbler(self.player.id)
def connect(self, connection_info): return McuCommunicator(timeout=0.1)