diff --git a/src/yaml/processor_imu_yaml.cpp b/src/yaml/processor_imu_yaml.cpp index 199f59af44bd61d5dcf60ce1a815def2e3cb950a..ff2b02eafd23efb19d332aac1b5c60d97580d6b5 100644 --- a/src/yaml/processor_imu_yaml.cpp +++ b/src/yaml/processor_imu_yaml.cpp @@ -48,17 +48,40 @@ static ParamsProcessorBasePtr createProcessorImuParams(const std::string & _file if (config["type"].as<std::string>() == "ProcessorImu") { - YAML::Node kf_vote = config["keyframe_vote"]; ParamsProcessorImuPtr params = std::make_shared<ParamsProcessorImu>(); params->time_tolerance = config["time_tolerance"] .as<double>(); params->unmeasured_perturbation_std = config["unmeasured_perturbation_std"].as<double>(); - params->max_time_span = kf_vote["max_time_span"] .as<double>(); - params->max_buff_length = kf_vote["max_buff_length"] .as<SizeEigen>(); - params->dist_traveled = kf_vote["dist_traveled"] .as<double>(); - params->angle_turned = kf_vote["angle_turned"] .as<double>(); - params->voting_active = kf_vote["voting_active"] .as<bool>(); + YAML::Node kf_vote = config["keyframe_vote"]; + params->max_time_span = kf_vote["max_time_span"].as<double>(); + params->max_buff_length = kf_vote["max_buff_length"].as<SizeEigen>(); + params->dist_traveled = kf_vote["dist_traveled"].as<double>(); + params->angle_turned = kf_vote["angle_turned"].as<double>(); + params->voting_active = kf_vote["voting_active"].as<bool>(); + + YAML::Node bootstrap = config["bootstrap"]; + params->bootstrap_enable = bootstrap["enable"].as<bool>(); + if (params->bootstrap_enable) + { + string str = bootstrap["method"].as<string>(); + std::transform(str.begin(), str.end(), str.begin(), ::toupper); + if (str == "STATIC" /**/) + { + params->bootstrap_method = ParamsProcessorImu::BootstrapMethod::BOOTSTRAP_STATIC; + params->bootstrap_averaging_length = bootstrap["averaging_length"].as<int>(); + } + if (str == "G" /* */) + { + params->bootstrap_method = ParamsProcessorImu::BootstrapMethod::BOOTSTRAP_G; + params->bootstrap_averaging_length = bootstrap["averaging_length"].as<int>(); + } + if (str == "V0_G" /* */) + { + params->bootstrap_method = ParamsProcessorImu::BootstrapMethod::BOOTSTRAP_V0_G; + } + } + return params; }