Robotics StackExchange | Archived questions

Multi robot (turtlebot3) navigation issues with laser data and map frame

Hi, I am working on Multi-robot navigation, I have followed this topic. I am able to complete the first part which spawns multiple turtlebots in the gazebo with their respective namespaces. Once I try setting up the navigation stack I face the following warnings

[ WARN] [1629021283.562207144, 17.354000000]: No laser scan received (and thus no pose updates have been published) 
for 17.354000 seconds.  Verify that data is being published on the /robot1/scan topic.
[ WARN] [1629021283.563194584, 17.354000000]: Frame_id of map received:'/map' doesn't match global_frame_id:'map'. 
This could cause issues with reading published topics

when I do,

rostopic echo  /robot1/scan

I get the following output which confirms that the data is being published on the /robot1/scan topic

---
header: 
seq: 280
stamp: 
secs: 68
nsecs: 229000000
frame_id: "robot1_tf/base_scan"
angle_min: 0.0
angle_max: 6.28318977356
angle_increment: 0.0175019223243
time_increment: 0.0
scan_time: 0.0
range_min: 0.119999997318
range_max: 3.5
ranges: [0.36660903692245483, 0.3823273181915283, 0.38093674182891846, 0.3956436514854431, ....]
intensities: [0.0, 0.0, 0.0, 0.0 ....]

I can visualise the laser data in Rviz. Below I've attached all the launch files associated. I am using ROS melodic and Turtlebot3

main.launch

  <launch>
  <!--param name="/use_sim_time" value="true" /-->

  <!-- start world -->
  <!--node name="gazebo" pkg="gazebo_ros" type="gazebo" 
  args="$(find turtlebot_gazebo)/worlds/empty_wall.world" respawn="false" output="screen" /-->

  <!-- start gui -->
  <!--node name="gazebo_gui" pkg="gazebo_ros" type="gui" respawn="false" output="screen"/-->



<include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find turtlebot3_gazebo)/worlds/turtlebot3_world.world"/>
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
</include>

<!-- include our robots -->
<include file="$(find multi_robot_nav)/launch/robots.launch"/>
</launch>

one_robot.launch

<launch>
 <arg name="robot_name"/>
 <arg name="init_pose"/>

 <node name="spawn_minibot_model" pkg="gazebo_ros" type="spawn_model"
 args="$(arg init_pose) -urdf -param /robot_description -model $(arg robot_name)"
 respawn="false" output="screen" />

 <node pkg="robot_state_publisher" type="robot_state_publisher" 
      name="robot_state_publisher" output="screen"/>

<!-- The odometry estimator, throttling, fake laser etc. go here -->
<!-- All the stuff as from usual robot launch file -->
</launch>

robots.launch

<launch>
  <!-- No namespace here as we will share this description. 
   Access with slash at the beginning -->

  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <!--
  <arg name="x_pos" default="3.0"/>
  <arg name="y_pos" default="1.0"/>
  <arg name="z_pos" default="0.0"/> -->
  <param name="robot_description"
  command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />

  <!-- BEGIN ROBOT 1-->
  <group ns="robot1">
   <param name="tf_prefix" value="robot1_tf" />
   <include file="$(find multi_robot_nav)/launch/one_robot.launch" >
   <arg name="init_pose" value="-x 1 -y 1 -z 0" />
   <arg name="robot_name"  value="Robot1" />
   </include>
   </group>

   <!-- BEGIN ROBOT 2-->
   <group ns="robot2">
   <param name="tf_prefix" value="robot2_tf" />
   <include file="$(find multi_robot_nav)/launch/one_robot.launch" >
   <arg name="init_pose" value="-x -1 -y 1 -z 0" />
   <arg name="robot_name"  value="Robot2" />
   </include>
   </group>
 </launch>

multi.launch

<launch>
 <!--param name="/use_sim_time" value="true"/-->

 <!-- Run the map server -->
 <node name="map_server" pkg="map_server" type="map_server" args="$(find multi_robot_nav)/map/mymap.yaml" >
 <param name="frame_id" value="/map" />
 </node>

 <group ns="robot1">
 <param name="tf_prefix" value="robot1_tf" />
 <param name="amcl/initial_pose_x" value="1" />
 <param name="amcl/initial_pose_y" value="1" />
 <include file="$(find multi_robot_nav)/launch/move_base.launch" />
 </group>

 <group ns="robot2">
 <param name="tf_prefix" value="robot2_tf" />
 <param name="amcl/initial_pose_x" value="-1" />
 <param name="amcl/initial_pose_y" value="1" />
 <include file="$(find multi_robot_nav)/launch/move_base.launch" />
 </group>

 <node pkg="rviz" type="rviz" name="rviz"
 output="screen" />

</launch>

move_base.launch

<launch>

  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <param name="/use_sim_time" value="true" />


  <!--- Run AMCL -->
  <include file="$(find multi_robot_nav)/launch/amcl.launch" />

  <!-- Define your move_base node -->

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

  <rosparam file="$(find multi_robot_nav)/nav/costmap_common_params_$(arg model).yaml" command="load" 
  ns="global_costmap" />
  <rosparam file="$(find multi_robot_nav)/nav/costmap_common_params_$(arg model).yaml" command="load" 
  ns="local_costmap" />
  <rosparam file="$(find multi_robot_nav)/nav/local_costmap_params.yaml" command="load" />
  <rosparam file="$(find multi_robot_nav)/nav/global_costmap_params.yaml" command="load" />
  <rosparam file="$(find multi_robot_nav)/nav/move_base_params.yaml" command="load" />
  <rosparam file="$(find multi_robot_nav)/nav/dwa_local_planner_params_$(arg model).yaml" command="load" />

  </node>

</launch>

After launching main.launch and multi.launch I get the following error in rviz

Fixed Frame [map] does not exist

Below I have attached the rqttftree here

rqt_graph here

I have used all the default turtlebot3 planner files such as localcostmapparams.yaml, globalcostmapparams.yaml which can be found here

Asked by bashrc on 2021-08-15 05:50:36 UTC

Comments

The warnings concerning Fixed Frame [map] does not exist could simply be that when in RViz, under Global Options, the default is Fixed Frame - map, but since you launch everything in namespaces and with prefixes, maybe try selecting a different option. According to your rqt_graph, map topic is not receiving any information, but I'm not sure what /map 's purpose is. For launching multiple robots at the same time I would also recommend writing a static publisher node that connects both robots' tf_trees.

Asked by sniegs on 2021-08-16 06:49:24 UTC

If I change the fixed frame to something else, the map does not load properly in Rviz

Asked by bashrc on 2021-08-16 23:24:25 UTC

@bashrc could you please update your question with the images attached directly to the question? I've given you enough karma to do so

Asked by jayess on 2021-08-17 22:10:17 UTC

I'm in the same probiems, but still can't fix it. Could you tell me the way to solve this ?

Asked by quyetbui on 2022-05-14 01:25:00 UTC

Answers