-
Notifications
You must be signed in to change notification settings - Fork 444
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
Request: ability to publish pointcloud2 messages with (epoch-based) Timestamps #1
Comments
For others: The solution for this is to use ptp4l and properly setup time synchronization on the ROS network. the user manual covers configuring the unit with plaintext tcp commands. so that it will look for PTP master from which to syncnronize it's time basis. |
can you provide more details on how to do this? |
I'd like to know as well, I've been trying since yesterday with no success. |
I used the example code provided here: https://github.com/ouster-lidar/ouster_example/blob/master/ouster_ros/src/os1_ros.cpp and set msg.header.stamp = ros::Time:now() instead of msg.header.stamp.fromNSec(timestamp.count()); |
Hi Jepierre, thanks for contributing to the discussion. I thought about doing that myself, and it would certainly fix things in the short term. However, that makes the message have timestamp of when it was parsed by ROS, not when it was captured. If you are trying to combine this with other sensors and/or odometry it will probably cause issues. |
@oscarmendezm it was a quick fix for me because in order to create PTP master on my computer, my NIC has to support hw or software timestamping. Which it doesn't. I think the steps to @eric-schleicher solutions are:
You can check if your NIC support timestamping: Unfortunately that didn't work for me since I don't have PTP enabled NIC. you can learn more about PTP here: https://docs.fedoraproject.org/en-US/Fedora/22/html/System_Administrators_Guide/sec-Starting_ptp4l.html |
Thanks for the instructions jepierre. I tried all of that, but I couldn't get the timestamps to come from the pc. My NIC supports SW timestamps, and as far as I can tell that should be enough? |
Software sync works, but you should analyze if for your application is precise enough. |
Hi all, I just got this running. I modified our fork of the ros driver to always start in ptp mode and reject measurements until a sync has occured ethz-asl#1 |
@ZacharyTaylor thanks, that seems to work well! |
everyone should note that if you adapter doesn't support hardware timestamping, you can run with software timestamping. for example |
When giving the command "set_timestamp_mode TIME_FROM_PTP_1588" I get "error: Command not recognized." Edit: Never mind, it was documented in the manual. If you find this, the new syntax is: |
Hi there, I'm new to ROS and was wondering if anyone could explain why this is? Thanks |
I was able to get ouster OS-1 setup and running quickly. We were able to setup the launch files, start the node and view in RVIZ using fixed frame [os1] in less than 15 minutes Nice!
I've moved on to integrate with the rest of my ROS system, but running into a small issue with TF and timestamps. I've rigidly mounted the OS1 and have a static transforms configured (which works as expected), however cannot visualize the PointCloud2s in my TF tree in RVIZ because the pointcloud2 timestamps are "too old"
Poking through the code, it appears that the ROS node publishes PointCloud2 messages with stamp values that are handed over from the driver as sequence (ns) value (based the start of the device or node?), rather than a more traditional ROS epoch-based timestamp.
It looks like there are two places a change could be made, but i thought i would ask here, since i expect other people will want to visualize ouster data in TF Trees where the time bases are (traditional) epoch based timestamps. I'm also much more adept at python, and would likely screw it up in c++.
The text was updated successfully, but these errors were encountered: