reloc,web: dinh vi lai TREN DOC (slope.enabled) -- loc gia thuyet bang do nghieng IMU vs do doc ban do, chan mu doc truc (ShiftScoreRatio), vong DUNG YEN khong xoay (ty le nho nhat >= 3 vong / hai cho cung pose), tu chay bo thang tren doc; camera VPR+PnP tren doc (>= 2 anh trung, khop nghieng, LiDAR khong phan doi, pose = trung binh camera) -- sim 10 cho chot dung 1.4-2.9 cm, 0 chot sai; web 3D: ban do uon theo san (FLH1), scan/quy dao theo z, het nen lung, sua ro GPU; CMake: TensorRT tren CMake < 3.17
This commit is contained in:
@@ -147,4 +147,28 @@ bool FloorModel::FloorAt(double x, double y, double* z, double* dist) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FloorGradientAt(const FloorModel& fm, double x, double y, double max_dist, double* gx,
|
||||
double* gy) {
|
||||
FloorNode n;
|
||||
double d = 0.0;
|
||||
if (!fm.NearestNode(x, y, &n, &d) || d > max_dist) return false;
|
||||
// Dao ham cua PlaneZ: z = z_n - fwd * tan(pitch) + left * tan(roll).
|
||||
const double c = std::cos(n.theta), s = std::sin(n.theta);
|
||||
const double tp = std::tan(n.pitch), tr = std::tan(n.roll);
|
||||
*gx = -tp * c - tr * s;
|
||||
*gy = -tp * s + tr * c;
|
||||
return true;
|
||||
}
|
||||
|
||||
double TiltResidual(double roll, double pitch, double yaw, double gx, double gy) {
|
||||
const double c = std::cos(yaw), s = std::sin(yaw);
|
||||
const double sf = gx * c + gy * s; // doc theo huong mui (len = duong)
|
||||
const double sl = -gx * s + gy * c; // doc sang trai
|
||||
// Than nam tren mat do, R = Rz(yaw) Ry(pitch) Rx(roll): truc x than nam trong
|
||||
// mat -> tan(pitch) = -sf; truc y than nam trong mat -> tan(roll) = sl * cos(pitch).
|
||||
const double mf = -std::tan(pitch);
|
||||
const double ml = std::tan(roll) / std::max(1e-6, std::cos(pitch));
|
||||
return std::hypot(mf - sf, ml - sl);
|
||||
}
|
||||
|
||||
} // namespace vslam
|
||||
|
||||
Reference in New Issue
Block a user