mpkuse / cerebro

Intelligent place recognition module for vins-fusion
166 stars 44 forks source link

some problem #13

Closed MoonUniverse closed 5 years ago

MoonUniverse commented 5 years ago

Hi @mpkuse ! I have tasted the code for some weeks,i find some problem about this project! First: what(): std::bad_alloc

[ INFO] [1567006054.174485223]: Subscribe to imu_worldpose_topic: /vins_estimator/imu_propagate
Start `periodic_publish_odoms`
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
Start reinit_ceres_problem_onnewloopedge_optimize6DOF()
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
---node_len=(0  to  5072)   loopedge_len=(0 to 0)   
No new loop edge, sleep again!
[NodeDataManager::camera_pose_callback] 1st pose creating at t=1567006055.340228319
looks like you loaded from file
[NodeDataManager::mark_as_unkidnapped_and_signal_start_of_world] _t_begin=1567006055.340228319
[NodeDataManager::nodeidx_of_world_i_started] ERROR no such world 1 exists
[periodic_publish_odoms] sleep() for 100milis. This is done just as a precaution because next world may not be immediately available after unkidnap. It takes usually upto 500milisec for vins to reinitialize. This warning is not very critial.
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
[cerebro_node-2] process has died [pid 2320, exit code -6, cmd /home/tmirobot/TmiRobot/VSLAM_V2/devel/lib/cerebro/cerebro_node __name:=cerebro_node __log:=/home/tmirobot/.ros/log/863f0118-c999-11e9-8312-94c691a91e1a/cerebro_node-2.log].
log file: /home/tmirobot/.ros/log/863f0118-c999-11e9-8312-94c691a91e1a/cerebro_node-2*.log

Startup sequence: realsense node >> cerebro Cause this problem Startup sequence: cerebro >> realsense node it's good! no problem.

Second: Screenshot from 2019-08-28 22-58-17 It’s often impossible to locate in the map.I don't know if this question is related to the deletion of the following code?

Matrix4d NodeDataManager::get_imu_T_cam() const
{
    std::lock_guard<std::mutex> lk(imu_cam_mx);
    // Remove this if, once i am confident everythinbg is ok!
    // if( imu_T_cam_available == false )
    // {
    //     ROS_ERROR( "[NodeDataManager::get_imu_T_cam] posegraph solver, you requested imu_T_cam aka imu-cam extrinsic calib, but currently it is not available. FATAL ERROR.\n");
    //     exit(1);
    // }
    assert( imu_T_cam_available );
    return imu_T_cam;
}

But if I don't delete this code i will got a bug!

[ERROR] [1567006503.628649348]: [NodeDataManager::get_imu_T_cam] posegraph solver, you requested imu_T_cam aka imu-cam extrinsic calib, but currently it is not available. FATAL ERROR.

[keyframe_pose_graph_slam_node-3] process has died [pid 3712, exit code 1, cmd /home/tmirobot/TmiRobot/VSLAM_V2/devel/lib/solve_keyframe_pose_graph/keyframe_pose_graph_slam __name:=keyframe_pose_graph_slam_node __log:=/home/tmirobot/.ros/log/863f0118-c999-11e9-8312-94c691a91e1a/keyframe_pose_graph_slam_node-3.log].
log file: /home/tmirobot/.ros/log/863f0118-c999-11e9-8312-94c691a91e1a/keyframe_pose_graph_slam_node-3*.log

Thank you for much!!!

mpkuse commented 5 years ago

For the 1st part, seem like the error is from the pose graph solver. Could you disable the pose graph solver? In the launch just enclose it with tags and set it to zero. See my launch files for example. On your datasets, make sure that the cerebro part (place recognition only) works wells. You could disable some of the tasks. Look at the cerebro_node.cpp, I have sprinkled a lot of comments to help.

For the get_imu_T_cam, I recommend you don't comment out my code, but instead disable the thread which does the 200hz computation (I used this topic to control the quadrotor, but it is not needed for normal visualization). You could do this my looking at the composer class in pose graph solver repo and keyframe_pose_graph_solver_node in https://github.com/mpkuse/solve_keyframe_pose_graph/tree/master/src.

Another tip, at each of the threads, I have #defines which could use to know what is happening in those threads.

Do let me know if you could get just the cerebro part working correctly, I could help you out for the pose graph solver.

mpkuse commented 5 years ago

I think "realsense node >> cerebro" is causing problem because, I am waiting the vins (odometry) and connection to the image descriptor solver.

When I run the code, I usually start the realsense drive preceeded by a sleep for a few seconds. You could try that.

MoonUniverse commented 5 years ago

Yes,when I start the realsense drive preceeded by a sleep for a few seconds,it's no problem.Now,the biggest problem is can't locate in the map.Even if the cerebro part works properly,Relocalization still fails! Screenshot from 2019-08-29 18-36-28

Screenshot from 2019-08-29 02-08-38

mpkuse commented 5 years ago

So the way comparison happens is a simple dot product, Could you plot the dot product chart?

Look at this function:

I suggest you turn on logging for these two functions and log all your matches. You need to set the #defines (see my comments in those functions).

However, if the environments is too self-similar this is going to struggle. Is the match shown in the screenshot you posted correctly identified ?

MoonUniverse commented 5 years ago

yes,the match is correctly! I am trying logging to find the problem.