fixed fatal error with OdometryMono and rgb color only is selected for a RGB-D driver

This commit is contained in:
matlabbe
2015-07-30 10:04:24 -04:00
parent eab4a68838
commit 38807bf12e
+5 -2
View File
@@ -416,7 +416,7 @@ Transform OdometryMono::computeTransform(const SensorData & data, OdometryInfo *
UDEBUG("cameraTransform guess= %s (norm^2=%f)", cameraTransform.prettyPrint().c_str(), cameraTransform.getNormSquared()); UDEBUG("cameraTransform guess= %s (norm^2=%f)", cameraTransform.prettyPrint().c_str(), cameraTransform.getNormSquared());
if(cameraTransform.getNorm() < minTranslation_) if(cameraTransform.getNorm() < minTranslation_)
{ {
UWARN("Translation with the nearest frame is too small (%f<%f) to add new points to local map", UINFO("Translation with the nearest frame is too small (%f<%f) to add new points to local map",
cameraTransform.getNorm(), minTranslation_); cameraTransform.getNorm(), minTranslation_);
} }
else else
@@ -730,6 +730,8 @@ Transform OdometryMono::computeTransform(const SensorData & data, OdometryInfo *
pcl::PointCloud<pcl::PointXYZ>::Ptr newCorners3D(new pcl::PointCloud<pcl::PointXYZ>); pcl::PointCloud<pcl::PointXYZ>::Ptr newCorners3D(new pcl::PointCloud<pcl::PointXYZ>);
if(!refDepthOrRight_.empty())
{
if(refDepthOrRight_.type() == CV_8UC1) if(refDepthOrRight_.type() == CV_8UC1)
{ {
newCorners3D = util3d::generateKeypoints3DStereo( newCorners3D = util3d::generateKeypoints3DStereo(
@@ -757,10 +759,11 @@ Transform OdometryMono::computeTransform(const SensorData & data, OdometryInfo *
refDepthOrRight_, refDepthOrRight_,
m); m);
} }
else if(!refDepthOrRight_.empty()) else
{ {
UWARN("Depth or right image type not supported: %d", refDepthOrRight_.type()); UWARN("Depth or right image type not supported: %d", refDepthOrRight_.type());
} }
}
for(unsigned int i=0; i<cloud->size(); ++i) for(unsigned int i=0; i<cloud->size(); ++i)
{ {