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

nav2d autonomous multi robot exploration

asked 2014-09-11 02:49:14 -0600

Marco_F gravatar image

updated 2014-09-11 05:15:26 -0600

Hi everyone,

I started using the nav2d package and did the four tutorials with success.

In the 3rd tutorial you can make a robot autonomously explore an unknown map. In the 4th, you can move two robots via joystick, exploring a map and have one robot localize itself via amcl.

What I'm trying to achieve is a sort of "mix" between the two tutorials, that is having two robots autonomously exploring and building the map while having one of them localizing itself.

I'm struggling on the rqt_graph and launch files, trying to understand how to make stuff work, but without results until now (I'm pretty new to ROS and don't know how the nav2d package elements work in detail). Can someone help figure out how to achieve this goal?

Thank you very much for your kind help,


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-11 07:36:27 -0600

Sebastian Kasperski gravatar image

Hello Marco,

if you completed the 4th tutorial, you are almost there. Just add the Operator and Navigator (and optionally the ActionClients) two both robot namespaces with the same parameters as in tutorial3. And don't forget to remove the sim_joy node, so the Operator can take control of the robots.

Then you can start the first robot with:

rosservice call /robot_0/StartMapping 3
// Wait for it to finish
rosservice call /robot_0/StartExploration 2

The most tricky part is how to activate the localization on the second robot. You can either add a joy_node and remote_controller to the "robot_1" namespace and do it manually by driving it around like in tutorial 4, or you set the action goal manually with:

rostopic pub /robot_1/Localize/goal nav2d_navigator/LocalizeActionGoal "header:
  seq: 0
    secs: 0
    nsecs: 0
  frame_id: ''
    secs: 0
    nsecs: 0
  id: ''
  velocity: 0.5"

Just TAB after "nav2d_navigator/LocalizeActionGoal" to complete the message and change the velocity to something > 0. However this sometimes fails depending on the map. If the localization succeeded, you can start the second robot with:

rosservice call /robot_1/StartExploration 2

Now both robots will explore until the map is completely covered.

edit flag offensive delete link more

answered 2014-09-11 09:07:44 -0600

Marco_F gravatar image

Hello Sebastian,

thank you very much for your fast help :) it works! I must say that I was near to the solution, what I was missing was that I had to manually start robot_1 localization. Moreover, you said that the localization of robot_1 may fail depending on the map, and I experimented that it can also depend on when you start the localization.

Without meaning to take advantage of your kindness, may I ask you two more questions?

  1. When robot_1 starts its localization, I got the following error spamming on the console (i put output="screen" in the nodes I added in tutorial4 launch file): "[ERROR] [1410440608.176896222, 224.700000000]: Could not get robot position: Could not find a connection between 'robot_1/map' and 'robot_1/base_link' because they are not part of the same tree.Tf has two or more unconnected trees.". Is there something I can do to solve this problem, or can I ignore it?
  2. In RVIZ, R0:RobotModel (and R1:RobotModel) has the error "No transform from [robot_0/p3at_back_left_wheel] to [map]" on robot_X/p3at_back_left_wheel (the same for the back/front left/right wheels). I got this error in tutorial4 aswell, so I imagine it can be related to p2os and the fact that I'm on Hydro. Unluckily I have absolutely no knowledge on how robot models are built, my bad. Do you have any suggestion on how to fix this problem?

Again, thank you very much,


edit flag offensive delete link more



About 1: This is the navigator complaining that it is not localized, which is of course the case during localization. This error should not be there, so you can safely ignore it.

About 2: As you said, this is a problem originated in p2os. The model is eye candy anyway, so I suggest to ignore this.

Sebastian Kasperski gravatar image Sebastian Kasperski  ( 2014-09-11 09:24:22 -0600 )edit

Allright, thank you very much again!

Marco_F gravatar image Marco_F  ( 2014-09-11 09:44:14 -0600 )edit

Question Tools



Asked: 2014-09-11 02:49:14 -0600

Seen: 1,178 times

Last updated: Sep 11 '14