Landmark poses can be exported with format=11. Report: added option poses_raw to export poses not aligned with ground truth (default it is).

This commit is contained in:
matlabbe
2024-09-22 19:53:27 -07:00
parent 21abdddbff
commit 8c0e57bc52
2 changed files with 85 additions and 14 deletions

View File

@@ -104,7 +104,20 @@ bool exportPoses(
#endif
if(fout)
{
for(std::map<int, Transform>::const_iterator iter=poses.begin(); iter!=poses.end(); ++iter)
std::list<std::pair<int, Transform> > posesList;
for(std::map<int, Transform>::const_iterator iter=poses.lower_bound(0); iter!=poses.end(); ++iter)
{
posesList.push_back(*iter);
}
if(format == 11)
{
// Put landmarks at the end
for(std::map<int, Transform>::const_iterator iter=poses.begin(); iter!=poses.end() && iter->first < 0; ++iter)
{
posesList.push_back(*iter);
}
}
for(std::list<std::pair<int, Transform> >::const_iterator iter=posesList.begin(); iter!=posesList.end(); ++iter)
{
if(format == 1 || format == 10 || format == 11) // rgbd-slam format
{
@@ -125,7 +138,7 @@ bool exportPoses(
// Format: stamp x y z qx qy qz qw
Eigen::Quaternionf q = pose.getQuaternionf();
if(iter == poses.begin())
if(iter == posesList.begin())
{
// header
if(format == 11)