update
This commit is contained in:
@@ -561,6 +561,38 @@ StatusResponse LoadAppConfig(const std::string& dir, AppConfig* out) {
|
||||
return StatusResponse::Error(StatusCode::kInvalidArgument,
|
||||
std::string("slam.yaml: ") + e.what());
|
||||
}
|
||||
|
||||
// Khoi `voxel:` -- hinh hoc cua ban do 3D. Chi co nghia khi camera_3d bat,
|
||||
// nhung van doc vo dieu kien de `--check` bat duoc gia tri sai tu truoc.
|
||||
if (!root["voxel"].IsNull()) {
|
||||
const ConfigNode v = root["voxel"];
|
||||
const StatusResponse r =
|
||||
Reject(v, "slam.yaml voxel",
|
||||
{"emit_size_m", "z_min", "z_max", "max_cells", "delta_max_ratio"});
|
||||
if (!r.ok()) return r;
|
||||
|
||||
out->voxel.emit_size_m = v.get<double>("emit_size_m", out->voxel.emit_size_m);
|
||||
out->voxel.z_min = v.get<double>("z_min", out->voxel.z_min);
|
||||
out->voxel.z_max = v.get<double>("z_max", out->voxel.z_max);
|
||||
out->voxel.max_cells = static_cast<size_t>(
|
||||
v.get<int>("max_cells", static_cast<int>(out->voxel.max_cells)));
|
||||
out->voxel.delta_max_ratio =
|
||||
v.get<double>("delta_max_ratio", out->voxel.delta_max_ratio);
|
||||
|
||||
if (out->voxel.emit_size_m <= 0.0) {
|
||||
return StatusResponse::Error(StatusCode::kInvalidArgument,
|
||||
"slam.yaml voxel.emit_size_m phai > 0");
|
||||
}
|
||||
if (out->voxel.z_min >= out->voxel.z_max) {
|
||||
return StatusResponse::Error(
|
||||
StatusCode::kInvalidArgument,
|
||||
"slam.yaml voxel: z_min phai nho hon z_max");
|
||||
}
|
||||
if (out->voxel.max_cells == 0) {
|
||||
return StatusResponse::Error(StatusCode::kInvalidArgument,
|
||||
"slam.yaml voxel.max_cells phai > 0");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -582,7 +614,8 @@ StatusResponse LoadAppConfig(const std::string& dir, AppConfig* out) {
|
||||
Reject(w, "system.yaml web",
|
||||
{"port", "bind", "auth_token", "asset_dir", "status_rate_hz",
|
||||
"scan_rate_hz", "cloud_rate_hz", "path_rate_hz",
|
||||
"cloud_max_points", "cloud_quant_m", "map_rebuild_rate_hz"});
|
||||
"cloud_max_points", "cloud_quant_m", "map_rebuild_rate_hz",
|
||||
"voxel_chunk_bytes", "voxel_sync_chunks_per_tick"});
|
||||
if (!r.ok()) return r;
|
||||
}
|
||||
out->web.port = static_cast<uint16_t>(w.get<int>("port", 8080));
|
||||
@@ -597,6 +630,11 @@ StatusResponse LoadAppConfig(const std::string& dir, AppConfig* out) {
|
||||
static_cast<uint32_t>(w.get<int>("cloud_max_points", 4000));
|
||||
out->slam_runtime.map_rebuild_rate_hz =
|
||||
w.get<double>("map_rebuild_rate_hz", out->slam_runtime.map_rebuild_rate_hz);
|
||||
out->web.voxel_chunk_bytes = static_cast<uint32_t>(
|
||||
w.get<int>("voxel_chunk_bytes", static_cast<int>(out->web.voxel_chunk_bytes)));
|
||||
out->web.voxel_sync_chunks_per_tick = static_cast<uint32_t>(w.get<int>(
|
||||
"voxel_sync_chunks_per_tick",
|
||||
static_cast<int>(out->web.voxel_sync_chunks_per_tick)));
|
||||
|
||||
if (out->web.auth_token.empty()) {
|
||||
// Khong tu choi khoi dong: mot robot trong phong lab khong can token.
|
||||
|
||||
Reference in New Issue
Block a user