move_base with custom global planner: process has died: exit code -11
When I run my own global_planner as a plugin-package, It only runs for a few minutes before it returns an error. as follows:
[move_base-4] process has died [pid 25024, exit code -11, cmd /opt/ros/melodic/lib/move_base/move_base cmd_vel:=/cmd_vel odom:=odom __name:=move_base __log:=/home/Guapiii/.ros/log/c0843674-a893-11eb-84fb-04d4c4afb67f/move_base-4.log].
log file: /home/Guapiii/.ros/log/c0843674-a893-11eb-84fb-04d4c4afb67f/move_base-4*.log
- In my log directory: /home/Guapiii/.ros/log/c0843674-a893-11eb-84fb-04d4c4afb67f/ , There is no log file names move_base-4*.log Why?
- What is the cause of this error?
[move_base-4] process has died [pid 25024, exit code -11
- Where can I get the reason for these error code?
My ROS version is Melodic. Looking forward to your reply!
-11
is aSEGFAULT
, typically caused by out-of-bounds array/vector access, invalid pointer dereferences (use after free for instance) and similar problems.I'd suggest compiling your code in debug mode and running the
move_base
node insidegdb
(or some other debugger) and then wait for it to crash.It might be good to get some experience debugging applications before you start with
move_base
. Especially learning how to print and interpret backtraces would be good.Thanks for your answer! I will learn about debugging as you said.
Did you get any solution? I am having the exact same problem.
I had the exact problem. Not 100% sure the following is the solution but it worked for me. The
globalPlanner()
class constructor is overloaded. One with NO arguments and the other with arguments(std::string name, costmap_2d::Costmap2DROS* costmap_ros)
. I had the following line in the constructor with no argumentsprivate_nh.param("step_size", step_size_, costmap_->getResolution());
. (I now understand that was stupid of me to do that :-D). So I think essentially, if there are lines of code that seems innocuous on first glance should be commented out leaving the very minimal ones should do the trick (debugging as suggested by gvdhoorn is the proper way).2nd thing: After correcting the above, I had this strange
symbol look error
which said_ZN18base_loc al_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE
. Solved by addingbase_local_planner
to thefind_package()
inCMakeLists.txt
Did you get any solutions? I am having the exact same problem.