UZ-SLAMLab / ORB_SLAM3

ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM
GNU General Public License v3.0
6.41k stars 2.52k forks source link

Alignment and rescale of trajectories in EuRoC dataset #73

Closed squaresoft2015 closed 2 years ago

squaresoft2015 commented 4 years ago

The generated trajectories have different number of poses with ground truth. For example, ORB-SLAM3 generates 2674 poses in monocular mode and 2700 poses in stereo mode. But the officially provided dataset contains 26302 poses in ground truth file. How can I align the estimated poses with ground truth? I tried -va parameter but it promots: [ERROR] found no matching timestamps between reference and f_dataset-V101_mono.txt with max. time diff 0.01 (s) and time offset 0.0 (s) Any help? Thanks

richard-elvira commented 4 years ago

ORBSLAM3 only reports the trajectory at frame level, that means we only obtain the pose when an image exists. In the other hand, EuRoc provides a GT with other measure devices, in Machine Hall uses Leica and in Vicon Room an OptiTrack. For that reason the amount of poses is not the same.

squaresoft2015 commented 4 years ago

ORBSLAM3 only reports the trajectory at frame level, that means we only obtain the pose when an image exists. In the other hand, EuRoc provides a GT with other measure devices, in Machine Hall uses Leica and in Vicon Room an OptiTrack. For that reason the amount of poses is not the same.

Thank you so much! I have converted the groundtruh to TUM format. But when I plot the two trajectories in the same coordinate with rescale and alignment option, the evo program promopt: [ERROR] found no matching timestamps between reference and f_dataset-MH01_mono.txt with max. time diff 0.01 (s) and time offset 0.0 (s) How can I align them since the time stamp may not be in the corresponding position?

richard-elvira commented 4 years ago

Check the timestamp units, perhaps one of the files has the timestamps in seconds and the other in nanoseconds.

squaresoft2015 commented 4 years ago

Check the timestamp units, perhaps one of the files has the timestamps in seconds and the other in nanoseconds.

Yes, the generated trajectories have time stamp like this: 1403636579863555584.000000 0.000043671 0.008587432 0.003351578 -0.000423142 0.004911167 -0.002808022 0.999983907 But the converted ground truth has time stamp like this: 1.403637132888319016e+09 4.631116999999999706e+00 -1.786812000000000067e+00 5.771129999999999871e-01 -1.563670000000000060e-01 -7.763449999999999518e-01 -7.222900000000000154e-02 6.063169999999999948e-01 I converted the first entry into the format of "1403636580838555.000000" and the TUM style ground truth is: 1403636580838555.000000 4.688319 -1.786938 0.783338 -0.082152 -0.153029 -0.827383 0.534108 The evaluation tool still prompts the same error.

richard-elvira commented 4 years ago

The timestamp units are differents. 1403636579863555584.000000 // Timestamp of the trajectory 1403636580838555.000000 // Timestamp in your converted GT

You need to multiply the timestamps in your converted GT by 1e3 to obtain the same unit than the trajectory timestamps.

squaresoft2015 commented 4 years ago

The timestamp units are differents. 1403636579863555584.000000 // Timestamp of the trajectory 1403636580838555.000000 // Timestamp in your converted GT

You need to multiply the timestamps in your converted GT by 1e3 to obtain the same unit than the trajectory timestamps.

Thank you for your reply! I have multiplied the timastamps by 1000, but the error remains the same. I notice the timestamp in data.csv (ground truth) is 1403637132888310000 and the corresponding timestamp in trajectory file is 1403636579863555584.000000. The two digits vary a lot.

254843 commented 3 years ago

Hey! I also met the problem of real pose and estimated pose timestamp. Have you solved it? @squaresoft2015

dinarkino commented 3 years ago

Hey! I also met the problem of real pose and estimated pose timestamp. Have you solved it? @squaresoft2015

Hey, I solved the problem by using an advice from here. You should do something like that with an estimated pose with the help of evo package or manually.

from evo.tools import file_interface

traj = file_interface.read_tum_trajectory_file("vins_V102.txt")

traj.timestamps = traj.timestamps / 1e9

file_interface.write_tum_trajectory_file("vins_V102_clean.txt", traj)
jdtardos commented 2 years ago

Pleas, check version v1.0