# Test Data Driver Component ## Detailed Description The **Test Data Driver** acts as a mock input source for the ASTRAL-Next system in the sandbox/validation environment. It replaces the real hardware camera drivers. It is responsible for iterating through the provided dataset (`AD*.jpg`), managing the simulation clock, and providing the "Ground Truth" camera intrinsics. It serves as the primary feeder for Integration Tests, ensuring the system can be validated against a known sequence of events. ## API Methods ### `initialize_source` - **Input:** `source_path: str`, `camera_config_path: str` - **Output:** `bool` - **Description:** Opens the image directory. Loads the camera intrinsic parameters (K matrix, distortion model) from the config file. Prepares the iterator. - **Test Cases:** - Valid path -> Returns True, internal state ready. - Invalid path -> Returns False, logs error. ### `get_next_frame` - **Input:** `void` - **Output:** `FrameObject | None` - **Description:** Retrieves the next available image from the sequence. - **Structure of FrameObject:** - `image_raw`: np.array (Original resolution) - `timestamp`: float - `frame_id`: int - `intrinsics`: CameraIntrinsics object - **Test Cases:** - End of sequence -> Returns None. - Corrupt image file -> Skips or raises error. ### `get_intrinsics` - **Input:** `void` - **Output:** `CameraIntrinsics` - **Description:** Returns the loaded camera parameters (fx, fy, cx, cy, distortion). - **Test Cases:** - Check against known values in `data_parameters.md`. ## Integration Tests - **Sequence Replay:** Point to `docs/00_problem/input_data`, iterate through all `AD*.jpg` files. verify correct ordering and total count (60 frames). ## Non-functional Tests - **File I/O:** Efficiently read large files from disk without blocking the test runner for extended periods.