This commit is contained in:
trung09122002
2026-09-19 19:45:26 +07:00
parent 823e895d78
commit ce06dde31e

View File

@@ -5,6 +5,8 @@
#include "vslam/depth_to_cloud.h"
#include "vslam/geometry.h"
#include <cmath>
#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<const PointCloudXYZ>(std::move(cr.edge_cloud));