-
Notifications
You must be signed in to change notification settings - Fork 524
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
Slam_toolbox crashes when loading a serialised map #178
Comments
Does this only happen when you do it right after the first scan? I'd merge a PR that keeps a boolean around to check if its processed once before serialization. That is a strict requirement due to some performance optimizations and is why that's happening I suspect. I understand why that's happening - I never expected someone would want to serialize the file on that frequent of a basis since serialization blocks the SLAM process and takes a bunch of memory. You may expect crashes if your system doesn't have alot of staticly available memory since serialization will require all that data to be on the stack and if you don't have enough memory available, it's going to be a bad time. I'd recommend backing this off to every few minutes, not seconds. Have you tried this after waiting for a few scans to enter in and the optimizer to be called? If it works after that point, then we know the issue with your use. Also, make sure that you're using the 18.04 rosdep Ceres install. If you build it from source or otherwise have built/installed another version (as cartographer may require), I will not support that. There are various differences between them and I don't have the cycles to debug anything but the supported versions.
I'm not sure I understand this comment. There is no serialization available in localization mode.
I don't understand this request. Are you asking me to debug your code? |
Yes, it crashes right after getting a first scan. Are you saying that during SLAM whenever I call a service to serialize my current map, there is a chance that the service can serialize without the scan being processed and whenever I load a pose graph and the node deserializes it crashes? I am not planning to serialize a map every 5 seconds rather it was just a test but I am planning to do so once every 1-2 minutes as the environment is quite dynamic and I want to keep my map up to date automatically. Yes, the localization mode cannot serialize a map by default but I just added this feature to always save the latest map in a dynamic environment (like warehouses).
|
This sentence doesn't make sense. Please rephrase into multiple sentences and around a single idea. What I think your seeing is the following:
But since you're serializing before that graph optimization occurs, you're not setting up that stuff, and then things are failing. Did you try, as I suggest above?
If it works after that point, that's root cause and then you can submit a PR:
and just return failed if not able to serialize. There's really no value in a serialized map before a graph optimization has been run anyhow. |
Ok, I think I get it now. Please correct me if I am wrong, whenever optimization occurs, karto does some sort of a correction (if needed) to the robot pose and because at the very beginning, my robot did not move (which is required by your code in order to make processScan to return True), no optimization occurred and I was saving incomplete pose graph. So If I make sure that whenever someone requests to serialize a map during SLAM and the scan has not been processed, the service simply rejects a request. If that is correct then the PR would be quite simple with just a few lines of code which I can submit |
Correct up to this point. It is complete. Again, there are optimizations afoot. Don’t worry about the specifics but you can’t save a pose graph without at least 1 loop closure attempt in the optimizer. |
Closing this issue as the problem root has been determined and a possible solution is being suggested (pull request above) |
Required Info:
Steps to reproduce issue
During async_slam, I have created a small node that calls /slam_toolbox/serialize service every 5 seconds:
Interestingly, it only works once and does not call the service again after rate.sleep(), even though it should.
When I then start a localization node with loading a saved serialized map, I get this error (right after getting a first scan):
Expected behavior
The service should be called every 5 seconds from the simple code above.
The crash should not happen after 1st scan
Actual behavior
Code from the above calls the service only once and only once the map is saved.
The crash appears after starting a localization node with a map above.
Additional information
The text was updated successfully, but these errors were encountered: