Open bmegli opened 1 year ago
The original ROS wrapper was made in that way. We added a separate publishing thread when other users (too much to not listen to their request) asked to publish data at a lower frequency than the grab frequency.
I can understand your requirement, you can apply your modification if you need it. I'm sorry, but we are not planning major changes to the ROS wrapper since ROS is close to EOL and most of the ROS users are moving to ROS 2.
Thank you @Myzhar
Oh, ok, I now see this was improved in ROS2
In that case, thank you for a quick answer.
For anybody in need to remove added latency in ROS1 fix is in:
To keep compatibility with existing behavior:
pub_frame_rate > 0
- works as usualpub_frame_rate == 0
- (not valid value before)
All above was used to keep existing threading model and behavior compatibility.
@Myzhar
We avoid maintaining third-party forks if possible.
If the fix looks like something mergeable we are happy to open pull request (and adapt as requested).
If not let me know, I will close the issue.
Preliminary Checks
Proposal
Publish depth/rgb data after grabbing instead of:
With:
This is adding worst case single frame latency (publish just before new data) and half frame latency on average.
Use-Case
Any low-latency ROS application needing depth/RGB data
Anything else?
grab thread (std::thread)
https://github.com/stereolabs/zed-ros-wrapper/blob/50dda077a5ea72b7f8c00faad5746938331e46c2/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp#L3158
ROS publish thread (ROS thread)
https://github.com/stereolabs/zed-ros-wrapper/blob/50dda077a5ea72b7f8c00faad5746938331e46c2/zed_nodelets/src/zed_nodelet/src/zed_wrapper_nodelet.cpp#L569
Run separately
It may be possible to keep current code structure and trigger ROS publishing after successful grab (as opposed to timer based publishing)