BrettRD / ros-gst-bridge

a bidirectional ros to gstreamer bridge and utilities for dynamic pipelines
Other
128 stars 30 forks source link

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

Open keniee opened 4 months ago

keniee commented 4 months ago

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 commented 4 months ago

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:

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!