This commit is contained in:
trung09122002
2026-09-19 19:25:01 +07:00
parent 3c275cf0af
commit c723397097
3 changed files with 75 additions and 39 deletions

View File

@@ -68,7 +68,8 @@ StatusResponse LoadAppConfig(const std::string& dir, AppConfig* out) {
const StatusResponse r =
Reject(l, "sensors.yaml lidar",
{"host", "port", "expected_rate_hz", "range_min", "range_max",
"stamp_mismatch_warn", "sector_masks"});
"stamp_mismatch_warn", "sector_masks",
"angle_offset_deg", "angle_flip"});
if (!r.ok()) return r;
}
out->sanitizer.range_min = l.get<double>("range_min", 0.05);
@@ -83,10 +84,16 @@ StatusResponse LoadAppConfig(const std::string& dir, AppConfig* out) {
out->lidar_driver.frame_id = kLaserFrame;
out->lidar_driver.sweep_duration_tolerance_sec =
l.get<double>("stamp_mismatch_warn", 0.005);
// ⚠️ range_unit_m, angle_offset_deg va inverted CO Y khong doc tu YAML.
// Ca ba deu suy ra duoc (xem driver_config.h): don vi mm tu SDK, va goc
// tu manual §8.1 + REP-103 + tu the gan up nguoc. De chung trong YAML moi
// la de nguoi van hanh go bua vao mot thu da co dap an dung.
// Goc DOC TU YAML, khong hardcode.
//
// Ban dau mac dinh o driver_config.h duoc coi la "da co dap an dung" nen
// khong cho doi. Sai: phep doi quy uoc phu thuoc TU THE GAN LiDAR, ma do
// la su that vat ly khong suy ra duoc tu tai lieu. De o YAML thi thu mot
// gia tri khac chi ton mot lan khoi dong lai, thay vi mot lan build.
out->lidar_driver.angle_offset_deg =
l.get<double>("angle_offset_deg", out->lidar_driver.angle_offset_deg);
out->lidar_driver.inverted =
l.get<bool>("angle_flip", out->lidar_driver.inverted);
// Sector mask ghi bang DO trong YAML (doc duoc bang mat), dung bang RAD.
// Doi mot lan o day, khong de moi noi tu doi.