ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ueye_cam timestamp is 3600 seconds old - How to correct?

asked 2016-02-29 04:29:35 -0600

I'm running a ueye_cam node as follows:

<node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager" />

<node pkg="nodelet" type="nodelet" name="ueyecam" args="load ueye_cam/ueye_cam_nodelet nodelet_manager">
    <param name="camera_name" value="ueyecam" />
    <param name="image_width" value="1600" />
    <param name="image_height" value="1200" />
    <param name="frame_name" value="ueyecam" />
    <param name="camera_intrinsics_file" value="ueyecam.yaml" />
    <param name="frame_rate" value="15" />
    <param name="exposure" value="10" />
</node>

But in contrast to other nodes and the official unix timestamp, the timestamp of the /ueyecam/image_raw message is 3600 seconds (=1 hour) old. I wouldn't care much, but my robot_localization_ekf node rejects such old messages and I'm getting warnings on the console output concerning the detected AR markers:

Warning: TF_OLD_DATA ignoring data from the past for frame ar_marker_18 at time 1.45674e+09 according to authority unknown_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
         at line 260 in /tmp/binarydeb/ros-indigo-tf2-0.5.12/src/buffer_core.cpp
Warning: Warning: TF_OLD_DATA ignoring data from the past for frame ar_marker_18 at time 1.45674e+09 according to authority unknown_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
         at line 260Warning: TF_OLD_DATA ignoring data from the past for frame ar_marker_18 at time 1.45674e+09 according to authority unknown_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
         at line 260 in /tmp/binarydeb/ros-indigo-tf2-0.5.12/src/buffer_core.cpp
TF_OLD_DATA ignoring data from the past for frame ar_marker_18 at time 1.45674e+09 according to authority /ueyecam_alvar
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
         at line 260 in /tmp/binarydeb/ros-indigo-tf2-0.5.12/src/buffer_core.cpp
 in /tmp/binarydeb/ros-indigo-tf2-0.5.12/src/buffer_core.cpp
Warning: TF_OLD_DATA ignoring data from the past for frame ar_marker_18 at time 1.45674e+09 according to authority unknown_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
         at line 260 in /tmp/binarydeb/ros-indigo-tf2-0.5.12/src/buffer_core.cpp

Is there a way to define a time offset for ROS nodes? Or do I really need a helper node fixing the timestamp?

edit retag flag offensive close merge delete

Comments

IIRC, the timestamp actually comes from the camera itself. Have you checked the time on the camera? 1 hour seems like a daylight saving or timezone issue.

gvdhoorn gravatar image gvdhoorn  ( 2016-02-29 05:32:57 -0600 )edit

@gvdhoorn: Sure, looks like a wrong timezone. But I'm not sure how to check the camera time. Does it really has an own clock? (This is the camera: https://en.ids-imaging.com/store/ui-3... )

Falko gravatar image Falko  ( 2016-02-29 05:44:53 -0600 )edit

You should be able to configure the camera using the IDS tools. I just remember the ethernet based cameras to have their own date/time setting. I'm not saying that it is the cause of what you're seeing, but an offset of exactly 3600 seconds is a bit suspicious.

gvdhoorn gravatar image gvdhoorn  ( 2016-02-29 06:39:00 -0600 )edit

I would also recommend to report this a the ueye_camissue tracker. Anqi is pretty responsive.

gvdhoorn gravatar image gvdhoorn  ( 2016-02-29 06:43:10 -0600 )edit

Ok, I contacted IDS about this issue. I couldn't find such a setting in the camera manager, but maybe I overlooked something. If they can't help, I might file a bug for ueye_cam.

Falko gravatar image Falko  ( 2016-02-29 07:48:56 -0600 )edit

Just curious: did you ever figure this one out?

gvdhoorn gravatar image gvdhoorn  ( 2016-03-10 03:20:03 -0600 )edit

@gvdhoorn: No, I'm still using the workaround described below. The IDS support replied referring to the u64TimestampDevice property of the UEYEIMAGEINFO structure. But since I'm using the ueye_cam node and don't want to implement it myself, I'll stick with my workaround for now and file an issue.

Falko gravatar image Falko  ( 2016-03-15 16:41:04 -0600 )edit

I reported the issue to ueye_cam: https://github.com/anqixu/ueye_cam/is...

Falko gravatar image Falko  ( 2016-03-15 16:53:49 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-02-29 06:38:15 -0600

updated 2016-02-29 06:38:46 -0600

As a workaround, I decided to implement a timeshift node which shifts the timestamp to the current hour. Here is the complete Python code and my ueyecam launch file:

timeshift.py:

#!/usr/bin/env python
import rospy
import sys
from sensor_msgs.msg import Image
import numpy as np

def callback(data):
    data.header.stamp += rospy.Duration.from_sec(np.round((rospy.Time.now() - data.header.stamp).to_sec() / 3600.0) * 3600.0)
    pub.publish(data)

if __name__ == "__main__":

    if len(sys.argv) < 3:
        raise Exception("Usage: %s input_topic output_topic" % sys.argv[0])

    rospy.init_node("timeshift")

    pub = rospy.Publisher(sys.argv[2], Image, queue_size=1)
    rospy.Subscriber(sys.argv[1], Image, callback, queue_size=1)

    rospy.spin()

ueyecam.launch:

<launch>    

  <arg name="camname" />

  <node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager" />

  <node pkg="nodelet" type="nodelet" name="$(arg camname)" args="load ueye_cam/ueye_cam_nodelet nodelet_manager">
    <param name="camera_name" value="$(arg camname)" />
    <param name="image_width" value="1600" />
    <param name="image_height" value="1200" />
    <param name="frame_name" value="$(arg camname)" />
    <param name="camera_intrinsics_file" value="$(find camera)/launch/$(arg camname).yaml" />
    <param name="frame_rate" value="15" />
    <param name="exposure" value="10" />
    <remap from="~/image_raw" to="~/image_raw_old" />
  </node>

  <node pkg="camera" type="timeshift.py" name="timeshift" args="/$(arg camname)/image_raw_old /$(arg camname)/image_raw" />

</launch>
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-02-29 04:29:35 -0600

Seen: 317 times

Last updated: Feb 29 '16