Files
vslam_cpp/libs/vslam_slam/include/vslam/occupancy_export.h
trung09122002 0a1b1b13f1 update
2026-09-23 13:36:48 +07:00

49 lines
1.6 KiB
C++

#ifndef VSLAM_OCCUPANCY_EXPORT_H
#define VSLAM_OCCUPANCY_EXPORT_H
// Dung occupancy grid 2D tu do thi RTAB-Map, xuat ra struct POD.
//
// ================== BAY DA MAC MOT LAN ==================
// RTAB-Map luu du lieu NEN trong SensorData. `gridGroundCellsRaw()` va
// `gridObstacleCellsRaw()` tra ve ma tran RONG -- im lang, khong loi, khong
// canh bao -- cho toi khi goi `uncompressDataConst()`. Do dung la ly do
// `tools/probe_rtabmap` lan dau chay ra "1990 node, 0 o".
#include <string>
#include "vslam/vslam_common.h"
namespace rtabmap {
class Rtabmap;
}
namespace vslam {
// Nhung gi doc duoc tu DB TRUOC khi init. Dung de kiem dieu kien tien quyet
// ma khong phai mo ca do thi.
struct DbFacts {
bool exists = false;
int nodes = 0;
int words = 0; // 0 = ban do quet KHONG co tu vung
std::string optimizer_strategy; // tham so DB nho, co the khac cai ta ep
// DB nay duoc quet voi luoi cuc bo 3D hay khong. Quet phang roi mo ban do
// voxel len thi chi thay MOT lop ngang o cao do LiDAR -- canh bao duoc, chu
// khong phai loi.
bool grid_3d = false;
};
DbFacts InspectDatabase(const std::string& path);
StatusResponse ExportOccupancyGrid(rtabmap::Rtabmap& slam, OccupancyGrid* out);
// Doc thang tu DB, khong can Rtabmap dang chay. Dung cho
// `tools/vslam_slam_bench` va cho viec doi DB cu sang PGM.
StatusResponse ExportOccupancyGridFromDb(const std::string& db_path,
double cell_size, double range_max,
OccupancyGrid* out);
} // namespace vslam
#endif // VSLAM_OCCUPANCY_EXPORT_H