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:
trung09122002
2026-10-06 10:17:17 +07:00
parent b1ab04c51e
commit f0c5ddb6b8
19 changed files with 1947 additions and 68 deletions

View File

@@ -12,7 +12,7 @@ const MAGIC = 0x314C5356; // 'VSL1' little-endian
// Phien ban ma nguon giao dien. TANG khi doi app.js / app3d.js / style.css.
// Hien ngay tren thanh tren cung de phan biet "chua sua" voi "trinh duyet con
// cache ban cu".
const UI_VERSION = '2026-09-30a';
const UI_VERSION = '2026-10-05c';
// ⚠️ HAI bang mau, mot cho moi khung. Chung KHONG duoc giong nhau.
//
@@ -68,6 +68,8 @@ const T_SCAN = 1, T_CLOUD = 2, T_MAP_FULL = 3, T_PATH = 5;
const T_WORLD_MAP = 6;
// Ban do voxel 3D: tap day du (chia manh) va phan them/bot.
const T_VOXEL_FULL = 7, T_VOXEL_DELTA = 8;
// Khoi do cao SAN noi sau RLE cua khung ban do (che do doc, binary_codec.h).
const FLOOR_MAGIC = 0x31484C46; // 'FLH1' little-endian
// Ba ngu nghia cua mot tia. Lan lon chung la lam sai ca man hinh.
const R_NAN = 0xFFFF; // khong do duoc (duoi range_min)
@@ -229,7 +231,21 @@ function onBinary(dv) {
cells.fill(val, p, p + len);
p += len;
}
const grid = { res, w, h, ox, oy, cells };
// Do cao san (mm, -32768 = chua biet) ngay sau RLE. Khong co thi ban do
// phang nhu cu.
let floor = null;
const fo = off + 28 + runs * 3;
if (type === T_MAP_FULL && dv.byteLength >= fo + 24 &&
dv.getUint32(fo, true) === FLOOR_MAGIC) {
const fw = dv.getInt32(fo + 8, true), fh = dv.getInt32(fo + 12, true);
if (fw > 0 && fh > 0 && dv.byteLength >= fo + 24 + fw * fh * 2) {
const mm = new Int16Array(fw * fh);
for (let i = 0; i < fw * fh; i++) mm[i] = dv.getInt16(fo + 24 + i * 2, true);
floor = { res: dv.getFloat32(fo + 4, true), w: fw, h: fh,
ox: dv.getFloat32(fo + 16, true), oy: dv.getFloat32(fo + 20, true), mm };
}
}
const grid = { res, w, h, ox, oy, cells, floor };
if (type === T_WORLD_MAP) {
// Ban do THE GIOI: su that, de lai cho chuan. KHONG lan vao state.map.
state.worldMap = grid;
@@ -620,6 +636,11 @@ function anchorPose(robotPose, anchoredAt) {
x: robotPose.x + c * lx - s * ly,
y: robotPose.y + s * lx + c * ly,
yaw: robotPose.yaw + (anchoredAt.yaw - state.pose.yaw),
// Cao do san duoi robot va do nghieng than (che do doc): khung 3D nang
// scan/cloud len theo z, va xoay scan tho theo roll/pitch.
z: robotPose.z,
roll: robotPose.roll,
pitch: robotPose.pitch,
};
}
@@ -1314,7 +1335,7 @@ function draw3d() {
v3dSetMap({ ...state.map, data: state.map.cells, version: state.mapVersion });
}
if (V3D.mapMesh) V3D.mapMesh.visible = on('lyMap') && !!state.map;
if (on('lyPath')) v3dSetPath(state.path);
if (on('lyPath')) v3dSetPath(state.path, state.map && state.map.floor);
else if (V3D.pathLine) V3D.pathLine.visible = false;
v3dRender(cv3d, on('lyFollow'), split3d);