fairf4x / dso_ros

ROS wrapper for dso
GNU General Public License v3.0
0 stars 1 forks source link

Crashes on initialization #2

Open fairf4x opened 7 years ago

fairf4x commented 7 years ago

So far I have been able to track two different types of "crash":

  1. Problem with reseting the FullSystem pointer resulting in: double free or corruption (!prev) This might be related to 2. because this also leads to creating new instance of FullSystem but the GDB trace actually points to the destructor of FullSystem class.

  2. Eigen related assertion that points here This happens when new instance of FullSystem class is allocated and therefore an instance of CalibHessian structure is created as a private variable.

GDB backtraces are attached.

BTW: ROS launchfiles can be modified to run GDB.

Errors_DSO.txt

fairf4x commented 7 years ago

Problem can be solved by disabling alignment in dso code:

diff --git a/src/util/NumType.h b/src/util/NumType.h
index a12d420..0bdf2de 100644
--- a/src/util/NumType.h
+++ b/src/util/NumType.h
@@ -80,8 +80,8 @@ typedef Eigen::Matrix<float,CPARS,8> MatC8f;
 typedef Eigen::Matrix<double,8,8> Mat88;
 typedef Eigen::Matrix<double,7,7> Mat77;

-typedef Eigen::Matrix<double,CPARS,1> VecC;
-typedef Eigen::Matrix<float,CPARS,1> VecCf;
+typedef Eigen::Matrix<double,CPARS,1,Eigen::DontAlign> VecC;
+typedef Eigen::Matrix<float,CPARS,1,Eigen::DontAlign> VecCf;
 typedef Eigen::Matrix<double,13,1> Vec13;
 typedef Eigen::Matrix<double,10,1> Vec10;
 typedef Eigen::Matrix<double,9,1> Vec9;

After this modification the node does not crash but still does not work - no odometry messages published. The last messages printed when running the node are:

[ERROR] [1494880782.033187318]: [DSO_NODE]: RESET Current position: 0, 0, 0
destroyed ThreadReduce
fairf4x commented 7 years ago

The node was not reading correct image topic. This should produce some warning message. Otherwise the node works and resets automatically when lost.