Physical Multirobot AMCL Not Able To Transform To /map
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:
- On the Turtlebot launch
ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_0"
- On the Linux workstation (and all following steps) launch
ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_remote.launch multi_robot_name:=tb3_0
roslaunch voronoi_node_generator map_provider.launch
(see launch files below)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 ...
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 thetb3_0/base_scan
frame?@JackB Thanks for the response! Indeed. I get some laser readings, and the frame_id field from the message is "base_scan"
The frame_id field for the laser scan should be
/tb3_0/base_scan
shouldn't it?@JackB From my understanding, it is.
base_scan
is the name, but judging by the tf_tree, it still has thetb3_0
tf prefix. When you load up a situation like this. should the scan topic include the tf_prefix in the frame_id?When you echo the
/tb3_0/scan
topic, there should be a field in the message header callframe_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.