-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
g2o Assertion `_sizePoses > 0 && "allocating with wrong size"' failed. #259
Comments
Update:
I placed this just before both calls to "optimize" in src/Optimizer.cc in the following function
Note that there are three versions of LocalBundleAdjustment, I only placed the code in this one because the other ones never crashed for me (but I don't know if they were ever called at all). This code makes sure that at least some vertices are not marginalized, which will make sure the assertion error never triggers. If all vertices are marginalized, I understand this to mean "no vertex should be optimized" in which case I abort the optimization process. As to why this happens, I am still not sure. The above worked for me but I'm not sure if my workaround is the correct action to be taken, or whether this error is just a symptom of something else that's going wrong. |
I had the same exact issue, thank you for posting your workaround, it worked for me! Same setup:
after adding the check mentioned above the maps are finally able to merge and tracking works ! |
Cool, I'm glad it helped someone! I was wondering if maybe this was related to the data somehow? I have short sequences and sometimes a bad frame rate. Do you always achieve the 30 FPS? Another issue may be that after getting lost and creating a new map, it very quickly tried to perform the merge - maybe this new map wasn't big enough yet. These are shots in the dark, though, I haven't delved deeper into the code - but maybe we can find a pattern? |
I achieve really good performance (30fps) on a real-time stream from a camera using the Intel Realsense D455 camera (stereo-inertial), I will try and create a pull request with the sample. I am not sure why it happens but both of your guesses seems reasonable. |
I identified cause of the bug. In src/Optimizer.cc file,
This correction make the connection between free Keyframe nodes and Mappoint nodes Sorry for poor English.
|
I quite regularly get this crash:
block_solver.hpp:75: void g2o::BlockSolver::resize(int*, int, int*, int, int) [with Traits = g2o::BlockSolverTraits<6, 3>]: Assertion `_sizePoses > 0 && "allocating with wrong size"' failed.
It seems to happen whenever the system got lost, created a new map and then re-detects the first map and wants to perform a merge.
Not sure if I should report this on g2o's issue tracker or here.
Backtrace below:
Additional Info:
Ubuntu 20.04, running the ROS example.
Changes I made:
Update:
I dug a little deeper and found out that the error happens when all vertices are set "marginalized" by calling setMarginalized() earlier. In this case, _sizePoses will be 0, which is not allowed when _doshur is true.
So it looks like the issue above arises because no vertices are optimizable (?) in my current situation. I'll keep digging why that happens...
The text was updated successfully, but these errors were encountered: