ros-drivers / libuvc_ros

http://www.ros.org/wiki/libuvc_ros
82 stars 95 forks source link

No time stamp #44

Open robotsoft opened 6 years ago

robotsoft commented 6 years ago

There is no time stamp in /image_raw/header when I run rosrun libuvc_camera camera_node. I'm using Orbbec Astra Pro camera in Ubuntu16.04 and ROS Kinectic.

Here is one of example of /image_raw/header.

seq: 35 stamp: secs: 0 nsecs: 0 frame_id: camera

k-okada commented 6 years ago

the timestamp is simply copied from uvc_driver (https://github.com/ros-drivers/libuvc_ros/blob/master/libuvc_camera/src/camera_driver.cpp#L165 ) , and if that is zero, then it libuvc driver failed to grab capture time, may be better to ask at https://github.com/ktossell/libuvc

doisyg commented 6 years ago

same issue here, I replaced the timestamp initialization by ros::Time::now() as it was breaking my application. See here: https://github.com/doisyg/libuvc_ros/blob/14f8929498531bf3820d1d107bae52737ee27934/libuvc_camera/src/camera_driver.cpp#L165 I will be interested to follow a proper fix from libuvc

k-okada commented 6 years ago

@doisyg, sorry for late replay, I found that libuvc never set timestamp(https://github.com/ktossell/libuvc/blob/master/src/stream.c#L1100) so I think it is libuvc_ros work to set timestamp

I have created the pull request here -> https://github.com/ros-drivers/libuvc_ros/pull/46