First of all, I check initial and final timestamps.
auto n = zed.getSVONumberOfFrames();
zed.grab(runParameters);
auto ts0 = zed.getTimestamp(sl::TIME_REFERENCE::IMAGE);
zed.setSVOPosition(n-2);
zed.grab(runParameters);
auto ts1 = zed.getTimestamp(sl::TIME_REFERENCE::IMAGE);
RCLCPP_INFO(get_logger(), "SVO file starts at %f and ends at %f [duration: %f]", slTime2Ros(ts0).seconds(), slTime2Ros(ts1).seconds(), slTime2Ros(ts1).seconds()- slTime2Ros(ts0).seconds());
zed.setSVOPosition(0);
I get:
SVO file starts at 1741616106.944607 and ends at 1741616375.278633 [duration: 268.334026]
Then, I do:
int ret = zed.getSVOPositionAtTimestamp(1741616118701639000);
so I ask to seek a frame at a timestamp in between initial and final timestamp.
However, the index I get as result is the last frame of the SVO, not something that falls in the middle. This is not expected.