From 823e895d78fc7220200de0560f24a5c747d1fad4 Mon Sep 17 00:00:00 2001 From: trung09122002 Date: Sat, 19 Sep 2026 19:42:18 +0700 Subject: [PATCH] update --- libs/vslam_perception/src/perception_pipeline.cc | 16 ++++++++++++++++ libs/vslam_safety/src/safety_monitor.cc | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/libs/vslam_perception/src/perception_pipeline.cc b/libs/vslam_perception/src/perception_pipeline.cc index 1a17d91..8a1f315 100644 --- a/libs/vslam_perception/src/perception_pipeline.cc +++ b/libs/vslam_perception/src/perception_pipeline.cc @@ -56,6 +56,22 @@ PerceptionOutput PerceptionPipeline::Process(const Image& depth, const CameraInf CliffResult cr = cliff_.Process(depth, info, cam_to_base_, clock_.Now()); out.cliff_detected = cr.detected; out.cliff_detail = cr.judged ? "judged" : CliffBailName(cr.bail); + + // Bao LY DO ra log, khong chi ra web. + // + // cliff_detected = true co HAI nghia rat khac nhau: + // judged -> that su thay vuc + // -> detector khong phan xet duoc va fail_safe bat len + // Lop safety in cung mot cau cho ca hai, nen khong phan biet duoc tu log. + // Da mat nhieu thoi gian vi dieu do tren robot: "VUC phia truoc" lien tuc + // trong khi truoc mat trong khong. + if (cr.detected) { + VSLAM_WARN_THROTTLE(5.0, + "cliff: bao VUC, ly do=" << out.cliff_detail + << (cr.judged ? " (thay vuc THAT)" + : " (KHONG phan xet duoc -> fail_safe)") + << " -- mu lien tuc " << cr.bail_held << " s, n_cliff=" << cr.n_cliff); + } if (!cr.edge_cloud.points.empty()) { out.cloud_cliff = std::make_shared(std::move(cr.edge_cloud)); } diff --git a/libs/vslam_safety/src/safety_monitor.cc b/libs/vslam_safety/src/safety_monitor.cc index 1f60fbc..7d7d160 100644 --- a/libs/vslam_safety/src/safety_monitor.cc +++ b/libs/vslam_safety/src/safety_monitor.cc @@ -260,9 +260,14 @@ SafetyOutput SafetyMonitor::Step(const SafetyInputs& in) { out.cmd.linear.x = 0.0; // chan tien, GIU angular de con xoay ra out.cmd.angular.z = std::max(-cfg_.max_angular, std::min(cfg_.max_angular, out.cmd.angular.z)); + // Vung mu lay tu `cliff_window_min` cua chinh lan chay nay, KHONG hardcode. + // Truoc day cau nay ghi cung "~1.1 m"; khi camera ha xuong 0.3935 m thi + // vung mu thanh 0.55 m va thong bao noi sai -- nguoi van hanh doc xong se + // di tim vat can o nham cho. VSLAM_ERROR_THROTTLE(1.0, "safety: VUC phia truoc -- chan tien. Lui hoac xoay de " - "thoat. Cam bien nay MU duoi ~1.1 m."); + "thoat. Cam bien nay MU duoi ~" + << in.cliff_window_min << " m."); return finish(SafetyState::kCliffStop, "vuc phia truoc -- chan tien"); }