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

feat: add manual time offset to rosimagesink image publisher #63

Open
wants to merge 3 commits into
base: ros2
Choose a base branch
from

Conversation

keniee
Copy link

@keniee keniee commented Mar 12, 2024

This feature enables an offset time specified in nanoseconds to modify the timestamp of the published ros image topic. A parameter ros-time-offset is added as a specifier to rosimagesink.

Usage Example adds 10s to the current timestamp of a published image:
gst-launch-1.0 videotestsrc pattern=ball ! video/x-raw, format=RGB,width=1280,height=720 ! timeoverlay ! queue ! rosimagesink ros-topic=test/image ros-name='gst_rosimagesink_camera' ros-namespace='gst' ros-frame-id='camera_frame' ros-time-offset=10000000000 throttle-time=0

@BrettRD
Copy link
Owner

BrettRD commented Mar 17, 2024

Thanks for the PR!
I though offsets were possible using an upstream element to adjust the buffer timestamp, but I must have been imagining things.

The new prop looks good, I'm happy to include it with a few tweaks:

  • The offset is conditionally set according to its sign and can only move the timestamp into the future, but it seems desirable to be able to shift a timestamp into the recent past using a negative value.

  • This prop doesn't work on ros_audio_sink.

If you were to apply the timestamp in the render method of rosbasesink, it will correctly inherit to all of the other ros*sink types.
Try leaving the rosimagesink unmodified and simply add the time offset over here

Thanks again!

@russkel russkel mentioned this pull request Jun 19, 2024
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

Successfully merging this pull request may close these issues.

2 participants