uzh-rpg/rpg_trajectory_evaluation

Empty estimate file

Opened this issue · 4 comments

I got a bug that my stamped_est_gt_matched.txt file is empty, when I try to evaluate the result I got from VINS-FUSION and VINS-MONO. Terminal shows :
UserWarning: loadtxt: Empty input file: "plot_folder/saved_results/traj_est/stamped_est_gt_matches.txt"
matches = np.loadtxt(fn_matches, dtype=int)
Saved matching results to plot_folder/saved_results/traj_est/stamped_est_gt_matches.txt.
Empty estimate file.
Loading data failed.
Trials 0 fails, will not count.
===> MulTrajError: summarized 0 trajectories.

  • Successs indices: []
    No success runs, not plotting.

Plotting absolute error for one trajectory...
Traceback (most recent call last):
File "catkin_rpg_trajectory_evaluation/src/rpg_trajectory_evaluation/scripts/analyze_trajectory_single.py", line 176, in
pu.plot_trajectory_top(ax, plot_traj.p_es_aligned, 'b', 'Estimate')
NameError: name 'plot_traj' is not defined

I have also checked that my stamped_groundtruth.txt and stamped_traj_estimat.txt, the format is right that contains timestamp, translation vector and quaternion.

Could it be that the numbers in your .txt files are rounded off?

I encountered the same issue, but it was resolved once I used std::fixed when writing the .txt files.

@yuchenweng-private hey pal, could you solve this issue?

First, I suggest you to erase the 'saved_results' folder when you run it every time.
It's because it read the old file if there exists one, and if there was same issue before, the file would be empty as you can see in your UserWarning log.

The reason of the empty file may be because the 'matches' of the timestamps is empty.

You can check it by checking 'potential_matches' in 'associate_timestamps.py' line 62 is empty or not.

If then, try to explicitly set 'max_diff'(default is 0.02) as bigger value(e.g. 0.05) in 'traj_loading.load_stamped_dataset()' in 'trajectory.py' line 134.

Anyone has solved this issue?