Hi!

What is the logic behind assigning the sequence number to the message? Is it possible to calculate the expected next sequence number on the host side somehow? I notice it probably starts at 1, but it does not increment by 1.

Thanks!

    Hi Kristoffer
    Each time a frame is taken on colorcamera or monocamera nodes, the message also receives a sequence number so that it can be used for syncinc purposes.

    It is possible to calculate the sequence number by knowing the fps and the time passed.

    Kristoffer notice it probably starts at 1, but it does not increment by 1.

    Do you have an example where sequence numbers do not increment by 1? They should, that's why I'm asking. Some frames might get discarded along the way because the queue is full and set to non-blocking.

    Thanks,
    Jaka

    Hi!

    Currently I am running a basic still image solution using

    capture_cmd = dai.CameraControl()
    capture_cmd.setCaptureStill(True)

    I run a trigger every 500ms using the following:

    def should_trigger(trigger_timestamp, every_ms=500):
        if trigger_timestamp is None:
            return True
    
        delta = (dai.Clock.now() - trigger_timestamp).total_seconds() * 1000
    
        return delta >= every_ms

    From the main-loop:

        trigger_timestamp = None
        while True:
                if should_trigger(trigger_timestamp):
                    trigger_timestamp = dai.Clock.now()
    
                    for _, q in q_map_in:
                        q.send(capture_cmd)

    When receiving the messages the sequence numbers seems to depend on the timing of the trigger (adjusting 500ms)

    I am using a blocking queue with length 1

      Hi Kristoffer
      Still output will create an ISP in the background, which means that even when still is not triggered, the camera will still capture frames in the background and discard them. This will increment the sequence number for every frame. Setting fps to 10 in your code will give you every 5th frame. 10frames/s * 0.5s = 5frames.

      Thanks,
      Jaka