Fixed export RGB-D SLAM format

This commit is contained in:
matlabbe
2016-02-18 14:49:56 -05:00
parent 829b52db7c
commit 04d153df59
2 changed files with 18 additions and 8 deletions

View File

@@ -108,19 +108,29 @@ bool exportPoses(
{
if(format == 1) // rgbd-slam format
{
// Format: stamp x y z qw qx qy qz
Eigen::Quaternionf q = (*iter).second.getQuaternionf();
// put the pose in rgbd-slam world reference
Transform t( 0, 0, 1, 0,
0, -1, 0, 0,
1, 0, 0, 0);
Transform pose = t.inverse() * iter->second;
t = Transform( 0, 0, 1, 0,
-1, 0, 0, 0,
0,-1, 0, 0);
pose = t.inverse() * pose * t;
// Format: stamp x y z qx qy qz qw
Eigen::Quaternionf q = pose.getQuaternionf();
UASSERT(uContains(stamps, iter->first));
fprintf(fout, "%f %f %f %f %f %f %f %f\n",
stamps.at(iter->first),
(*iter).second.x(),
(*iter).second.y(),
(*iter).second.z(),
q.w(),
pose.x(),
pose.y(),
pose.z(),
q.x(),
q.y(),
q.z());
q.z(),
q.w());
}
else // default / KITTI format
{

View File

@@ -1153,7 +1153,7 @@ bool Rtabmap::process(
if(_proximityByTime &&
rehearsedId == 0 && // don't do it if rehearsal happened
signature->getWords3().size() &&
_memory->isIncremental(), // don't do it in localization mode
_memory->isIncremental() && // don't do it in localization mode
!signature->isBadSignature() &&
signature->getWeight()>=0)
{