sim: dia hinh 3D -- doc va san cao tu model vslam_terrain_*, robot di tren mat san, LiDAR tia 3D, ground truth 6-DoF, world slope_test (5 doc 5-30 do)
This commit is contained in:
@@ -57,8 +57,17 @@ struct WorldModel {
|
||||
// `CGMClassic` mot minh ra bao loi 239 x 111 m, va ca the gioi phinh tu
|
||||
// 25x51 m len 263x146 m.
|
||||
double sx = 1.0, sy = 1.0, sz = 1.0;
|
||||
|
||||
// Model DIA HINH: mat robot di LEN duoc (san, doc, chieu nghi), khong phai
|
||||
// vat can. Nhan bang TEN model (`kTerrainModelPrefix`), KHONG bang phap
|
||||
// tuyen: mat ban, mat giuong, mat ghe cung huong len, va lay theo phap
|
||||
// tuyen la cho robot leo len ban.
|
||||
bool terrain = false;
|
||||
};
|
||||
|
||||
// Model co ten bat dau bang chuoi nay la dia hinh. Xem `WorldModel::terrain`.
|
||||
constexpr const char* kTerrainModelPrefix = "vslam_terrain_";
|
||||
|
||||
struct GazeboWorld {
|
||||
std::string world_path;
|
||||
std::vector<WorldModel> models;
|
||||
@@ -80,9 +89,13 @@ StatusResponse LoadGazeboWorld(const std::string& world_path,
|
||||
|
||||
// Raster hoa mesh VA CHAM cua world thanh luoi chiem dung 2D.
|
||||
//
|
||||
// Chi lay tam giac nam trong dai do cao [z_min, z_max] so voi SAN: do la dai
|
||||
// ma LiDAR 2D thuc su quet. Lay het moi do cao se bien ca mat san thanh vat
|
||||
// can, va lay qua cao se bo lot ban ghe.
|
||||
// Chi lay tam giac nam trong dai do cao [z_min, z_max] tinh tu MAT SAN CUC BO
|
||||
// cua tung o: do la dai ma LiDAR 2D thuc su quet. Lay het moi do cao se bien
|
||||
// ca mat san thanh vat can, va lay qua cao se bo lot ban ghe.
|
||||
//
|
||||
// World khong co model dia hinh thi mat san o moi o la 0 -- dung y het truoc
|
||||
// day. Co dia hinh (san cao, doc) thi dai z TRUOT theo san: mot cai tu dung
|
||||
// tren san tang 2 cao 1.5 m van la vat can, va mat doc KHONG thanh tuong.
|
||||
//
|
||||
// `resolution` met/o. `pad` la vien trong them quanh bao loi, tinh bang met.
|
||||
struct WorldRasterOptions {
|
||||
@@ -92,10 +105,28 @@ struct WorldRasterOptions {
|
||||
double pad = 1.0;
|
||||
};
|
||||
|
||||
// Dia hinh rut tu world, cung kich thuoc va goc voi luoi.
|
||||
struct WorldTerrain {
|
||||
// Do cao mat tren cua dia hinh tai TAM moi o (m, he world). O khong co dia
|
||||
// hinh = 0. Nhieu tam giac chong nhau thi lay cao nhat (mat tren).
|
||||
std::vector<float> floor_z;
|
||||
// Dinh cua vat can cao nhat trong moi o bi chiem (m, he world); 0 = o
|
||||
// trong. Cho phep raycast 3D biet tuong cao toi dau thay vi gia dinh mot
|
||||
// chieu cao chung.
|
||||
std::vector<float> wall_top;
|
||||
size_t terrain_cells = 0; // so o co dia hinh; 0 = world phang
|
||||
float floor_min = 0.0f, floor_max = 0.0f;
|
||||
};
|
||||
|
||||
StatusResponse RasterizeGazeboWorld(const GazeboWorld& world,
|
||||
const WorldRasterOptions& opt,
|
||||
OccupancyGrid* out);
|
||||
|
||||
// Nhu tren, va tra them dia hinh. `terrain` co the null.
|
||||
StatusResponse RasterizeGazeboWorld(const GazeboWorld& world,
|
||||
const WorldRasterOptions& opt,
|
||||
OccupancyGrid* out, WorldTerrain* terrain);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Chi muc doan 2D, de raycast trung MAT TUONG chu khong trung bien o
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -135,10 +166,15 @@ struct WorldSegments {
|
||||
// LiDAR do duoc phai la thu robot dam vao. Vai model trong bo nay co hull va
|
||||
// cham don gian hoa khac han mesh hien thi (do duoc: PatientWheelChair,
|
||||
// nursesstation_01), va Gazebo cung hanh xu y het.
|
||||
//
|
||||
// Model dia hinh khong sinh doan nao (no la san, khong phai tuong). `floor_z`
|
||||
// (tu `WorldTerrain`, cung kich thuoc `grid`) dua dai z ve mat san cuc bo;
|
||||
// null = san phang o 0, y het truoc day.
|
||||
StatusResponse BuildWorldSegments(const GazeboWorld& world,
|
||||
const WorldRasterOptions& opt,
|
||||
const OccupancyGrid& grid,
|
||||
WorldSegments* out);
|
||||
WorldSegments* out,
|
||||
const std::vector<float>* floor_z = nullptr);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Xuat hinh hoc cho khung 3D
|
||||
|
||||
Reference in New Issue
Block a user