This commit is contained in:
Ayzen
2026-06-11 19:51:30 +03:00
parent 9661504e51
commit f0d095de80
16 changed files with 1786 additions and 72 deletions
@@ -44,10 +44,14 @@ struct ProcessingLiveConfig {
std::vector<std::uint32_t> gpr_output_positions{};
float gpr_min_depth_m = 2.0F;
float gpr_max_depth_m = 14.0F;
float gpr_range_comp_power = 0.28F;
float gpr_angle_comp_power = 0.10F;
float gpr_range_comp_power = 0.1F;
float gpr_angle_comp_power = 0.0F;
float gpr_comp_power = 0.2F;
std::string gpr_score_mode = "combined";
// Backprojection intra-sweep speed-correction mode: "int_minus" (full
// correction) or "int_focus" (focusing residual only). Mirrors the Python
// Horns_motion_3libre.py MOTION_CORRECTION_MODE selector.
std::string gpr_motion_mode = "int_minus";
float gpr_speed_m_s = 0.0F;
float gpr_look_angle_deg = 0.0F;
// Motion model parameters for the legacy GPR pipeline. The direction sign
@@ -60,6 +60,13 @@ using Json = nlohmann::json;
throw std::runtime_error(field_name + " must be one of: peak, combined");
}
[[nodiscard]] auto parse_gpr_motion_mode(const std::string& value, const std::string& field_name) -> std::string {
if (value == "int_minus" || value == "int_focus") {
return value;
}
throw std::runtime_error(field_name + " must be one of: int_minus, int_focus");
}
void apply_legacy_gpr_algorithm_alias(ProcessingLiveConfig& config, const std::string& value) {
if (value == "backprojection") {
return;
@@ -266,6 +273,12 @@ void apply_legacy_gpr_algorithm_alias(ProcessingLiveConfig& config, const std::s
}
config.gpr_score_mode = parse_gpr_score_mode(found->get<std::string>(), "processing.gpr_score_mode");
}
if (const auto found = root.find("gpr_motion_mode"); found != root.end()) {
if (!found->is_string()) {
throw std::runtime_error("processing.gpr_motion_mode must be string");
}
config.gpr_motion_mode = parse_gpr_motion_mode(found->get<std::string>(), "processing.gpr_motion_mode");
}
if (const auto found = root.find("gpr_speed_m_s"); found != root.end()) {
if (!found->is_number()) {
throw std::runtime_error("processing.gpr_speed_m_s must be number");