ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Move_base dies on giving goal, exit code - 11 [closed]

asked 2021-09-05 10:12:43 -0500

Kanishk598 gravatar image

updated 2021-09-05 22:47:05 -0500

Hi, I am making a custom global planner by editing the code of RA_Star_algorithm global planner, but as soon as I am setting an RVIZ goal, move_base dies with exit code -11. I am using ROS Melodic and a custom base_global_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?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Kanishk598
close date 2021-09-15 08:15:09.322271

Comments

1

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.

miura gravatar image miura  ( 2021-09-05 18:43:57 -0500 )edit
1

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

Kanishk598 gravatar image Kanishk598  ( 2021-09-05 22:46:05 -0500 )edit
1

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

miura gravatar image miura  ( 2021-09-06 18:17:52 -0500 )edit

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

Kanishk598 gravatar image Kanishk598  ( 2021-09-08 05:09:13 -0500 )edit

sorry, I do not know the reference.

miura gravatar image miura  ( 2021-09-08 18:55:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-09-08 18:55:48 -0500

miura gravatar image
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.

edit flag offensive delete link more

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.

Kanishk598 gravatar image Kanishk598  ( 2021-09-08 23:54:27 -0500 )edit
1

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.

miura gravatar image miura  ( 2021-09-09 18:17:20 -0500 )edit

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?

Kanishk598 gravatar image Kanishk598  ( 2021-09-10 10:33:12 -0500 )edit
1

It seems that initialize is called by move_base. ref: https://github.com/ros-planning/navig...

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?

miura gravatar image miura  ( 2021-09-10 18:43:18 -0500 )edit
1

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!

Kanishk598 gravatar image Kanishk598  ( 2021-09-15 08:14:24 -0500 )edit
1

@Kanishk598 Congratulations on the solution!

miura gravatar image miura  ( 2021-09-16 05:23:13 -0500 )edit

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.

Kanishk598 gravatar image Kanishk598  ( 2021-09-17 04:56:11 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-09-05 10:12:43 -0500

Seen: 129 times

Last updated: Sep 08 '21