Skip to content
Snippets Groups Projects
Commit b8f42399 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Add bootstrap params to PrcImuYaml creator

parent 6907105c
No related branches found
No related tags found
2 merge requests!54devel->main,!50Resolve "Bootstrap sequence"
...@@ -48,17 +48,40 @@ static ParamsProcessorBasePtr createProcessorImuParams(const std::string & _file ...@@ -48,17 +48,40 @@ static ParamsProcessorBasePtr createProcessorImuParams(const std::string & _file
if (config["type"].as<std::string>() == "ProcessorImu") if (config["type"].as<std::string>() == "ProcessorImu")
{ {
YAML::Node kf_vote = config["keyframe_vote"];
ParamsProcessorImuPtr params = std::make_shared<ParamsProcessorImu>(); ParamsProcessorImuPtr params = std::make_shared<ParamsProcessorImu>();
params->time_tolerance = config["time_tolerance"] .as<double>(); params->time_tolerance = config["time_tolerance"] .as<double>();
params->unmeasured_perturbation_std = config["unmeasured_perturbation_std"].as<double>(); params->unmeasured_perturbation_std = config["unmeasured_perturbation_std"].as<double>();
params->max_time_span = kf_vote["max_time_span"] .as<double>(); YAML::Node kf_vote = config["keyframe_vote"];
params->max_buff_length = kf_vote["max_buff_length"] .as<SizeEigen>(); params->max_time_span = kf_vote["max_time_span"].as<double>();
params->dist_traveled = kf_vote["dist_traveled"] .as<double>(); params->max_buff_length = kf_vote["max_buff_length"].as<SizeEigen>();
params->angle_turned = kf_vote["angle_turned"] .as<double>(); params->dist_traveled = kf_vote["dist_traveled"].as<double>();
params->voting_active = kf_vote["voting_active"] .as<bool>(); 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; return params;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment