mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Added check to set Vis/EstimationType to 0 if multi cameras is enabled (#187)
This commit is contained in:
+19
-2
@@ -334,7 +334,7 @@ void CoreWrapper::onInit()
|
|||||||
Parameters::kGridFromDepth().c_str());
|
Parameters::kGridFromDepth().c_str());
|
||||||
parameters_.insert(ParametersPair(Parameters::kGridFromDepth(), "false"));
|
parameters_.insert(ParametersPair(Parameters::kGridFromDepth(), "false"));
|
||||||
}
|
}
|
||||||
int regStrategy = 0;
|
int regStrategy = Parameters::defaultRegStrategy();
|
||||||
Parameters::parse(parameters_, Parameters::kRegStrategy(), regStrategy);
|
Parameters::parse(parameters_, Parameters::kRegStrategy(), regStrategy);
|
||||||
if(subscribeScan2d &&
|
if(subscribeScan2d &&
|
||||||
parameters_.find(Parameters::kRGBDProximityPathMaxNeighbors()) == parameters_.end() &&
|
parameters_.find(Parameters::kRGBDProximityPathMaxNeighbors()) == parameters_.end() &&
|
||||||
@@ -351,6 +351,23 @@ void CoreWrapper::onInit()
|
|||||||
parameters_.insert(ParametersPair(Parameters::kRGBDProximityPathMaxNeighbors(), "10"));
|
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
|
// modify default parameters with those in the database
|
||||||
if(!deleteDbOnStart)
|
if(!deleteDbOnStart)
|
||||||
{
|
{
|
||||||
@@ -587,7 +604,7 @@ CoreWrapper::~CoreWrapper()
|
|||||||
|
|
||||||
printf("rtabmap: Saving database/long-term memory... (located at %s)\n", databasePath_.c_str());
|
printf("rtabmap: Saving database/long-term memory... (located at %s)\n", databasePath_.c_str());
|
||||||
rtabmap_.close();
|
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)
|
void CoreWrapper::loadParameters(const std::string & configFile, ParametersMap & parameters)
|
||||||
|
|||||||
@@ -202,6 +202,24 @@ private:
|
|||||||
ROS_WARN("RGBD odometry works only with \"Reg/Strategy\"=0. Ignoring value %s.", iter->second.c_str());
|
ROS_WARN("RGBD odometry works only with \"Reg/Strategy\"=0. Ignoring value %s.", iter->second.c_str());
|
||||||
}
|
}
|
||||||
uInsert(parameters, ParametersPair(Parameters::kRegStrategy(), "0"));
|
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(
|
void commonCallback(
|
||||||
|
|||||||
Reference in New Issue
Block a user