appliedAI-Initiative / orb_slam_2_ros

A ROS implementation of ORB_SLAM2
Other
608 stars 282 forks source link

Orbslam 2 Error code -11 #26

Closed tiagojdias closed 5 years ago

tiagojdias commented 5 years ago

Hello, i've working with this version of orbslam2 for ros usage for a little while.

I've reworked the node in order to extract an odometry, which, in general, i think is the most relevant result to take in terms of SLAM algorithms.

Currently i'm experiencing a crash on ros Kinetic which gives an "error code -11". I haven't found a solution for that but re-spawning seems to fix it. I've looking into CPU, memory consumption and every is normal (the node itself consumes one thread at most).

This is the output:

[orb_slam2_d435_rgbd-47] process has died [pid 10046, exit code -11, cmd /home/agv/ros_ws/devel/lib/orb_slam2_ros/orb_slam2_ros_rgbd /home/agv/ros_ws/src/tb_ros/orb_slam_2_ros/orb_slam2/Vocabulary/ORBvoc.txt /home/agv/ros_ws/src/tb_ros/orb_slam_2_ros/orb_slam2/config/RealSenseD435RGBD.yaml /camera/rgb/image_raw:=/camera_front/color/image_raw /camera/depth_registered/image_raw:=/camera_front/aligned_depth_to_color/image_raw __name:=orb_slam2_d435_rgbd __log:=/home/agv/.ros/log/6f4f172c-77f0-11e9-9b09-e0d55e8c1304/orb_slam2_d435_rgbd-47.log]. log file: /home/agv/.ros/log/6f4f172c-77f0-11e9-9b09-e0d55e8c1304/orb_slam2_d435_rgbd-47*.log

Help would be appreciated, and if more information is needed i will provide.

lennarthaller commented 5 years ago

Hm, if you modified the code it is going to be hard to help you with no context. What do you mean by odometry? Do you want to publish odom messages? Be aware that the resulting path might not be continuous if a loop closure occurs.

tiagojdias commented 5 years ago

Yes you are completely right.

I am using the SLAM mode on since my environment is pretty huge and dynamic. Sometimes i can easily lose track so i have added in the ROS wrapper a reset mode (using the one that was previously created by Raul). Thus, everytime i lose track i'm able to restart the current process and continue.

Now, since i'm applying the reset, my absolute localization is not reliable (origin of the reference frame goes to zeros). My work around was to get two consecutive measurements and derive instantaneous velocities from them. Whenever i get a reset i discard the first measurement and start everything again, to ensure consistency.

It is working pretty well, there is only that exit code problem. But if you can provide me your feedback would be nice.

I am using gbd right now to check if the current issue is on the libraries or ros wrapper (doubt it). Just wanted to know if it was already familiar to you, because there are currently some people having it raulmur/ORB_SLAM2#510 and Changliu52/ORB_SLAM2_ROS#3.

Thanks for the reply.

lennarthaller commented 5 years ago

Ah ok, now I understand. That is a very interesting feature! Regarding the Error code -11 - I haven't encountered that myself yet but I am very happy that you reported it. I will do some testing. Are you memory constrained? Maybe your map size grows too large? I'm just speculating at this point.

Best,

Lennart

ChronoCookie commented 2 years ago

Hi

just wanted to leave that here in case someone got this Error. I got this Error with another Version of ORBSLAM2. After comparing differnt Versions, the Source of the Error is in most Versions. I got it resolved by changeing the read function in the modified DBoW2 Libary. The read functions didn't throw an Error if the Path to the File was wrong. I modified the Functions with a combination of diffent implementations.

After the Problem got resolved by using the absolute Path in the ROS-Launchfile instead of the relative PATH. For an example the Function loadFromTextFile(...).

So in conclusion it seems like that this Error-Code is triggert by trying to read from an non existing PATH. For an example in my case the Error got resolved by changing one relative PATH in the Launchfile from: Vocabulary/ORBvoc.txt to the absolute PATH: /home/$(USER)/STDynSLAM_ws/src/STDyn-SLAM/Vocabulary/ORBvoc.txt

PS: One of the side effects for .txt files was, that the RAM got fully occupied.