ros-drivers / gscam

ROS Camera driver for GStreamer-based video streams.
136 stars 172 forks source link

fix: ros2 gstreamer timestamps #83

Closed drwnz closed 2 years ago

drwnz commented 2 years ago

Addresses #84 When use_gst_timestamps was is set to true, timestamps converted from the gstreamer buffer timestamps would be incorrect. This is a ROS2 specific issue, caused by no constructor for rclcpp::Time which takes the time parameter in seconds as a float type.

This PR:

It has been tested on Galactic. @wep21

wep21 commented 2 years ago

I confirmed the changes modified the timestamp in header even when use_gst_timestamps is true. before:

stamp:
  sec: 1
  nanosec: 655143410
frame_id: camera_frame

after:

stamp:
  sec: 1655143667
  nanosec: 434399126
frame_id: camera_frame
wep21 commented 2 years ago

@jbohren @clydemcqueen the changes look good to me. What do you think?

clydemcqueen commented 2 years ago

LGTM. I tested this on Galactic and it works as expected. Thanks @drwnz for finding & fixing and @wep21 for moving this forward!

I noticed a few unrelated bugs in the README:

/Clyde

wep21 commented 2 years ago

@clydemcqueen Thank you for confirming it. Could you create another PR to fix README?

wep21 commented 2 years ago

@drwnz Thank you for fixing the bug.

clydemcqueen commented 2 years ago

I submitted a PR to fix the README.