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-tp4336p4504.html

Hi,

1) Do you have an example of database with two scans registered?
2) Odometry always assumes that consecutive scans can be registered together. If we want to register a new scan to map and that scan is not overlapping the previous one added, it could be possible to do by triggering a new map in rtabmap, then sending the new scan with Identity transform. For example, assuming that we cannot ensure that all scans overlap with the previous one, but at least they all overlap to one another scan in the map:
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);

cv::Mat rowRgb2 = getRGBRow(my ix for first capture) // 24 or 8 images wide 
cv::Mat rowDepth2 = getDepthRow(my ix for first capture) 
data1 = SensorData(rowRgb2, rowDepth2, 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
detectParams.insert(ParametersPair(Parameters::kKpDetectorStrategy(), "0")); // use same features for loop closure detection than for motion estimation (SURF here)

Rtabmap rtabmap;
rtabmap.init(detectParams, "myMap.db");

rtabmap.process(data0, Transform::getIdentity());
rtabmap.triggerNewMap();
rtabmap.process(data1, Transform::getIdentity());
rtabmap.triggerNewMap();
rtabmap.process(data2, Transform::getIdentity());
....
Note that I never tried that, so maybe it is not 100% sure that each scan will be correctly merged with the previous maps.

cheers,
Mathieu