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

@@ -23,6 +23,13 @@
namespace vslam {
// Ghi de theo MOI TRUONG -- khoi `profiles:` cua slam.yaml. Chi chua nhung
// key KHAC nhau giua mo phong va robot that; phan con lai dung chung.
struct SlamProfile {
std::map<std::string, double> numbers; // odom_sigma_m, odom_sigma_rad
std::map<std::string, std::string> rtabmap; // key RTAB-Map
};
struct RtabmapConfig {
// TAT mac dinh: tren may chua build RTAB-Map thi node van phai chay duoc
// day du phan con lai.
@@ -50,6 +57,11 @@ struct RtabmapConfig {
// Cac key RTAB-Map doc tu khoi `rtabmap:` cua slam.yaml. Ghi de len mac
// dinh, va bi ghi de boi cac suy dien tu mode/visual_loop o tren.
std::map<std::string, std::string> overrides;
// "sim" va "real" tu khoi `profiles:`. CHUA ap: LoadRtabmapConfig chi doc
// va kiem, ben goi chon mot cai bang ApplySlamProfile() vi chi no biet dang
// chay mo phong hay robot that.
std::map<std::string, SlamProfile> profiles;
};
// Tra ve tap tham so day du. `unknown` nhan ten cac key khong co trong bang
@@ -58,9 +70,14 @@ struct RtabmapConfig {
std::map<std::string, std::string> BuildRtabmapParams(
const RtabmapConfig& cfg, std::vector<std::string>* unknown);
// Doc khoi `rtabmap:` + cac key cap cao tu ConfigNode.
// Doc khoi `rtabmap:` + cac key cap cao tu ConfigNode. Nem neu khoi
// `profiles:` sai luat (xem slam.yaml).
RtabmapConfig LoadRtabmapConfig(const ConfigNode& node);
// Ap `profiles.<name>` len cfg: sigma odom va cac key RTAB-Map cua profile.
// Loi neu khong co profile do -- KHONG lang le chay bang mac dinh cua struct.
StatusResponse ApplySlamProfile(const std::string& name, RtabmapConfig* cfg);
// Tra ve true neu RTAB-Map duoc build kem optimizer nay.
bool OptimizerAvailable(const std::string& strategy);