def create_alert_message(self): data = [] for robot in self.robots: data.append((robot.x, robot.y)) return SensorData(SensorData.ALERT_STRING, data, self.time_stamp)
def create_vision_message(self, robot): "New message type for FoV-data of a robot." # list of wall object tuples: # ((xpos, ypos), type, distance) board_data = self.calculate_vision_board(robot) # list of robot object tuples: # ((xpos, ypos), distance) robot_data = self.calculate_vision_robots(robot) data = (board_data, robot_data) return SensorData(SensorData.VISION_STRING, data, self.time_stamp)
def create_position_message(self, robot): data = (robot.x, robot.y, robot.alpha, robot.v, robot.v_alpha) return SensorData(SensorData.POSITION_STRING, data, self.time_stamp)
def create_bonk_message(self, collision): print('B O N K') data = None return SensorData(SensorData.BONK_STRING, data, self.time_stamp)