Skip to content
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

Taking advantage of ROS header to store timestamps and frame_id #38

Open
adeguet1 opened this issue Dec 5, 2022 · 1 comment
Open

Comments

@adeguet1
Copy link
Collaborator

adeguet1 commented Dec 5, 2022

Whenever we use a ROS message with a header there is a timestamp and a frame_id. We should take advantage of this both when receiving from ROS and when sending to ROS.

In general, it would be good to see if the VTK MRML nodes already has some kind of timestamp. If they do, we should provide some conversion methods.

In subscribers, the callback could preserve both the timestamp and the frame_id along the last message. We can then add methods to retrieve these, something like GetLastTimestamp and GetLastFrameId. I implemented something similar for cisst-ros, see https://github.com/jhu-cisst/cisst-ros/blob/devel/cisst_ros_bridge/include/cisst_ros_bridge/mtsROSToCISST.h#L72.

In publisher, if the VTK data we're sending has a timestamp, we should use it and convert to ROS. If it doesn't, we should use the current ROS time.

@adeguet1
Copy link
Collaborator Author

It seems VTK objects all have an object name, see https://vtk.org/doc/nightly/html/classvtkObject.html#a596da3ed5dfb4179182c7868bf915178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant