diff --git a/src/game_master/scripts/autonomous_controller.py b/src/game_master/scripts/autonomous_controller.py index a50fe92..71aa69b 100755 --- a/src/game_master/scripts/autonomous_controller.py +++ b/src/game_master/scripts/autonomous_controller.py @@ -483,7 +483,7 @@ def begin_look_for_ground_robot(self): def look_for_ground_robot(self): if self.groundSwipeCount == 0: - self.drone.cameraControl(-20, 0) + self.drone.cameraControl(-25, 0) elif self.groundSwipeCount == 1: self.drone.cameraControl(-40, 0) elif self.groundSwipeCount == 2: diff --git a/src/game_master/scripts/vision.py b/src/game_master/scripts/vision.py index 495f859..70790f3 100644 --- a/src/game_master/scripts/vision.py +++ b/src/game_master/scripts/vision.py @@ -18,9 +18,9 @@ class DroneVision: EAST_ENTRANCE_MARKER_ID = 39 NORTH_ENTRANCE_MARKER_ID = 41 LANDING_PAD_MARKER_ID = 40 - GROUND_ROBOT_MARKER_IDS = [1, 2, 3, 4] + GROUND_ROBOT_MARKER_ID = 1 RED_VEHICLE_MARKER_ID = 10 - ALL_MARKER_IDS = [EAST_ENTRANCE_MARKER_ID, NORTH_ENTRANCE_MARKER_ID, LANDING_PAD_MARKER_ID, RED_VEHICLE_MARKER_ID] + GROUND_ROBOT_MARKER_IDS + ALL_MARKER_IDS = [GROUND_ROBOT_MARKER_ID, EAST_ENTRANCE_MARKER_ID, NORTH_ENTRANCE_MARKER_ID, LANDING_PAD_MARKER_ID, RED_VEHICLE_MARKER_ID] def __init__(self, drone, vfov=45, hfov=80, expectedDistance= 6.50, northToSouth=7.50, eastToWest=6.90): self.drone = drone @@ -72,7 +72,7 @@ def __init__(self, drone, vfov=45, hfov=80, expectedDistance= 6.50, northToSouth # New frame flag self.newFrameProcessed = False self.processLine = True - self.processMarker = False + self.processMarker = True self.processBear = False def angle_between(self, a, b, c): @@ -151,7 +151,7 @@ def calculateFrontalDistance(self, origImg, frameTime, Display=True): vehicle_found = True vehicle_bounding_box = [corners[i][0][0][0], corners[i][0][0][1], corners[i][0][0][0] + 40, corners[i][0][0][1] + 40] siteFramePosition = markerCentre - elif ids[i][0] in self.GROUND_ROBOT_MARKER_IDS: + elif ids[i][0] == self.GROUND_ROBOT_MARKER_ID: self.groundRobotVisible = True self.groundRobotAngle = self.drone.yaw - np.radians(markerAngleDeg) self.groundRobotDistance = markerDistance