Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding LoopClosure checker to serialize a posegraph correctly #182

Open
wants to merge 2 commits into
base: melodic-devel
Choose a base branch
from

Conversation

abylikhsanov
Copy link

I am not sure that I did that correctly as I had a chance to look at karto code only today. I tested on my device and it did not allow to serialize the posegraph at the beginning and it was okay afterwards.

@SteveMacenski
Copy link
Owner

Just to verify before I review: are you saying this 100% fixed your error?

@abylikhsanov
Copy link
Author

Yes, so far it always worked

Copy link
Owner

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept is good, lets rename all the variables though to be clear.

I’m thinking something like optimizer_cached.

Can you add a sentence or two in the readme about “hey, it won’t serialize until a loop closure attempt has been triggered for performance caching reasons”

slam_toolbox/lib/karto_sdk/include/karto_sdk/Mapper.h Outdated Show resolved Hide resolved
@SteveMacenski
Copy link
Owner

Hi, any updates?

@abylikhsanov
Copy link
Author

Hey sorry for a such delay, had a crazy week. I have updated the code now

Copy link
Owner

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveMacenski
Copy link
Owner

I'm debating right now what to do about this -- since we change the serialization signature, I'm not sure if this will corrupt everyone's files.

Have you tried to deserialize a file that was generated before this change into this now new version?

I see there's versioning: https://stackoverflow.com/questions/23230369/boost-class-serialization-change-in-member-types such that we could have new files set to this version, but if missing, then old files will just ignore that field with the if(right_version){ar & variable}

@abylikhsanov
Copy link
Author

But to use the version, how would you add a version? As it also needs to be serialized, isn't?

Yes, I checked again and it will crash if you load the older serialised map

@SteveMacenski
Copy link
Owner

SteveMacenski commented Mar 23, 2020

Mhm. Alright here's what we can do (https://www.boost.org/doc/libs/1_53_0/libs/serialization/doc/tutorial.html search for string if(version > 0)):

  1. Add BOOST_CLASS_VERSION(class_name, 2.1.1) where 2.1.1 is the current melodic package.xml version for all classes. Recompile and check that it's been taken in the serialize function. (just print version)
  2. Version is defaulted to 0 when none given, so we check version and if(version > 0) {serialize/deserialize that variable}. Older files should then work fine. Test and make sure both old and new work.
  3. for all new serialization/deserialization additions, we need to keep the version up to date. (that one's on me)

Does that make sense?

@abylikhsanov
Copy link
Author

Yes, seems straightforward. I will do that tomorrow

@abylikhsanov
Copy link
Author

I have a question. In Mapper.h file, there are two friend classes which do the serialization. From my understanding, I have to stick to the MapperGraph serialization as it just makes sense. Should I only check/serialize in the MapperGraph?

@SteveMacenski
Copy link
Owner

I don't understand the question.

@SteveMacenski
Copy link
Owner

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants