CoreWrapper: updated default parameters when subscribing to 3d scan

This commit is contained in:
matlabbe
2019-10-15 18:09:02 -04:00
parent 57c9cb414c
commit 3282b7b946
+44 -13
View File
@@ -415,21 +415,41 @@ void CoreWrapper::onInit()
Parameters::defaultGridRangeMax()); Parameters::defaultGridRangeMax());
parameters_.insert(ParametersPair(Parameters::kGridRangeMax(), "0")); parameters_.insert(ParametersPair(Parameters::kGridRangeMax(), "0"));
} }
if(subscribeScan3d && parameters_.find(Parameters::kIcpPointToPlaneRadius()) == parameters_.end())
{
NODELET_INFO("Setting \"%s\" parameter to 0 (default %f) as \"subscribe_scan_cloud\" is true.",
Parameters::kIcpPointToPlaneRadius().c_str(),
Parameters::defaultIcpPointToPlaneRadius());
parameters_.insert(ParametersPair(Parameters::kIcpPointToPlaneRadius(), "0"));
}
int regStrategy = Parameters::defaultRegStrategy(); int regStrategy = Parameters::defaultRegStrategy();
Parameters::parse(parameters_, Parameters::kRegStrategy(), regStrategy); Parameters::parse(parameters_, Parameters::kRegStrategy(), regStrategy);
if(subscribeScan2d && if(parameters_.find(Parameters::kRGBDProximityPathMaxNeighbors()) == parameters_.end() &&
parameters_.find(Parameters::kRGBDProximityPathMaxNeighbors()) == parameters_.end() &&
(regStrategy == Registration::kTypeIcp || regStrategy == Registration::kTypeVisIcp)) (regStrategy == Registration::kTypeIcp || regStrategy == Registration::kTypeVisIcp))
{ {
NODELET_WARN("Setting \"%s\" parameter to 10 (default 0) as \"subscribe_scan\" is " if(subscribeScan2d)
"true and \"%s\" uses ICP. Proximity detection by space will be also done by merging close " {
"scans. To disable, set \"%s\" to 0. To suppress this warning, " NODELET_WARN("Setting \"%s\" parameter to 10 (default 0) as \"subscribe_scan\" is "
"add <param name=\"%s\" type=\"string\" value=\"10\"/>", "true and \"%s\" uses ICP. Proximity detection by space will be also done by merging close "
Parameters::kRGBDProximityPathMaxNeighbors().c_str(), "scans. To disable, set \"%s\" to 0. To suppress this warning, "
Parameters::kRegStrategy().c_str(), "add <param name=\"%s\" type=\"string\" value=\"10\"/>",
Parameters::kRGBDProximityPathMaxNeighbors().c_str(), Parameters::kRGBDProximityPathMaxNeighbors().c_str(),
Parameters::kRGBDProximityPathMaxNeighbors().c_str()); Parameters::kRegStrategy().c_str(),
parameters_.insert(ParametersPair(Parameters::kRGBDProximityPathMaxNeighbors(), "10")); Parameters::kRGBDProximityPathMaxNeighbors().c_str(),
Parameters::kRGBDProximityPathMaxNeighbors().c_str());
parameters_.insert(ParametersPair(Parameters::kRGBDProximityPathMaxNeighbors(), "10"));
}
else if(subscribeScan3d)
{
NODELET_WARN("Setting \"%s\" parameter to 1 (default 0) as \"subscribe_scan_cloud\" is "
"true and \"%s\" uses ICP. To disable, set \"%s\" to 0. To suppress this warning, "
"add <param name=\"%s\" type=\"string\" value=\"1\"/>",
Parameters::kRGBDProximityPathMaxNeighbors().c_str(),
Parameters::kRegStrategy().c_str(),
Parameters::kRGBDProximityPathMaxNeighbors().c_str(),
Parameters::kRGBDProximityPathMaxNeighbors().c_str());
parameters_.insert(ParametersPair(Parameters::kRGBDProximityPathMaxNeighbors(), "1"));
}
} }
int estimationType = Parameters::defaultVisEstimationType(); int estimationType = Parameters::defaultVisEstimationType();
@@ -641,9 +661,9 @@ void CoreWrapper::onInit()
NODELET_WARN("Setting %s=1 (ICP)", Parameters::kRegStrategy().c_str()); NODELET_WARN("Setting %s=1 (ICP)", Parameters::kRegStrategy().c_str());
updateParams = true; updateParams = true;
if(this->isSubscribedToScan2d()) if(modifiedParameters.find(Parameters::kRGBDProximityPathMaxNeighbors()) == modifiedParameters.end())
{ {
if(modifiedParameters.find(Parameters::kRGBDProximityPathMaxNeighbors()) == modifiedParameters.end()) if(this->isSubscribedToScan2d())
{ {
NODELET_WARN("Setting \"%s\" parameter to 10 (default 0) as \"subscribe_scan\" is " NODELET_WARN("Setting \"%s\" parameter to 10 (default 0) as \"subscribe_scan\" is "
"true and \"%s\" uses ICP. Proximity detection by space will be also done by merging close " "true and \"%s\" uses ICP. Proximity detection by space will be also done by merging close "
@@ -655,6 +675,17 @@ void CoreWrapper::onInit()
Parameters::kRGBDProximityPathMaxNeighbors().c_str()); Parameters::kRGBDProximityPathMaxNeighbors().c_str());
uInsert(parameters_, ParametersPair(Parameters::kRGBDProximityPathMaxNeighbors(), "10")); uInsert(parameters_, ParametersPair(Parameters::kRGBDProximityPathMaxNeighbors(), "10"));
} }
else if(this->isSubscribedToScan3d())
{
NODELET_WARN("Setting \"%s\" parameter to 1 (default 0) as \"subscribe_scan_cloud\" is "
"true and \"%s\" uses ICP. To disable, set \"%s\" to 0. To suppress this warning, "
"add <param name=\"%s\" type=\"string\" value=\"1\"/>",
Parameters::kRGBDProximityPathMaxNeighbors().c_str(),
Parameters::kRegStrategy().c_str(),
Parameters::kRGBDProximityPathMaxNeighbors().c_str(),
Parameters::kRGBDProximityPathMaxNeighbors().c_str());
uInsert(parameters_, ParametersPair(Parameters::kRGBDProximityPathMaxNeighbors(), "1"));
}
} }
} }
if(updateParams) if(updateParams)