零漂数据采集拟合
This commit is contained in:
@@ -13,12 +13,14 @@ def load_samples(csv_path: Path):
|
||||
with csv_path.open("r", encoding="utf-8", newline="") as f:
|
||||
reader = csv.DictReader(f)
|
||||
fieldnames = reader.fieldnames or []
|
||||
if "gyro_raw_z_rad_s" in fieldnames:
|
||||
if "gyro_z_filtered_pre_bias" in fieldnames:
|
||||
source_name = "gyro_z_filtered_pre_bias"
|
||||
elif "gyro_raw_z_rad_s" in fieldnames:
|
||||
source_name = "gyro_raw_z_rad_s"
|
||||
elif "imu_angular_velocity_z" in fieldnames:
|
||||
source_name = "imu_angular_velocity_z"
|
||||
else:
|
||||
raise ValueError("CSV does not contain gyro_raw_z_rad_s or imu_angular_velocity_z")
|
||||
raise ValueError("CSV does not contain gyro_z_filtered_pre_bias, gyro_raw_z_rad_s, or imu_angular_velocity_z")
|
||||
for row in reader:
|
||||
t = row.get("elapsed_s")
|
||||
z = row.get(source_name)
|
||||
|
||||
Reference in New Issue
Block a user