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

@@ -80,12 +80,31 @@ void EncodeScan(const LaserScan& scan, UnixTime stamp, std::string* out);
void EncodeCloud(const PointCloudXYZ& cloud, UnixTime stamp, uint32_t max_points,
float quant_m, const Pose2D& delta, std::string* out);
// Do cao SAN cua ban do (slam.yaml slope.enabled): luoi THO, mm, kFloorUnknown
// = chua biet. Web uon mat phang ban do 2D theo luoi nay -- khong co no thi
// mat doc va san tang tren duoc ve o z = 0, nam DUOI tuong voxel (o z that)
// va trong nhu san bi thung.
constexpr int16_t kFloorUnknown = -32768;
struct MapFloorGrid {
float resolution = 0.2f;
uint32_t width = 0;
uint32_t height = 0;
float origin_x = 0.0f;
float origin_y = 0.0f;
std::vector<int16_t> mm; // hang chinh, hang 0 = y nho nhat (nhu OccupancyGrid)
};
// RLE hang-chinh. Xem rle.h.
// `type` cho phep dung chung bo ma hoa cho ban do SLAM (kMapFull) va ban do
// THE GIOI cua bo mo phong (kWorldMap): khung giong het nhau, chi khac y
// nghia. Mot bo ma hoa thu hai se la hai cho de lech dinh dang.
//
// `floor_grid` (tuy chon): khoi do cao san NOI SAU phan RLE -- magic "FLH1", f32
// res, i32 w, i32 h, f32 ox, f32 oy, roi w*h int16 (mm). Khong co thi khung y
// het cu.
void EncodeMapFull(const OccupancyGrid& map, UnixTime stamp, std::string* out,
BinaryType type = BinaryType::kMapFull);
BinaryType type = BinaryType::kMapFull,
const MapFloorGrid* floor_grid = nullptr);
// (kMapPatch = 4 da bi BO. No noi duoc vao dau: cong per-session chi la mot
// atomic `acked_map_version_`, khong dien ta noi "session nay dang giu luoi
@@ -149,7 +168,9 @@ struct BinaryHeader {
bool DecodeHeader(const std::string& buf, size_t offset, BinaryHeader* out);
bool DecodeScan(const std::string& buf, LaserScan* out);
bool DecodeMapFull(const std::string& buf, OccupancyGrid* out);
// `floor_grid` (tuy chon) nhan khoi do cao san neu khung co; khong co thi width = 0.
bool DecodeMapFull(const std::string& buf, OccupancyGrid* out,
MapFloorGrid* floor_grid = nullptr);
// Giai mot manh. `out` duoc NOI THEM, khong xoa -- rap nhieu manh bang cach
// goi lien tiep. `total`/`chunk_index`/`chunk_count`/`epoch` tra qua con tro

View File

@@ -13,6 +13,7 @@
#include <string>
#include <vector>
#include "vslam/binary_codec.h"
#include "vslam/stats.h"
#include "vslam/vslam_common.h"
@@ -181,6 +182,8 @@ struct WebSnapshot {
Pose2D cloud_delta;
bool have_cloud_delta = false;
OccupancyGridPtr map; // ban do SLAM dung
// Do cao SAN cua ban do (che do doc), gui kem khung map. Null = phang.
std::shared_ptr<const MapFloorGrid> map_floor;
// Ban do THE GIOI cua bo mo phong (khung nhin "Gazebo"). Null khi chay
// that -- luc do khong co su that nao de doi chieu.
OccupancyGridPtr world_map;