Robotics StackExchange | Archived questions

Move_base dies on giving goal, exit code - 11

Hi, I am making a custom global planner by editing the code of RAStaralgorithm global planner, but as soon as I am setting an RVIZ goal, movebase dies with exit code -11. I am using ROS Melodic and a custom baseglobal_planner that I made (which was by the way working just fine before, no changes). This is the output of GDB debugger, and this is the output of Valgrind debugger. I am not able to check the mistake in the planner that I've made.

I have put this issue on GitHub too.

Any hints?

Asked by Kanishk598 on 2021-09-05 10:12:43 UTC

Comments

Is it custom base_global_planner that you were running when you got the error? If so, the straight line global planner is not the cause, and including it in the question makes it hard to focus on the issue.

Asked by miura on 2021-09-05 18:43:57 UTC

I'll just remove the "straight" word. Thanks for the suggestion!

Asked by Kanishk598 on 2021-09-05 22:46:05 UTC

Does ADA_result.xlsx get created when I move it? If not, it means that the initialization is not complete.

Asked by miura on 2021-09-06 18:17:52 UTC

ADA_result.xlsx doesn't get created. I am new to nav_core but not C++, do you know of any references from where I can learn the working of nav_core, like what are the essential things to do in the initialization function? I know what to do with the makePlan function, but not initialize. Thanks

Asked by Kanishk598 on 2021-09-08 05:09:13 UTC

sorry, I do not know the reference.

Asked by miura on 2021-09-08 18:55:41 UTC

Answers

ofstream MyExcelFile ("ADA_result.xlsx", ios::trunc);

is outside the function, which is bothering me. I'm wondering if there might be a problem with opening the file outside the function.

Wouldn't it work if I commented the code for MyExcelFile?

If commenting it works, then

ofstream MyExcelFile ("ADA_result.xlsx", ios::trunc);

to ofstream MyExcelFile;.

Then, at the beginning of initialize, call

MyExcelFile.open("ADA_result.xlsx", ios::trunc);

at the beginning of initialize to open the file, and it will work while writing to MyExcelFile.

Asked by miura on 2021-09-08 18:55:48 UTC

Comments

Thank you for your suggestion, however, it is still not working and move_base is dying. I commented all code involving the file, that doesn't work too.

Asked by Kanishk598 on 2021-09-08 23:54:27 UTC

Hmmm, It's difficult.

There are three constructors, aren't there. Couldn't you output a message in each constructor so that it is clear which ADAstarPlannerROS::ADAstarPlannerROS(std::string name, costmap_2d::Costmap2DROS* costmap_ros) is being called?

This will tell you if the constructor you are expecting is being called. It is possible that it was not called in the first place.

Asked by miura on 2021-09-09 18:17:20 UTC

Out of the three constructor functions, only one without any parameters is being called ADAstarPlannerROS::ADAstarPlannerROS() (only this one is able to print stuff on the terminal when I run the navigation stack). However, even though the constructor ADAstarPlannerROS::ADAstarPlannerROS(name, costmap_ros) isn't able to print anything, it is calling the initialize(name, costmap_ros) function as the print line ROS_INFO("ADAstar planner initialized successfully") inside the initialize function is getting printed. This is a very strange behaviour of function calls that I'm seeing for the first time. Any hints?

Asked by Kanishk598 on 2021-09-10 10:33:12 UTC

It seems that initialize is called by move_base. ref: https://github.com/ros-planning/navigation/blob/2b807bd312fac1b476851800c84cb962559cbc53/move_base/src/move_base.cpp#L126

ROS_INFO("ADAstar planner initialized successfully") is displayed, so I guess the initialization was successful. If the initialize is successful, then I guess make_plan is called.If it is called, can you check which part of make_plan is running?

Asked by miura on 2021-09-10 18:43:18 UTC

I solved this. There was a matrix declaration g_score[mapSize] that wasn't getting declared properly due to an invalid scope of size variable passed in the declaration of that matrix. I rewrote the code again adhering to nav_core::BaseGlobalPlanner without any bells & whistles and it worked just fine.

Had to debug by printing stuff on the terminal.

Thanks a lot guys!

Asked by Kanishk598 on 2021-09-15 08:14:24 UTC

@Kanishk598 Congratulations on the solution!

Asked by miura on 2021-09-16 05:23:13 UTC

People looking for more information might require assistance in building their own planners, so I made a template and an example planner for them here.

Asked by Kanishk598 on 2021-09-17 04:56:11 UTC