diff --git a/drive_between_arucos.py b/drive_between_arucos.py index 0f24b9a..a28c83e 100644 --- a/drive_between_arucos.py +++ b/drive_between_arucos.py @@ -50,10 +50,9 @@ def find_arucos(arlo): print(f"found box {id_}") position = cv2.aruco.estimatePoseSingleMarkers( np.array([aruco]), 14.5, CAMERA_MATRIX, DIST_COEF - ) + )[1][0][0] print(position) - exit() - position = np.array([position[0], position[1]]) + position = np.array([position[1], position[0]]) position[0] += 22.5 print(id_, position) aruco_dict[id_] = position @@ -77,7 +76,7 @@ def main(): np.average(aruco_positions[:,1]) ] - angle = np.rad2deg(np.arctan(position[0]/position[1])) + angle = np.rad2deg(np.arctan(position[1]/position[0])) drive_distance = np.sqrt(position[0]**2 + position[1]**2) if angle < 0: arlo.go_diff(POWER, POWER, 0, 1)