zang09 / ORB_SLAM3_ROS2

ROS2 wrapping package for orbslam3 library
216 stars 81 forks source link

Error running rgb-d SLAM ROS2 (humble): double free or corruption (out) [ros2run]: Aborted #24

Open RodrigofrBastos opened 6 months ago

RodrigofrBastos commented 6 months ago

System Setup:

When setting everything to run ORBSLAM3, trying to run $ ros2 run orbslam3 rgbd PATH_TO_VOCABULARY PATH_TO_YAML_CONFIG_FILE and receiving the following output:

Loading ORB Vocabulary. This could take a while...
Vocabulary loaded!

Initialization of Atlas from scratch 
Creation of new map with id: 0
Creation of new map with last KF id: 0
Seq. Name: 
There are 1 cameras in the atlas
Camera 0 is pinhole
Shutdown

Saving keyframe trajectory to KeyFrameTrajectory.txt ...
double free or corruption (out)
[ros2run]: Aborted

For solving this error what is needed to do?

RodrigofrBastos commented 6 months ago

After searching for a while, I found a website that had that answer, basically you need to replace https://github.com/zang09/ORB_SLAM3_ROS2/blob/00c54335ccc010d74c1e24e336aa817604124947/src/rgbd/rgbd-slam-node.cpp#L11C1-L12C122 Replace with the following lines:

rgb_sub = std::make_shared<message_filters::Subscriber<ImageMsg> >(this, "/camera/rgb");
depth_sub = std::make_shared<message_filters::Subscriber<ImageMsg> >(this, "/camera/depth");

Now it should work.

RodrigofrBastos commented 6 months ago

Someone had the same problem?

TSoli commented 5 months ago

Yes this fixed it for me, thanks very much!