Skip to content

Introduce deep-copy utilities#429

Merged
christian-rauch merged 1 commit intoAprilRobotics:masterfrom
fspindle:deep_copy_utilities
Mar 6, 2026
Merged

Introduce deep-copy utilities#429
christian-rauch merged 1 commit intoAprilRobotics:masterfrom
fspindle:deep_copy_utilities

Conversation

@fspindle
Copy link
Contributor

@fspindle fspindle commented Mar 5, 2026

Added functions to simplify memory management when detections need to be passed between threads or stored beyond the detector's lifecycle.

apriltag_detection_copy(): Deep copy of a single detection.
apriltag_detections_copy(): Deep copy of a zarray_t of detections.
apriltag_detector_copy(): Clones a detector configuration.

This PR follows recommendation given in PR #428

fspindle added a commit to fspindle/visp that referenced this pull request Mar 5, 2026
- Add apriltag_detection_copy() and apriltag_detections_copy() to deep copy
  detection results including the matd_t* H homography matrix.
- Add apriltag_detector_copy() to clone detector configuration by copying
  all scalar fields and reinitializing pointer fields (tag_families, tp, wp)
  to independent default values to avoid shared ownership and double-free
  issues on destruction.
@fspindle fspindle force-pushed the deep_copy_utilities branch from 150d2e3 to 57918a2 Compare March 6, 2026 06:39
@fspindle fspindle requested a review from christian-rauch March 6, 2026 09:45
@christian-rauch christian-rauch merged commit 3057666 into AprilRobotics:master Mar 6, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants