Open michaelnguyen11 opened 8 months ago
I print that the time difference between rectified left and right frames is around 7–13us.
For my case, to avoid some peak in a different timestamp, I put the condition in less than 100us.
- if(left->getSequenceNum() != right->getSequenceNum()) {
+ if(left->getSequenceNum() != right->getSequenceNum() && std::chrono::duration_cast<std::chrono::microseconds>(right->getTimestamp() - left->getTimestamp()).count() >= 100) {
RCLCPP_WARN(getROSNode()->get_logger(), "Left and right rectified frames are not synchronized!");
} else {
Hi, thanks for the feature idea, for now it's hard to estimate ETA on that, but feel free to open a PR with the changes, from my side following things need to be considered:
depthai-core
that will allow easier syncing of multiple messages, after that is available it will be added to depthai_ros_driver
Start with the
why
:The
syncTimerCB
in stereo node uses sequence number syncing for the rectified left and right frames. I would like to have timestamp syncing in the stereo node wheni_publish_synced_rect_pair
is enabled.Move to the
what
:I'm using OAK-FFC-4P + AR0234 stereo pair. Right now, the OAK-FFC-4P have not had hardware synchronization yet, debate is still continue. So I'm using software synchronization which is enabled by default in DepthAI library. The rectified left and right frame on my OAK-FFC-4P are not matching in term of sequence number, but it's matching perfectly in term of timestamp. Mr. Erik in
Luxonis forum
said it's expected behavior, and suggest me to open a feature-request todepthai-ros
Move to the
how
:Add timestamp syncing option in
syncTimerCB
of Stereo Node. My idea is compare left and right timestamp, if it is less than sub-ms, then the Left and right rectified frames are synchronized. For example :