uzh-rpg / rpg_dvs_ros

ROS packages for DVS
MIT License
300 stars 155 forks source link

TimeStamp Reset Problem. #79

Closed YongjianDeng closed 6 years ago

YongjianDeng commented 6 years ago

Hi,

After I using rosbag record to recording my Davis data, I used dvs_write_file( extract_davis_bag.py) to obtain internal data. However, I notice that time stamps in the file event.txt did not be reset to 0.0000. Is there something wrong with my operation or some details have been missed through my process?

BW,

Thank you.

YongjianDeng commented 6 years ago

The first several events in my event.txt file as shown below: 1541226409.383780032 158 33 0 1541226409.383813032 22 54 0 1541226409.383820032 216 8 0 1541226409.383971032 32 59 0 1541226409.384108032 74 43 0 1541226409.384279032 168 146 1 1541226409.384279032 108 40 0 1541226409.384415032 168 11 0 1541226409.384441032 154 2 0 1541226409.384513032 76 64 0 1541226409.384521032 230 13 0 1541226409.384624032 2 68 0 1541226409.384647032 10 70 0

guillermogb commented 6 years ago

Hi. I think this is normal. If you want the timestamps to start at zero you have to subtract the timestamp of the first event from all of them. Regards.

YongjianDeng commented 6 years ago

Hi,

I tried this subtract the timestamp of the first event from all of them. However, I found that even though I record a Davis rosbag for about 10 sec, I only get about 0.3-sec change in the timestamp. I used equation below to calculate: (event.timestamp - firstEvent.timestamp)*1e-9. And I also notice that in extract_davis_bag_file.py script, the reset_time operation has been added already, have you ever seen this type of results?

Thanks.

guillermogb commented 6 years ago

True, the reset_timestamp option is available in the python script. I just run a quick test and it seems to work fine. I used the slider_depth.bag from the Event Camera Dataset

Command:

python extract_davis_bag_files.py path_to_file/slider_depth.bag  --reset_time

Output:

To extract depth image of simulated scenes, please install OpenEXR and Imath
Reset time: 1461581614.988127335
All data extracted!
Events:       1078541
Images:       87
Depth maps:   0
IMU:          0
Ground truth: 339
Removed IMU file since there were no messages.
Removed depthmaps file since there were no messages.

It created several files, including events.txt, whose first ten lines are:

0.003811000 96 133 0
0.003820001 127 171 0
0.003836000 4 160 0
0.003837000 149 122 0
0.003848001 63 121 1
0.003849001 17 144 1
0.003852000 92 119 0
0.003866001 16 137 1
0.003875000 156 71 0
0.003879000 26 149 0

so they indeed have the timestamp offset (1461581614.988127335) removed.

YongjianDeng commented 6 years ago

Sorry for taking you too much time. Thank you for your help, I really appreciated that.

guillermogb commented 6 years ago

No worries