sim: camera ve bang GPU (lib tuy chon vslam_sim_gl, EGL + GLES3 + assimp) -- anh IR co texture that + depth khop tung pixel, vslam_node --sim-gl, tool vslam_render_preview
This commit is contained in:
@@ -57,6 +57,8 @@ void Usage(const char* argv0) {
|
||||
" system.yaml gamepad.enabled. DEV mac dinh lay\n"
|
||||
" tu system.yaml (/dev/input/js0)\n"
|
||||
" --no-gamepad tat tay cam du system.yaml co bat\n"
|
||||
" --sim-gl ve camera mo phong bang GPU: depth + anh IR co\n"
|
||||
" texture (can --world, build VSLAM_SIM_WITH_GL=ON)\n"
|
||||
" --sim-glass-at X dat buc KINH ngang hanh lang o x = X m.\n"
|
||||
" LiDAR/depth KHONG thay; chi sieu am + bumper.\n"
|
||||
" --max-speed V ghi de tran toc do (m/s). CHI CHO MO PHONG --\n"
|
||||
@@ -163,6 +165,7 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
else if (a == "--no-gamepad") opts.gamepad_override = -1;
|
||||
else if (a == "--sim-glass-at") opts.sim_glass_at = std::atof(next().c_str());
|
||||
else if (a == "--sim-gl") opts.sim_gl = true;
|
||||
else if (a == "--max-speed") opts.max_speed_override = std::atof(next().c_str());
|
||||
else if (a == "--slam") opts.force_slam = true;
|
||||
else if (a == "--slam-db") { opts.slam_db = next(); opts.have_slam_db = true; }
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#include "vslam/node_constants.h"
|
||||
#include "vslam/replay_source.h"
|
||||
#include "vslam/sim_source.h"
|
||||
#ifdef VSLAM_HAVE_SIM_GL
|
||||
#include "vslam/sim_gl_renderer.h"
|
||||
#endif
|
||||
#ifdef VSLAM_HAVE_SLAM
|
||||
#include "vslam/occupancy_export.h"
|
||||
#include <opencv2/imgcodecs.hpp>
|
||||
@@ -84,6 +87,26 @@ StatusResponse Runtime::OpenSource() {
|
||||
const StatusResponse st = source_->sim->Open();
|
||||
if (!st.ok()) return st;
|
||||
|
||||
if (opts_.sim_gl) {
|
||||
// Ve camera bang GPU: depth + anh IR tu mesh co texture that. Context
|
||||
// GPU tao o khung dau tien, tren luong vong mo phong.
|
||||
if (opts_.world_path.empty()) {
|
||||
return StatusResponse::Error(StatusCode::kInvalidArgument,
|
||||
"--sim-gl can --world (ve tu mesh cua world)");
|
||||
}
|
||||
#ifdef VSLAM_HAVE_SIM_GL
|
||||
std::string err;
|
||||
auto r = CreateGlCameraRenderer(source_->sim->world(), DefaultGlRendererConfig(), &err);
|
||||
if (!r) {
|
||||
return StatusResponse::Error(StatusCode::kFailedPrecondition, "--sim-gl: " + err);
|
||||
}
|
||||
source_->sim->SetCameraRenderer(r);
|
||||
#else
|
||||
return StatusResponse::Error(StatusCode::kFailedPrecondition,
|
||||
"--sim-gl: node build KHONG co -DVSLAM_SIM_WITH_GL=ON");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (opts_.sim_glass_at != 0.0) {
|
||||
// Buc kinh chan ngang hanh lang. Phai danh dau o DA BI CHIEM, nen
|
||||
// chen tuong truoc roi moi danh dau la kinh.
|
||||
|
||||
@@ -90,6 +90,9 @@ struct RuntimeOptions {
|
||||
// Kinh vo hinh voi LiDAR va depth; chi sieu am thay. Dung de chay nhanh
|
||||
// US_BLOCKED va BUMPER cua FSM -- hai nhanh chua bao gio chay end-to-end.
|
||||
double sim_glass_at = 0.0;
|
||||
// Ve camera mo phong bang GPU (vslam_sim_gl): depth + anh IR co texture.
|
||||
// Can --world va node build voi -DVSLAM_SIM_WITH_GL=ON.
|
||||
bool sim_gl = false;
|
||||
bool force_slam = false; // --slam: ghi de slam.yaml enabled
|
||||
bool have_slam_db = false; // --slam-db "" nghia la DB trong RAM
|
||||
std::string slam_db;
|
||||
|
||||
Reference in New Issue
Block a user