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

move_base action topics exist but client stuck on waitForServer

asked 2020-02-25 04:58:04 -0500

Rufus gravatar image

updated 2020-02-25 05:01:17 -0500

When I run rostopic list, I see the following (among others)

/move_base/cancel
/move_base/current_goal
/move_base/feedback
/move_base/goal
/move_base/result
/move_base/status
/move_base_simple/goal

However, my action client is still permanently stuck waiting for /move_base

typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient;

MoveBaseClient move_base_client("/move_base", true);
while(!move_base_client.waitForServer(ros::Duration(5.0)))
{
    ROS_INFO("Waiting for the move_base action server to come up");
}

Everything is running on the same PC.

What am I doing wrong??

edit retag flag offensive close merge delete

Comments

Are you providing odom topic? If I remember correctly it waits for odom to appear.

Choco93 gravatar image Choco93  ( 2020-02-25 07:54:25 -0500 )edit

can you please update your question with the full output of rostopic list. Also what is the name of the node where you are creating the action client?

pavel92 gravatar image pavel92  ( 2020-02-26 05:49:12 -0500 )edit

@pavel92 thx for the response, but I believe I've found the root cause of the problem.

Rufus gravatar image Rufus  ( 2020-02-27 01:55:00 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-02-26 02:17:59 -0500

Rufus gravatar image

updated 2020-02-27 01:54:14 -0500

Turns out move_base is not "fully" up until a map is published. It's strange how the topics show up but the action server only becomes available after the map is published.

Notice that move_base action server is the first thing created when move_base constructor is called, but is only started near the end.

My problem is that somewhere along the way in move_base's constructor, the plugin static_layer is loaded which spins until a map is received.

Somehow I wasn't smart enough to correlate the message

Requesting the map...

With move_base not being fully constructed, hence hanging on waitForServer

I also wouldn't be surprised if there are other things that need to happen before move_base can be fully constructed and the action server started. e.g. as Choco93 suggests, odom needs to be published (I have not verified this)

I may not be seeing the full picture, but I would have placed the creation of the action server "nearer" to the starting of the server. I believe this would improve debuggability in a sense that I won't be seeing the topics while the server is in fact inoperable.

edit flag offensive delete link more

Comments

Actually, odom is not needed for the action server to show up correctly. You can check that if dig through the documentation of waitForServer call and the other methods that are called within (waitForActionServerToStart and isServerConnected ) . The only check that is done afaik is waiting for topics based on defined timeout.

pavel92 gravatar image pavel92  ( 2020-02-26 03:49:56 -0500 )edit

So I still think that it is a namespace issue. You client is trying to connect to a server that does not exist

pavel92 gravatar image pavel92  ( 2020-02-26 03:50:51 -0500 )edit

Hmm that's strange, as I did not fix it by changing any topic names, but by publishing to /map

Rufus gravatar image Rufus  ( 2020-02-26 05:33:28 -0500 )edit
0

answered 2020-02-26 01:52:36 -0500

pavel92 gravatar image

It is usually a namespace issue. From the code chunk you provided it looks like your client is initialized to look for move_base within a global namespace:

MoveBaseClient move_base_client("/move_base", true);

Make sure you are launching move_base and your node where you have your client within the same namespace so that the client can find the server started by move_base.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-02-25 04:58:04 -0500

Seen: 1,370 times

Last updated: Feb 27 '20