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

nav2d Multi Agent Exploration

asked 2020-09-15 19:29:03 -0500

GageAsch gravatar image

updated 2020-09-22 14:39:03 -0500

Platform: Ubuntu 18.04 VM on VirtualBox

I've read this thread and I am trying to do the same thing. I've completed tutorials 1-3 and I noticed that something has changed regarding nav2d services. rosservice call /StartMapping 3 would fail in tutorial 3 while rosservice call /StartMapping would not. It would raise an exception that no parameters were expected.

So when moving onto "combining" tutorials 3 and 4 to get multi agent exploration by following the configuration and steps in the thread linked. I used rosservice call /robot_0/StartMapping instead of rosservice call /robot_0/StartMapping 3 as the latter would fail.

Pictured is the output I would get running the recommended commands after adding the Operator, Navigator and the ActionClients to both robot namespaces.rosservice call /robot_0/StartMapping would not move robot_0 like it would in tutorial 3. I even tried copying tutorial 3's mapper over to each robots namespace with no luck.

Considering that the question was asked 6 years ago has anything changed that I'm missing here? Has anyone encountered a similar issue?

Here is the edited tutorial4 launch file:


<!-- Some general parameters -->
<param name="use_sim_time" value="true" />

<!-- Start Stage simulator with a given environment -->
<node name="Stage" pkg="stage_ros" type="stageros" args="$(find nav2d_tutorials)/world/">
    <param name="base_watchdog_timeout" value="0" />

<!-- Start the joystick-driver and remote-controller for operation-->
<node name="Joystick" pkg="joy" type="joy_node" />
<node name="Remote" pkg="nav2d_remote" type="remote_joy" />

<node name="R0_MapAlign" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 /map /robot_0/map 100"/>
<node name="R1_MapAlign" pkg="tf" type="static_transform_publisher" args="40 0 0 0 0 0 /map /robot_1/map 100"/>

<group ns="robot_0">
    <param name="robot_id" value="1" />
    <param name="tf_prefix" type="string" value="robot_0"/>
    <rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>

    <!-- Start the Operator to control the simulated robot -->
    <node name="Operator" pkg="nav2d_operator" type="operator" >
        <remap from="scan" to="base_scan"/>
        <rosparam file="$(find nav2d_tutorials)/param/operator.yaml"/>
        <rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="local_map" />

    <!-- Start the Navigator to move the robot autonomously -->
    <node name="Navigator" pkg="nav2d_navigator" type="navigator">
        <rosparam file="$(find nav2d_tutorials)/param/navigator.yaml"/>

    <node name="GetMap" pkg="nav2d_navigator" type="get_map_client" />
    <node name="Explore" pkg="nav2d_navigator" type="explore_client" />
    <node name="SetGoal" pkg="nav2d_navigator" type="set_goal_client" />

    <node name="Mapper" pkg="nav2d_karto" type="mapper">
        <remap from="scan" to="base_scan"/>
        <rosparam file="$(find nav2d_tutorials)/param/mapper.yaml"/>

    <!-- Commenting Out
    <node name="Mapper" pkg="nav2d_karto" type="mapper">
        <remap from="scan" to="base_scan"/>
        <remap from="karto_in" to="/shared_scans_r2"/>
        <remap from="karto_out" to="/shared_scans_r1"/>
        <rosparam file="$(find nav2d_tutorials)/param/mapper.yaml"/>


<group ns="robot_1">
    <param name="robot_id" value="2" />
    <param name="tf_prefix" type="string" value="robot_1"/>
    <rosparam file="$(find ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-01-18 04:59:27 -0500

Sebastian Kasperski gravatar image

About the StartMapping service, the parameter was indeed removed some years ago, so it's just called with no params now.

About the error message you receive I cannot really say much about it. Have you checked ros-console whether there are any errors or warnings when you call StartMapping on robot_0?

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-09-15 19:29:03 -0500

Seen: 143 times

Last updated: Jan 18 '21