Rosanswers logo

I'm trying to get multiple physical Turtlebot3's functioning with AMCL with namespaces. My setup works perfectly fine with the Gazebo simulations, but moving it to the real thing causes issues.

After running AMCL I get the error:

No laser scan received (and thus no pose updates have been published) for 1600396510.205957 seconds.  Verify that data is being published on the /tb3_0/scan topic.

I have looked at the solution found here: https://answers.ros.org/question/325980/amcl-no-laser-scan-received/ But I couldn't seem to see what I am doing wrong.

There was also another source that I found here: https://github.com/wachlinn/mrc_hw8/blob/master/launch/amcl_tb0.launch

but this seemed to have the same setup that I had.

My steps are as follows:

  1. On the Turtlebot launch ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_0"
  2. On the Linux workstation (and all following steps) launch ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_remote.launch multi_robot_name:=tb3_0
  3. roslaunch voronoi_node_generator map_provider.launch (see launch files below)
  4. roslaunch basic_swarm swarm_amcl.launch multi_robot_name:=tb3_0

Here are the two launch files from steps 3

  <arg name="map_name"  default="dining"/>
  <node pkg="map_server" name="map_server" type="map_server" args="$(find voronoi_node_generator)/maps/$(arg map_name).yaml"/>

and 4:

  <!-- Arguments -->
  <arg name="scan_topic"        default="scan"/>
  <arg name="initial_pose_x"    default="0.0"/>
  <arg name="initial_pose_y"    default="0.0"/>
  <arg name="initial_pose_a"    default="0.0"/>
  <arg name="multi_robot_name"  doc="User assigned robot namespace."/>
  <arg name="global_frame_id"   default="map"/>
  <arg name="init_with_global"  default="false"/>

  <!-- AMCL -->
  <group ns="$(arg multi_robot_name)">
    <node pkg="amcl" type="amcl" name="amcl">

      <param name="min_particles"             value="500"/>
      <param name="max_particles"             value="3000"/>
      <param name="kld_err"                   value="0.02"/>
      <param name="update_min_d"              value="0.20"/>
      <param name="update_min_a"              value="0.20"/>
      <param name="resample_interval"         value="1"/>
      <param name="transform_tolerance"       value="0.5"/>
      <param name="recovery_alpha_slow"       value="0.00"/>
      <param name="recovery_alpha_fast"       value="0.00"/>
      <param name="initial_pose_x"            value="$(arg initial_pose_x)"/>
      <param name="initial_pose_y"            value="$(arg initial_pose_y)"/>
      <param name="initial_pose_a"            value="$(arg initial_pose_a)"/>
      <param name="gui_publish_rate"          value="50.0"/>

      <remap from="scan"                      to="$(arg scan_topic)"/>
      <param name="laser_max_range"           value="3.5"/>
      <param name="laser_max_beams"           value="180"/>
      <param name="laser_z_hit"               value="0.5"/>
      <param name="laser_z_short"             value="0.05"/>
      <param name="laser_z_max"               value="0.05"/>
      <param name="laser_z_rand"              value="0.5"/>
      <param name="laser_sigma_hit"           value="0.2"/>
      <param name="laser_lambda_short"        value="0.1"/>
      <param name="laser_likelihood_max_dist" value="2.0"/>
      <param name="laser_model_type"          value="likelihood_field"/>

      <param name="odom_model_type"           value="diff"/>
      <param name="odom_alpha1"               value="0.1"/>
      <param name="odom_alpha2"               value="0.1"/>
      <param name="odom_alpha3"               value="0.1"/>
      <param name="odom_alpha4"               value="0.1"/>
      <param name="tf_prefix"                 value="$(arg multi_robot_name)"/>
      <param name="odom_frame_id"             value="$(arg multi_robot_name)/odom"/>
      <param name="base_frame_id"             value="$(arg multi_robot_name)/base_footprint"/>
      <param name="global_frame_id"           value="$(arg global_frame_id)"/>
      <remap from="initialpose"               to="initialpose"/>
      <remap from="amcl_pose"                 to="amcl_pose"/>
      <remap from="particlecloud"             to="particlecloud"/>
      <remap from="map"                       to="/map"/>
      <remap from="map_metadata"              to="/map_metadata"/>
      <param name="use_map_topic" value="true"/>

    <node name="init_localize" pkg="basic_swarm" type="init_localize.py" if="$(arg init_with_global)"/>


And lastly it looks as though my tf and node trees are fine: /map is not being used

everything seems to be in order

Originally posted by cwillia109 on ROS Answers with karma: 49 on 2020-09-17

Post score: 0

Original comments

Comment by JackB on 2020-09-17:
Well you tf tree is not exactly fine because you are missing your map frame right? And just to verify, you did rostopic echo /tb3_0/scan and you find that the data is in fact being published in the tb3_0/base_scan frame?

Comment by cwillia109 on 2020-09-17:
@JackB Thanks for the response! Indeed. I get some laser readings, and the frame_id field from the message is "base_scan"

Comment by JackB on 2020-09-18:
The frame_id field for the laser scan should be /tb3_0/base_scan shouldn't it?

Comment by cwillia109 on 2020-09-18:
@JackB From my understanding, it is. base_scan is the name, but judging by the tf_tree, it still has the tb3_0 tf prefix. When you load up a situation like this. should the scan topic include the tf_prefix in the frame_id?

Comment by JackB on 2020-09-18:
When you echo the /tb3_0/scan topic, there should be a field in the message header call frame_id. The value of the frame_id should be /tb3_0/base_scan. If the frame_id in the header message is not /tb3_0/base_scan then it will not know how to transform the scan into your robots reference frame.


1 Answer 1


Rosanswers logo

Thanks to @JackB I was able to find the issue. Everything is set up correctly in the launch files. The only issues was when calling turtlebot3_robot.launch.

Taken from the instructions: ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_0" set_lidar_frame_id:="tb3_0/base_scan" was the correct way of calling it. Looking at the tf_tree it, already looked as though the lidar frame was tb3_0/base_scan, but it was not. This step turned out to be absolutely crucial.

Originally posted by cwillia109 with karma: 49 on 2020-09-19

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by JackB on 2020-09-19:
So happy I could help!


Your Answer

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