IntelRealSense / realsense_samples_ros

Sample code illustrating how to develop ROS applications using the Intel® RealSense™ ZR300 camera for Object Library (OR), Person Library (PT), and Simultaneous Localization And Mapping (SLAM).
Apache License 2.0
127 stars 92 forks source link

Incorrect time-stamp in slam /odom topic #19

Open mmoore13 opened 7 years ago

mmoore13 commented 7 years ago

Running roslaunch realsense_ros_slam demo_slam.launch and rostopic echo /odom displays messages with the following header format:

---
header: 
  seq: 813
  stamp: 
    secs: 186413771
    nsecs:         0
  frame_id: odom

The time-stamp here is not as expected.

Changing https://github.com/IntelRealSense/realsense_samples_ros/blob/9e98473e8bbd2826ff704c40311a8d149afa7a19/realsense_ros_slam/src/slam_nodelet.cpp#L399 to

odom.header.stamp = ros::Time(feTimeStamp / 1000);

seems to resolve the issue, yielding:

---
header: 
  seq: 102
  stamp: 
    secs: 1503427819
    nsecs: 480166912
  frame_id: odom

Line 380 looks like it should also be changed in the same way.

dashneptune commented 6 years ago

It would be nice if this could get fixed, this was causing calls to Time::now to get out of range of 32 bit for me and was causing the SLAM demo to fail