Re: RTABMAP standalone for localization in xyz (Kinect Xbox 360)
Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/RTABMAP-standalone-for-localization-in-xyz-Kinect-Xbox-360-tp2706p2789.html
Hi,
Can you share a couple of images to test the code with? Along with calibration file you used, to see if the inputs are correct at first.
In the first example, the keyframe changes at every frame, so multiplying the transform would give you the pose from the starting position of the camera. If t is null, you may not change the keyframe:
Transform pose = Transform::getIdentity();
while(frame.isValid())
{
Transform t = registration.computeTransformation(previousFrame, frame);
if(t.isNull())
{
printf("Could not compute motion\n");
}
else
{
pose *= t;
printf("%d Motion: %s\n", k, pose.prettyPrint().c_str());
previousFrame = frame;
}
frame = camera.takeImage();
k++;
}
The transform is printed in meters and angles in radian: "x y z roll pitch yaw". Features are by detected by default by OpenCV GFTT detector, then BRIEF descriptors are extracted from the keypoints. Descriptors are matched using NNDR (Nearest Neighbor Distance Ratio) approach.
EDITThe optical rotation is optional, but required if you want the poses in
ROS referential: x-forward, y-left, z-up. Without optical rotation, the poses will be in camera frame: x-right, y-down, z-backward.
cheers,
Mathieu