-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optionally use stored timestamps when publishing from svo files #763
base: master
Are you sure you want to change the base?
Conversation
What's the goal of this PR? Please describe it in detail because I cannot understand the logic behind it. |
I want to play back svo files through the nodelet, but use the timestamps stored in the svo instead of the current time in every published message header. Mostly I plan on recording out selected topics to bag files (ideally at faster than real time if possible, that could be in a future PR), then those bag files ought to be time synced to other bag files for non-zed topics recorded at the same time as the svo. |
OK, I supposed it. To use simulated time you need to set a global parameter |
I pushed in a few more commits that clean up my changes a little, hopefully make it more clear what I'm doing. I'm not sure in every instance on usage of zed
I'm not understanding you here. If It is odd the way the same node is both publishing a clock and subscribing to it when use_sim_time is There could be some case where /use_sim_time is true and there is another clock source (like gazebo, but using a saved svo with a sim seems like an odd use case, but if there is no way to feed sim stereo images into this node maybe it's a good test case), if that is a concern there needs to be another param to enable the zed sim time clock publisher. |
The problem is that if you do not set |
I've made it in this PR that /clock isn't published out of the zed node if use_sim_time is false, so every node is using consistent time as long as they all start up with the same use_sim_time. If ros nodes are started before and after a change to use_sim_time then time across the system gets confused, but that has always been true. I think this function encapsulates the intent here, it could be missing strange cases where mSvoMode is false, but use_sim_time is true- the user wants to connect to a real camera, but inject sim timestamps into all the topics, so in that case use ros::Time::now()?
I'm trying to parallel If I'm not describing the changes well it could be worth compiling this and playing back an svo with use_sim_time true and then false and comparing the header stamps of different zed topic outputs. And maybe there is some combination of other parameters or nodes I'm not testing with that demonstrates the issue that could be listed in detail? |
OK, I begin to understand how it works and it seems promising. |
ros/ros_comm#1492 appears to describe that same issue, and there was a PR fix to use wall clock that was merged. I didn't see it in noetic but maybe the launch file I was using didn't use zed in nodelet form. |
Interesting, I was not aware of it. Thank you |
…ssage headers rather than current wall time. Sim clock appears to be working, may have some odd glitches, may mess up non svo-playback modes Adjusting some of the timestamps, not sure if all pubs are using good timestamps, some of the static frames are timestamp 0 (but that's okay for static frames?), need to figure out if faster than real time playback is possible- there must be an api that allows read frames quickly, but maybe ruled out here. Make a function to centralize getting of time from the image or current time, clean up some other stamp usage Not clear on use of timestamps CURRENT vs ros::Time::now()
225dc2f
to
0219d5c
Compare
Haven't tested this extensively or inspected the timestamp in every possible published message, with some feedback could move this out of draft.
Rebased version in https://github.com/lucasw/zed-ros-wrapper/tree/svo_playback_timestamps_rebased but haven't tested it yet.
The way the node is generating sim time by using the last timestamp out of the svo, then stepping forward in small increments, then skipping forward to the next stored timestamp when it becomes available is maybe not the best, but seems to work ok.
Resolves #411