零漂数据采集拟合

This commit is contained in:
2000-01-01 08:38:51 +08:00
parent b14befd1cf
commit 2f51de27e5
6 changed files with 1430 additions and 37 deletions

View File

@@ -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)