slam.yaml: profiles sim/real -- odom sigma va ICP ratio tach theo moi truong

This commit is contained in:
trung09122002
2026-09-28 14:40:48 +07:00
parent c8c08223ed
commit 89ab2e7868
6 changed files with 367 additions and 12 deletions

View File

@@ -349,6 +349,19 @@ StatusResponse Runtime::Start() {
#ifdef VSLAM_HAVE_SLAM
if (cfg_->slam.enabled || opts_.force_slam) {
RtabmapConfig sc = cfg_->slam;
// Mo phong va robot that can bo so KHAC nhau -- slam.yaml `profiles`.
// --replay phat lai du lieu robot that nen di theo `real`.
{
const char* profile = (opts_.source == SourceKind::kSim) ? "sim" : "real";
const StatusResponse pst = ApplySlamProfile(profile, &sc);
if (!pst.ok()) return pst;
std::string keys;
for (const auto& kv : sc.profiles.at(profile).rtabmap) {
keys += ", " + kv.first + "=" + kv.second;
}
VSLAM_INFO("slam: profile " << profile << " -- odom_sigma " << sc.odom_sigma_m
<< " m / " << sc.odom_sigma_rad << " rad" << keys);
}
if (opts_.have_slam_db) sc.database_path = opts_.slam_db;
if (opts_.slam_mode_override == "mapping") sc.mode = SlamMode::kMapping;
else if (opts_.slam_mode_override == "localization") sc.mode = SlamMode::kLocalization;