robotic_sdk.aruco_tracking package
Submodules
robotic_sdk.aruco_tracking.aruco_dict module
Dictionary mapping ArUco marker types to their corresponding OpenCV dictionary identifiers.
- Keys:
“4X4_50”: 4x4 grid with 50 markers
“4X4_100”: 4x4 grid with 100 markers
“4X4_250”: 4x4 grid with 250 markers
“4X4_1000”: 4x4 grid with 1000 markers
“5X5_50”: 5x5 grid with 50 markers
“5X5_100”: 5x5 grid with 100 markers
“5X5_250”: 5x5 grid with 250 markers
“5X5_1000”: 5x5 grid with 1000 markers
“6X6_50”: 6x6 grid with 50 markers
“6X6_100”: 6x6 grid with 100 markers
“6X6_250”: 6x6 grid with 250 markers
“6X6_1000”: 6x6 grid with 1000 markers
“7X7_50”: 7x7 grid with 50 markers
“7X7_100”: 7x7 grid with 100 markers
“7X7_250”: 7x7 grid with 250 markers
“7X7_1000”: 7x7 grid with 1000 markers
“ORIGINAL”: Original ArUco markers
“APRILTAG_16h5”: AprilTag 16h5 markers
“APRILTAG_25h9”: AprilTag 25h9 markers
“APRILTAG_36h10”: AprilTag 36h10 markers
“APRILTAG_36h11”: AprilTag 36h11 markers
robotic_sdk.aruco_tracking.aruco_marker module
- class robotic_sdk.aruco_tracking.aruco_marker.ArucoMarker(marker_size: float = 9.0, aruco_type: str = '6X6_250', id: int = 12)
Bases:
MarkerBase
Class for ArUco markers.
- __init__(marker_size: float = 9.0, aruco_type: str = '6X6_250', id: int = 12)
Initializes the ArucoMarker class.
- Parameters:
marker_size (float) – The size of the marker.
aruco_type (str) – The type of ArUco marker.
id (int) – The ID of the marker.
robotic_sdk.aruco_tracking.aruco_tracker module
- class robotic_sdk.aruco_tracking.aruco_tracker.ArucoTracker(aruco_type: str, history_size=10, sigma_space=2.0, sigma_intensity=1.0)
Bases:
TrackerBase
Class for tracking ArUco markers.
- __init__(aruco_type: str, history_size=10, sigma_space=2.0, sigma_intensity=1.0)
Initializes the ArucoTracker class.
- Parameters:
aruco_type (str) – The type of ArUco marker.
- add_marker(aruco_marker: ArucoMarker)
Adds an ArUco marker to the tracker.
- Parameters:
aruco_marker (ArucoMarker) – The ArUco marker to be added.
- track(frame, draw=True)
Tracks ArUco markers in the given frame.
- Parameters:
frame – The frame in which to track markers.
draw (bool) – Whether to draw the markers on the frame.
- Returns:
The frame with markers drawn if draw is True.
robotic_sdk.aruco_tracking.camera_calibration module
- robotic_sdk.aruco_tracking.camera_calibration.calibrate(frame_folder_name: str, calibration_file_name: str, square_size: float = 23.5) None
Calibrates a camera using images of a chessboard pattern stored in a specified folder. Saves the calibration data (camera matrix, distortion coefficients, rotation, and translation vectors) to a specified file.
- Parameters:
frame_folder_name (str) – Path to the folder containing chessboard images.
calibration_file_name (str) – Path and name of the file to save the calibration data.
square_size (float) – The size of the squares on the chessboard in millimeters. Default is 23.5 mm.
- Returns:
None
robotic_sdk.aruco_tracking.marker_base module
- class robotic_sdk.aruco_tracking.marker_base.MarkerBase(marker_size: float, id: int)
Bases:
object
Abstract base class for handling markers.
- __init__(marker_size: float, id: int)
Initializes the MarkerBase class.
- Parameters:
marker_size (float) – The size of the marker.
id (int) – The ID of the marker.
- get_marker_image(pixel_size: int, output_path: str) bool
Generates and saves an image of the marker.
- Parameters:
pixel_size (int) – The size of the marker in pixels.
output_path (str) – The path to save the marker image.
- Returns:
True if the image was successfully saved.
- Return type:
bool
- set_offset(t_offset: ndarray, R_offset: ndarray)
Sets the translation and rotation offsets for the marker.
- Parameters:
t_offset (np.ndarray) – The translation offset.
R_offset (np.ndarray) – The rotation offset.
robotic_sdk.aruco_tracking.tracker_base module
- class robotic_sdk.aruco_tracking.tracker_base.TrackerBase
Bases:
ABC
Abstract base class for handling trackers.
- __init__()
Initializes the TrackerBase class.
- abstract add_marker(marker)
Adds a marker to the tracker.
- Parameters:
marker – The marker to be added.
- set_calibration_data(calib_data_path: str)
Sets the calibration data for the tracker.
- Parameters:
calib_data_path (str) – The path to the calibration data file (YAML).
- abstract track(frame, draw: bool)
Tracks markers in the given frame.
- Parameters:
frame – The frame in which to track markers.
draw (bool) – Whether to draw the markers on the frame.
- Returns:
The frame with markers drawn if draw is True.