fixed build for latest rtabmap library

This commit is contained in:
Mathieu Labbe
2015-04-24 10:35:50 -04:00
parent 48e3ff6dde
commit b2a6bcb6fd
7 changed files with 73 additions and 21 deletions
+11 -4
View File
@@ -263,6 +263,7 @@ CoreWrapper::CoreWrapper(bool deleteDbOnStart) :
oldParameterNames.push_back("RGBD/ScanMatchingSize");
oldParameterNames.push_back("RGBD/LocalLoopDetectionRadius");
oldParameterNames.push_back("RGBD/ToroIterations");
oldParameterNames.push_back("Mem/RehearsedNodesKept");
for(std::list<std::string>::iterator iter=oldParameterNames.begin(); iter!=oldParameterNames.end(); ++iter)
{
std::string vStr;
@@ -298,6 +299,12 @@ CoreWrapper::CoreWrapper(bool deleteDbOnStart) :
Parameters::kRGBDOptimizeIterations().c_str());
parameters_.at(Parameters::kRGBDOptimizeIterations())= vStr;
}
else if(iter->compare("Mem/RehearsedNodesKept") == 0)
{
ROS_WARN("Parameter name changed: Mem/RehearsedNodesKept -> %s. Please update your launch file accordingly.",
Parameters::kMemNotLinkedNodesKept().c_str());
parameters_.at(Parameters::kMemNotLinkedNodesKept())= vStr;
}
}
}
@@ -2040,10 +2047,10 @@ std::map<int, rtabmap::Transform> CoreWrapper::updateMapCaches(
// Stereo detected, we should uncompress left image too
data.uncompressDataConst(&image, 0, 0);
}
float fx = data.getDepthFx();
float fy = data.getDepthFy();
float cx = data.getDepthCx();
float cy = data.getDepthCy();
float fx = data.getFx();
float fy = data.getFy();
float cx = data.getCx();
float cy = data.getCy();
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudRGB;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloudXYZ;
+41 -11
View File
@@ -215,7 +215,7 @@ void linkToROS(const rtabmap::Link & link, rtabmap_ros::Link & msg)
cv::KeyPoint keypointFromROS(const rtabmap_ros::KeyPoint & msg)
{
return cv::KeyPoint(msg.ptx, msg.pty, msg.size, msg.angle, msg.response, msg.octave, msg.class_id);
return cv::KeyPoint(msg.pt.x, msg.pt.y, msg.size, msg.angle, msg.response, msg.octave, msg.class_id);
}
void keypointToROS(const cv::KeyPoint & kpt, rtabmap_ros::KeyPoint & msg)
@@ -223,8 +223,8 @@ void keypointToROS(const cv::KeyPoint & kpt, rtabmap_ros::KeyPoint & msg)
msg.angle = kpt.angle;
msg.class_id = kpt.class_id;
msg.octave = kpt.octave;
msg.ptx = kpt.pt.x;
msg.pty = kpt.pt.y;
msg.pt.x = kpt.pt.x;
msg.pt.y = kpt.pt.y;
msg.response = kpt.response;
msg.size = kpt.size;
}
@@ -248,6 +248,36 @@ void keypointsToROS(const std::vector<cv::KeyPoint> & kpts, std::vector<rtabmap_
}
}
cv::Point2f point2fFromROS(const rtabmap_ros::Point2f & msg)
{
return cv::Point2f(msg.x, msg.y);
}
void point2fToROS(const cv::Point2f & kpt, rtabmap_ros::Point2f & msg)
{
msg.x = kpt.x;
msg.y = kpt.y;
}
std::vector<cv::Point2f> points2fFromROS(const std::vector<rtabmap_ros::Point2f> & msg)
{
std::vector<cv::Point2f> v(msg.size());
for(unsigned int i=0; i<msg.size(); ++i)
{
v[i] = point2fFromROS(msg[i]);
}
return v;
}
void points2fToROS(const std::vector<cv::Point2f> & kpts, std::vector<rtabmap_ros::Point2f> & msg)
{
msg.resize(kpts.size());
for(unsigned int i=0; i<msg.size(); ++i)
{
point2fToROS(kpts[i], msg[i]);
}
}
void mapGraphFromROS(
const rtabmap_ros::Graph & msg,
std::map<int, rtabmap::Transform> & poses,
@@ -394,10 +424,10 @@ void nodeDataToROS(const rtabmap::Signature & signature, rtabmap_ros::NodeData &
compressedMatToBytes(signature.getImageCompressed(), msg.image);
compressedMatToBytes(signature.getDepthCompressed(), msg.depth);
compressedMatToBytes(signature.getLaserScanCompressed(), msg.laserScan);
msg.fx = signature.getDepthFx();
msg.fy = signature.getDepthFy();
msg.cx = signature.getDepthCx();
msg.cy = signature.getDepthCy();
msg.fx = signature.getFx();
msg.fy = signature.getFy();
msg.cx = signature.getCx();
msg.cy = signature.getCy();
transformToGeometryMsg(signature.getLocalTransform(), msg.localTransform);
//Features stuff...
@@ -454,8 +484,8 @@ rtabmap::OdometryInfo odomInfoFromROS(const rtabmap_ros::OdomInfo & msg)
info.wordMatches = msg.wordMatches;
info.wordInliers = msg.wordInliers;
info.refCorners = keypointsFromROS(msg.refCorners);
info.newCorners = keypointsFromROS(msg.newCorners);
info.refCorners = points2fFromROS(msg.refCorners);
info.newCorners = points2fFromROS(msg.newCorners);
info.cornerInliers = msg.cornerInliers;
return info;
@@ -479,8 +509,8 @@ void odomInfoToROS(const rtabmap::OdometryInfo & info, rtabmap_ros::OdomInfo & m
msg.wordMatches = info.wordMatches;
msg.wordInliers = info.wordInliers;
keypointsToROS(info.refCorners, msg.refCorners);
keypointsToROS(info.newCorners, msg.newCorners);
points2fToROS(info.refCorners, msg.refCorners);
points2fToROS(info.newCorners, msg.newCorners);
msg.cornerInliers = info.cornerInliers;
}