mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 08:47:45 +08:00
fixed build for latest rtabmap library
This commit is contained in:
+11
-4
@@ -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
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user