diff --git a/libs/vslam_perception/src/perception_pipeline.cc b/libs/vslam_perception/src/perception_pipeline.cc index 8a1f315..9da356e 100644 --- a/libs/vslam_perception/src/perception_pipeline.cc +++ b/libs/vslam_perception/src/perception_pipeline.cc @@ -5,6 +5,8 @@ #include "vslam/depth_to_cloud.h" #include "vslam/geometry.h" +#include + #include "vslam/log.h" namespace vslam { @@ -71,6 +73,30 @@ PerceptionOutput PerceptionPipeline::Process(const Image& depth, const CameraInf << (cr.judged ? " (thay vuc THAT)" : " (KHONG phan xet duoc -> fail_safe)") << " -- mu lien tuc " << cr.bail_held << " s, n_cliff=" << cr.n_cliff); + + // Mat phang san khop duoc, quy ve he base. Hai so nay CHINH LA sai so + // ngoai lai cua camera, nen in kem ca hieu chinh suy ra tu chung: + // + // lvl_z0 = do cao cua mat phang tai chan robot. Dung ra ~0. Lech + // bao nhieu thi camera_link.z trong robot.yaml sai bay + // nhieu (nguoc dau). + // lvl_slope = do doc cua mat phang trong he base. Dung ra ~0. Doc + // bao nhieu thi goc chuc camera sai bay nhieu. + // + // In o day thay vi bat nguoi doc mo web: `offset_large` mot minh chi + // noi "sai", khong noi sai bao nhieu va sai o dau. + if (out.cliff_detail == std::string("offset_large") || + out.cliff_detail == std::string("residual_large") || + out.cliff_detail == std::string("slope_clamped")) { + const double pitch_err_deg = std::atan(cr.lvl_slope) * 180.0 / M_PI; + VSLAM_WARN_THROTTLE(5.0, + "cliff: mat phang khop duoc: z0=" << cr.lvl_z0 << " m (dung ra ~0), " + << "doc=" << cr.lvl_slope << " (" << pitch_err_deg << " do), mad=" + << cr.lvl_mad << " m.\n" + " -> camera_link.z trong robot.yaml lech " << -cr.lvl_z0 << " m\n" + " -> goc chuc camera lech " << pitch_err_deg << " do" + " (rpy pitch hien tai co the sai)"); + } } if (!cr.edge_cloud.points.empty()) { out.cloud_cliff = std::make_shared(std::move(cr.edge_cloud));