Move_base namespace issue with multi robot simulation
Hey All,
I'm trying to setup a simulation that has multiple turlebot3s running with move_base in a gazebo environment. I'm able to get 1 working just fine but when I try to scale up to multiple robots I run into issues with move_base not working when launched from withing a namespace. The robots will spawn just fine but move_base will continuously publish the following warning:
Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: source_frame base_footprint does not exist.. canTransform returned after 0.101 timeout was 0.1.
I've messed with a bunch of different things and originally followed this ([https://answers.ros.org/question/4143...]) answer but haven't been able to make any progress.
Unfortunately I don't have enough points to upload the image of my tf tree but there is the following connection
[map] ----(tb3_0/amcl)-----> [tb3_0/odom] ------(gazebo)----->[tb3_0/base_footprint]-------(tb3_0/robot_state_publisher)---->[tb3_0/base_link]
This makes is seem like there is definitely a transform between the base_footprint and the map but for some reason move_base can't use it. However, the transform from base_footprint to base_lin only appears to be published once at the very beginning and never again which could cause problems.
Here is the launch file I'm using to try to launch everything. I changed it to one turtlebot3 to try to get move_base launching from within a namespace launching correctly first.
<launch>
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="first_tb3" default="tb3_0"/>
<arg name="second_tb3" default="tb3_1"/>
<arg name="third_tb3" default="tb3_2"/>
<arg name="first_tb3_x_pos" default="-2.0"/>
<arg name="first_tb3_y_pos" default="-1.0"/>
<arg name="first_tb3_z_pos" default=" 0.0"/>
<arg name="first_tb3_yaw" default=" 0.0"/>
<arg name="map_file" default="$(find multi_robot_plan)/map/turtle_arena_map.yaml"/>
<arg name="move_forward_only" default="false"/>
<arg name="cmd_vel_topic" default="/cmd_vel" />
<arg name="odom_topic" default="odom" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />
<!-- Gazebo world -->
<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>
<!-- Map server -->
<node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)">
<param name="frame_id" value="/map"/>
</node>
<!-- First robot -->
<group ns = "$(arg first_tb3)">
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
<param name="publish_frequency" type="double" value="50.0" />
<param name="tf_prefix" value="$(arg first_tb3)" />
</node>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model $(arg first_tb3) -x $(arg first_tb3_x_pos) -y $(arg first_tb3_y_pos) -z $(arg first_tb3_z_pos) -Y $(arg first_tb3_yaw) -param /robot_description" />
<!-- AMCL -->
<include file="$(find turtlebot3_navigation)/launch/amcl ...