0
$\begingroup$

Rosanswers logo

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,

Regards.


Originally posted by Marco_F on ROS Answers with karma: 23 on 2014-09-11

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
goal_id:
  stamp:
    secs: 0
    nsecs: 0
  id: ''
goal:
  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.


Originally posted by Sebastian Kasperski with karma: 1658 on 2014-09-11

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.