Closed marcusabate closed 5 years ago
It's worth clarifying that this isn't happening during the update step. The factors are all added properly. The problem comes when I make a call to RobustPGO::calculateBestEstimate
or RobustPGO::calculateEstimate
. These functions are simple getters for the values_
field of the GenericSolver
base class.
I'm not sure why returning values_
should involve a call to gtsam::Values::tryInsert
.
I will look into this more but note that .size() might be giving issues. When you call .at
It looks like simply calling RobustPGO::calculateEstimate()
is what is causing the issue, not size()
or even at<gtsam::Pose3>()
. But RobustPGO:: calculateEstimate()
simply returns the class member so I'm not sure what is going wrong, unless the copy constructor for gtsam::Values
is doing something strange.
weird hmm since we are also using this a lot in another project and never had any issues with seg faults
When running VIO with loop closure detector, sometimes when a loop closure is detected there is a segfault during RobustPGO's output. Specifically, I add loop closures in the following way:
Then, when loops are detected I want to return the full trajectory. First I want a specific element from the values of the pgo so that I can compute an error transform. This is done like so:
W_Pose_Bkf_estimates_
is guaranteed to be of same size aspgo_
's values.I get this error (in gdb):
So during
calculateBestEstimate
there is an issue. But this simply returns the classgtsam::Values values
member, so there shouldn't be anything wrong there. The backtrace suggests it is a problem in the gtsam library. @yunzc have you seen this before?