Files
vslam_cpp/libs/vslam_slam/include/vslam/occupancy_export.h

55 lines
1.9 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 <set>
#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.
//
// `only_ids`: chi dung cac node co id trong tap nay (nullptr = moi node). De
// do relocalization CONG BANG tren mot phien: ban do tu nua dau, hoi bang nua
// sau -- scan dung de hoi khong duoc gop vao ban do.
StatusResponse ExportOccupancyGridFromDb(const std::string& db_path,
double cell_size, double range_max,
OccupancyGrid* out,
const std::set<int>* only_ids = nullptr);
} // namespace vslam
#endif // VSLAM_OCCUPANCY_EXPORT_H