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

@@ -129,6 +129,60 @@ TEST(BinaryCodec, MapFullNenTotTrenBanDoThua) {
EXPECT_EQ(out.data, m.data);
}
// Che do doc: khoi do cao san noi sau RLE. Phan luoi 2D phai giai y het khung
// khong co khoi (client cu bo qua duoi khung), va khoi giu dung tung o, ke ca
// o CHUA BIET va gia tri am (tang ham).
TEST(BinaryCodec, MapFullKhoiDoCaoSan) {
OccupancyGrid m;
m.width = 40;
m.height = 30;
m.resolution = 0.05f;
m.origin.position.x = -1.25;
m.origin.position.y = -2.5;
m.data.assign(static_cast<size_t>(m.width) * m.height, -1);
for (uint32_t x = 5; x < 35; ++x) m.data[10 * m.width + x] = 100;
MapFloorGrid f;
f.resolution = 0.2f;
f.width = 10;
f.height = 8;
f.origin_x = -1.25f;
f.origin_y = -2.5f;
f.mm.assign(80, kFloorUnknown);
f.mm[0] = 0;
f.mm[17] = 1500;
f.mm[79] = -320;
std::string plain, with_floor;
EncodeMapFull(m, UnixTime::fromSec(2.0), &plain);
EncodeMapFull(m, UnixTime::fromSec(2.0), &with_floor, BinaryType::kMapFull, &f);
ASSERT_EQ(with_floor.size(), plain.size() + 24 + 80 * 2);
EXPECT_EQ(with_floor.compare(0, plain.size(), plain), 0);
OccupancyGrid out;
MapFloorGrid fout;
ASSERT_TRUE(DecodeMapFull(with_floor, &out, &fout));
EXPECT_EQ(out.data, m.data);
EXPECT_EQ(fout.width, f.width);
EXPECT_EQ(fout.height, f.height);
EXPECT_NEAR(fout.resolution, f.resolution, 1e-6);
EXPECT_NEAR(fout.origin_x, f.origin_x, 1e-6);
EXPECT_NEAR(fout.origin_y, f.origin_y, 1e-6);
EXPECT_EQ(fout.mm, f.mm);
// Khung khong co khoi: luoi san tra ve rong, khong phai rac cua lan truoc.
ASSERT_TRUE(DecodeMapFull(plain, &out, &fout));
EXPECT_EQ(fout.width, 0u);
EXPECT_TRUE(fout.mm.empty());
// Kich thuoc sai (mm thieu o) -> khong ghi khoi, khung y het ban phang.
MapFloorGrid bad = f;
bad.mm.pop_back();
std::string with_bad;
EncodeMapFull(m, UnixTime::fromSec(2.0), &with_bad, BinaryType::kMapFull, &bad);
EXPECT_EQ(with_bad, plain);
}
// --- Ban do voxel 3D -------------------------------------------------------
namespace {