MCPcopy Create free account
hub / github.com/AGC-Drive/AGC-Drive / read_gps_csv

Function read_gps_csv

ToolBox/icp_python/script.py:188–203  ·  view source on GitHub ↗

从CSV读取GPS数据

(csv_path, target_time)

Source from the content-addressed store, hash-verified

186 log_info(f"失败文件: {total_files-success_files} ({(total_files-success_files)/total_files:.1%})")
187
188def read_gps_csv(csv_path, target_time):
189 """从CSV读取GPS数据"""
190 target_time_int = int(round(target_time * 10))
191 try:
192 with open(csv_path, 'r') as f:
193 reader = csv.DictReader(f)
194 for row in reader:
195 if int(row['Time']) == target_time_int:
196 return [
197 float(row['Latitude']),
198 float(row['Longitude']),
199 0.0, # 海拔暂设为0
200 float(row['heading'])
201 ]
202 except:
203 return None
204
205def read_imu_csv(csv_path, target_time):
206 """从CSV读取IMU数据"""

Callers 1

process_single_fileFunction · 0.70

Calls 1

openFunction · 0.50

Tested by

no test coverage detected