-
Notifications
You must be signed in to change notification settings - Fork 44
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
Segmentation Fault caused by "Eigen" #20
Comments
Thank you for sharing! Excuse me, where should this macro be added? |
Thank you for your reply, and I have also tried your method, but it seems that this method did not help me run the entire program. This is the problem I encountered:
Start processing sequence ... Offline semi-dense mapping and line segment extraction |
Try changing the member variable "mLastFrame" of class "Tracking" to a pointer form |
Thank you again for your reply! In fact, I understand how to implement your suggestion. So I consulted some materials and learned from some blogs that this seems to be a step in orb slam2. Is this step already in the code for the case? |
The official program of orb-slam2 has not yet converted "mLastFrame" into a pointer, but I personally believe that this writing method is risky because the "Frame" class contains too many member variables, which can easily cause memory overflow. For example, I once attempted to further introduce line feature extraction (LSD + LBD). According to the official source code, the member variable "mLastFrame" will be called during monocular camera initialization ("MonocularInitialization" function), and at this time, due to further increasing the amount of data loaded in memory, it will cause "Segment Faults". Therefore, dynamically allocating memory (pointer form) may be a more reasonable and secure way. |
Thank you for your reply! Modifying these codes is beyond my ability. |
Both the created class "Object_Map" in file "Object.h" and the modified class "Frame" in file "Frame.h" contain several member variables that are fixed-size vectorizable "Eigen" class. In my computer, these two classes have caused a segmentation fault due to memory misalignment. Therefore, it is recommended to add a macro "EIGEN_MAKE_ALIGNED_OPERATOR_NEW" in the public part of these two classes.
The text was updated successfully, but these errors were encountered: