How do I get the time stamp from the image published over ros using the depathai_ros_driver in with respect to my hostmachine clock rather than ROS time? Can I still use a form of this:
# 1. Capture "monotonic now" (time since host PC boot, unaffected by system clock changes)
monotonic_ref = dai.Clock.now() # Returns datetime.timedelta
# 2. Capture "UTC now" at the same instant
utc_ref = datetime.now(timezone.utc) # A naive datetime in UTC
# 3. Compute offset: (UTC time) - (monotonic time)
offset = utc_ref - monotonic_ref
with dai.Device(pipeline) as device:
q_rgb = device.getOutputQueue("rgb")
while True:
in_rgb = q_rgb.tryGet()
if in_rgb is not None:
frame = in_rgb.getCvFrame()
cam_deltatime = in_rgb.getTimestamp()
cam_time = cam_deltatime + offset