Esempio n. 1
0
 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()
Esempio n. 3
0
 def package_command(self, mcu_communicator: McuCommunicator) -> None:
     mcu_communicator.charge(self.player.id)
Esempio n. 4
0
 def package_command(self, mcu_communicator: McuCommunicator) -> None:
     mcu_communicator.sendSpeed(self.player.id, 0, 0, 0)
Esempio n. 5
0
 def package_command(self, mcu_communicator: McuCommunicator) -> None:
     mcu_communicator.kick(self.player.id, self.kick_speed)
Esempio n. 6
0
 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)
Esempio n. 7
0
 def package_command(self, mcu_communicator: McuCommunicator):
     return mcu_communicator.getBatterie(self.player.id)
Esempio n. 8
0
 def package_command(self, mcu_communicator: McuCommunicator) -> None:
     print("in package command dribble")
     #if self.activate:
     mcu_communicator.turnOnDribbler(self.player.id)
Esempio n. 9
0
 def package_command(self, mcu_communicator: McuCommunicator) -> None:
     if self.activate:
         mcu_communicator.turnOnDribbler(self.player.id)
     else:
         mcu_communicator.turnOffDribbler(self.player.id)
Esempio n. 10
0
 def connect(self, connection_info):
     return McuCommunicator(timeout=0.1)