9
9
from evo .core .trajectory import PoseTrajectory3D
10
10
from evo .tools import file_interface
11
11
12
- sys .path .append ("/home/mice85/oxford-lab/labrobotica/algorithms/oxford_spires_dataset" )
13
-
14
- from oxford_spires_utils .bash_command import run_command
15
-
16
12
17
13
def run_fast_lio_slam (path_to_rosbag , path_to_output ):
18
14
@@ -94,84 +90,4 @@ def convert_to_tum (path_to_output, path_to_sec):
94
90
95
91
print ("PROCESS FINISHED!!" )
96
92
print ("Output in: {}/output_slam/fast_lio_tum.txt" .format (path_to_sec ))
97
- print ("*********************************************************" )
98
-
99
-
100
- def eval_fast_lio_slam (path_to_gt , path_to_output , package_dir , path_to_sec , dataset_dir ):
101
-
102
- path_traj = path_to_sec + "/output_slam" + "/fast_lio_tum.txt"
103
- output = run_command ("evo_ape tum {} {} --align --t_max_diff 0.01" .format (path_to_gt , path_traj ), print_output = False )
104
-
105
- rmse = - 1
106
- for line in output .stdout :
107
- print (line , end = "" )
108
- if "rmse" in line :
109
- numbers = re .findall ('\d+\.\d+|\d+' , line )
110
- rmse = numbers [0 ]
111
-
112
- logging .basicConfig (filename = dataset_dir + "results.log" , filemode = "a" , level = logging .INFO )
113
- logging .info (path_to_sec )
114
- logging .info ("APE - RMSE result (Fast_LIO-SLAM): {}" .format (rmse ))
115
- print ("RMSE added to log: {}" .format (rmse ))
116
-
117
- def create_output_folder (path_to_sec ):
118
- path_to_output = path_to_sec + "/output_slam" + "/fastlio_raw_output/"
119
- if not os .path .exists (path_to_output ):
120
- os .makedirs (path_to_output )
121
- return path_to_output
122
-
123
- def get_sec_list (dataset_dir , flag_is_all = True ):
124
- if flag_is_all :
125
- list_sec = os .listdir (dataset_dir )
126
- else :
127
- list_sec = [
128
- "2024-03-12-keble-college-02" ,
129
- "2024-03-12-keble-college-03" ,
130
- "2024-03-12-keble-college-04" ,
131
- "2024-03-12-keble-college-05" ,
132
- "2024-03-13-observatory-quarter-01" ,
133
- "2024-03-13-observatory-quarter-02" ,
134
- "2024-03-14-blenheim-palace-01" ,
135
- "2024-03-14-blenheim-palace-02" ,
136
- "2024-03-14-blenheim-palace-05" ,
137
- "2024-03-18-christ-church-01" ,
138
- "2024-03-18-christ-church-02" ,
139
- "2024-03-18-christ-church-03" ,
140
- "2024-03-20-christ-church-05" ,
141
- "2024-05-20-bodleian-library-02" ,
142
- "2024-05-20-bodleian-library-03" ,
143
- "2024-05-20-bodleian-library-04" ,
144
- "2024-05-20-bodleian-library-05"
145
- ]
146
- return list_sec
147
-
148
- if __name__ == "__main__" :
149
-
150
- # -------------------------------------------------------------------------------- #
151
- # TODO: get path from arg an define folders in the future class.
152
- package_dir = "/home/mice85/oxford-lab/labrobotica/algorithms/oxford_spires_dataset"
153
- dataset_dir = "/media/mice85/blackdrive1/oxford_spires_dataset/data/"
154
- flag_is_all = False
155
- # -------------------------------------------------------------------------------- #
156
-
157
- list_sec = get_sec_list (dataset_dir , flag_is_all )
158
-
159
- print ('Total sequence folders: ' + str (len (list_sec )))
160
-
161
- # Print list of sequences
162
- for sec in list_sec :
163
-
164
- path_to_sec = dataset_dir + sec
165
- path_to_rosbag = "/home/mice85/data/" + sec + "/rosbag/" #path_to_sec + "/rosbag/"
166
- path_to_gt = path_to_sec + "/ground_truth_traj/gt_lidar.txt"
167
- path_to_output = create_output_folder (path_to_sec )
168
-
169
- run_fast_lio_slam (path_to_rosbag , path_to_output )
170
-
171
- time .sleep (5 )
172
-
173
- convert_to_tum (path_to_output , path_to_sec )
174
-
175
- eval_fast_lio_slam (path_to_gt , path_to_output , package_dir , path_to_sec , dataset_dir )
176
-
177
- # break
93
+ print ("*********************************************************" )
0 commit comments