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

Physical Multirobot AMCL Not Able To Transform To /map

asked 2020-09-17 21:48:32 -0600

cwillia109 gravatar image

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/3259... 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/b...

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

<launch>
  <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"/>
</launch>

and 4: <launch>

  <!-- 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 ...
(more)
edit retag flag offensive close merge delete

Comments

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?

JackB gravatar image JackB  ( 2020-09-17 22:57:12 -0600 )edit

@JackB Thanks for the response! Indeed. I get some laser readings, and the frame_id field from the message is "base_scan"

cwillia109 gravatar image cwillia109  ( 2020-09-17 23:20:40 -0600 )edit

The frame_id field for the laser scan should be /tb3_0/base_scan shouldn't it?

JackB gravatar image JackB  ( 2020-09-18 08:24:30 -0600 )edit

@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?

cwillia109 gravatar image cwillia109  ( 2020-09-18 18:11:13 -0600 )edit
1

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.

JackB gravatar image JackB  ( 2020-09-18 19:14:11 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-09-19 18:16:00 -0600

cwillia109 gravatar image

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.

edit flag offensive delete link more

Comments

1

So happy I could help!

JackB gravatar image JackB  ( 2020-09-19 18:48:59 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-09-17 21:48:32 -0600

Seen: 217 times

Last updated: Sep 19 '20