Added check to set Vis/EstimationType to 0 if multi cameras is enabled (#187)

This commit is contained in:
matlabbe
2017-08-16 14:44:06 -04:00
parent 3e709d23fc
commit 03a5d2e96f
2 changed files with 37 additions and 2 deletions
+19 -2
View File
@@ -334,7 +334,7 @@ void CoreWrapper::onInit()
Parameters::kGridFromDepth().c_str());
parameters_.insert(ParametersPair(Parameters::kGridFromDepth(), "false"));
}
int regStrategy = 0;
int regStrategy = Parameters::defaultRegStrategy();
Parameters::parse(parameters_, Parameters::kRegStrategy(), regStrategy);
if(subscribeScan2d &&
parameters_.find(Parameters::kRGBDProximityPathMaxNeighbors()) == parameters_.end() &&
@@ -351,6 +351,23 @@ void CoreWrapper::onInit()
parameters_.insert(ParametersPair(Parameters::kRGBDProximityPathMaxNeighbors(), "10"));
}
int estimationType = Parameters::defaultVisEstimationType();
Parameters::parse(parameters_, Parameters::kVisEstimationType(), estimationType);
int cameras = 0;
bool subscribeRGBD = false;
pnh.param("rgbd_cameras", cameras, cameras);
pnh.param("subscribe_rgbd", subscribeRGBD, subscribeRGBD);
if(subscribeRGBD && cameras> 1 && estimationType>0)
{
NODELET_WARN("Setting \"%s\" parameter to 0 (%d is not supported "
"for multi-cameras) as \"subscribe_rgbd\" is "
"true and \"rgbd_cameras\">1. Set \"%s\" to 0 to suppress this warning.",
Parameters::kVisEstimationType().c_str(),
estimationType,
Parameters::kVisEstimationType().c_str());
uInsert(parameters_, ParametersPair(Parameters::kVisEstimationType(), "0"));
}
// modify default parameters with those in the database
if(!deleteDbOnStart)
{
@@ -587,7 +604,7 @@ CoreWrapper::~CoreWrapper()
printf("rtabmap: Saving database/long-term memory... (located at %s)\n", databasePath_.c_str());
rtabmap_.close();
printf("rtabmap: Saving database/long-term memory...done! (located at %s, %ld MB)\n", UFile::length(databasePath_)/(1024*1024), databasePath_.c_str());
printf("rtabmap: Saving database/long-term memory...done! (located at %s, %ld MB)\n", databasePath_.c_str(), UFile::length(databasePath_)/(1024*1024));
}
void CoreWrapper::loadParameters(const std::string & configFile, ParametersMap & parameters)
+18
View File
@@ -202,6 +202,24 @@ private:
ROS_WARN("RGBD odometry works only with \"Reg/Strategy\"=0. Ignoring value %s.", iter->second.c_str());
}
uInsert(parameters, ParametersPair(Parameters::kRegStrategy(), "0"));
int estimationType = Parameters::defaultVisEstimationType();
Parameters::parse(parameters, Parameters::kVisEstimationType(), estimationType);
ros::NodeHandle & pnh = getPrivateNodeHandle();
int rgbdCameras = 1;
bool subscribeRGBD = false;
pnh.param("subscribe_rgbd", subscribeRGBD, subscribeRGBD);
pnh.param("rgbd_cameras", rgbdCameras, rgbdCameras);
if(subscribeRGBD && rgbdCameras> 1 && estimationType>0)
{
NODELET_WARN("Setting \"%s\" parameter to 0 (%d is not supported "
"for multi-cameras) as \"subscribe_rgbd\" is "
"true and \"rgbd_cameras\">1. Set \"%s\" to 0 to suppress this warning.",
Parameters::kVisEstimationType().c_str(),
estimationType,
Parameters::kVisEstimationType().c_str());
uInsert(parameters, ParametersPair(Parameters::kVisEstimationType(), "0"));
}
}
void commonCallback(