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

How to create an action server for navigation?

asked 2018-10-16 03:37:00 -0500

stevemartin gravatar image

I have created my own robot and already created a 2d map using gmapping with laser. The simple amcl localization is used in rviz (laser - particle filter) and my robot is able to localize in a created pmg map in rviz. Now, I want to send a goal coordinates for my robot for it to navigate within a map and I have created a new package and a new node like following this tutorial: http://wiki.ros.org/navigation/Tutori...

I can see that it waits for the server and when I launch this node, I get the move_base/goal topic but the client just awaits. How can I create this server?

edit retag flag offensive close merge delete

Comments

So you are stuck here I guess:

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

Is this message showing all the time? Also do you have move_base running?

pavel92 gravatar image pavel92  ( 2018-10-16 03:50:12 -0500 )edit

You should look into the actionlib doc and also the action lib tutorials to understand the basics of it first.

Delb gravatar image Delb  ( 2018-10-16 03:56:43 -0500 )edit

@pavel92 Yes, it shows every 5 seconds. It is running.

stevemartin gravatar image stevemartin  ( 2018-10-16 04:55:19 -0500 )edit

@Delb I have read that tutorial, in Action Server CPP file, they have included chores::DoDishesGoalConstPtr& goal in void execute. What will be equivalentvent to that in move_base_msgs::MoveBaseAction ?

stevemartin gravatar image stevemartin  ( 2018-10-16 05:20:32 -0500 )edit

You should continue investigating the tutorials it's explained (here). For move_base that should be move_base_msgs::MoveBaseGoalConstPtr& goal

Delb gravatar image Delb  ( 2018-10-16 05:33:02 -0500 )edit

@stevemartin: what sort of robot do you have? A differential drive platform?

If so: unless you want to learn how to write your own action server for this, I would suggest to use one of the available diff drive packages or ros_control plugins. That will save you quite some time.

gvdhoorn gravatar image gvdhoorn  ( 2018-10-16 05:36:09 -0500 )edit

@gvdhoorn Yes, a mobile robot. I can see that the plugin is responsible for the movement and I believe it publishes to /cmd_vel topic. But I was looking for the navigation of my robot. I want to send a goal coordinates and let my robot to navigate to that point (in known map).

stevemartin gravatar image stevemartin  ( 2018-10-16 06:00:12 -0500 )edit

The navigation stack is typically responsible for consuming nav goals and then transforming those into Twist msgs published on cmd_vel topics that ultimately make the robot move.

It's rare for someone to write their own MoveBaseGoal consumer.

gvdhoorn gravatar image gvdhoorn  ( 2018-10-16 06:03:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-01 03:29:32 -0500

pavel92 gravatar image

I had the similar situation a while ago when the move_base action server was not coming up. The reason was that move_base and the node where the action client was created were in different namespaces. After they were put in the same namespace the problem was solved.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-10-16 03:37:00 -0500

Seen: 818 times

Last updated: Nov 01 '18