Re: Losing odometry when doing fixed point scanning
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Losing-odometry-when-doing-fixed-point-scanning-tp4336p4460.html
Hi,
You don't need to extract features prior to send merged images to rtabmap. However to get transformation between two SensorData, use Odometry class:
cv::Mat rowRgb0 = getRGBRow(my ix for first capture) // 24 or 8 images wide
cv::Mat rowDepth0 = getDepthRow(my ix for first capture)
data0 = SensorData(rowRgb0, rowDepth0, cameraModels);
cv::Mat rowRgb1 = getRGBRow(my ix for first capture) // 24 or 8 images wide
cv::Mat rowDepth1 = getDepthRow(my ix for first capture)
data1 = SensorData(rowRgb1, rowDepth1, cameraModels);
ParametersMap detectParams;
detectParams.insert(ParametersPair(Parameters::kVisFeatureType(), "0")); // SURF feature for example
detectParams.insert(ParametersPair(Parameters::kVisMaxFeatures(), "0")); // no limit of features extracted
detectParams.insert(ParametersPair(Parameters::kVisEstimationType(), "0")); // should be 0 for multi cameras
OdometryF2M odom(detectParams);
Rtabmap rtabmap;
rtabmap.init(detectParams, "myMap.db");
OdometryInfo info;
Transform pose0 = odom.process(data0, &info);
printf("Pose=%s\n", pose0.prettyPrint().c_str()); // would be always identity for the first frame
rtabmap.process(data0, pose0, info.reg.covariance);
Transform pose1 = odom.process(data1, &info);
printf("Pose=%s\n", pose1.prettyPrint().c_str());
rtabmap.process(data1, pose1, info.reg.covariance);