First, thanks for the great work to @gaoxiang12 and all the maintainers.
Found an issue in the backend loop:
If somehow execution is slowed down, std::map::at() throws out of range exception as it is looking for an element in vertices that has not been added yet.
The faulty line is:
edge->setVertex(0, vertices.at(frame->keyframe_id_));
This happens because if enough time has passed from when the vertices are assigned with the value from the map, a landmark might be observed by a keyframe that has not been inserted yet in the pose vertices.
To be sure, I added a check on the landmark vertices as well, even if the problem presents itself because of pose vertices.
Steps to replicate: just add some LOG(INFO) 's right before edge->setId(index); to slow down execution intentionally and error should pop up.
First, thanks for the great work to @gaoxiang12 and all the maintainers.
Found an issue in the backend loop:
If somehow execution is slowed down, std::map::at() throws out of range exception as it is looking for an element in vertices that has not been added yet.
The faulty line is:
edge->setVertex(0, vertices.at(frame->keyframe_id_));
This happens because if enough time has passed from when the vertices are assigned with the value from the map, a landmark might be observed by a keyframe that has not been inserted yet in the pose vertices.
To be sure, I added a check on the landmark vertices as well, even if the problem presents itself because of pose vertices.
Steps to replicate: just add some LOG(INFO) 's right before
edge->setId(index);
to slow down execution intentionally and error should pop up.