How to remap robot frame names using gazebo_ros spawn_model
Hello,
I want to setup a multi robot navigation simulation in Gazebo with the Turtlebot3 on ROS noetic.
Therefore, I organize my robot nodes in groups and apply the tf_prefix
params.
However, the spawn_model
node does not reflect the tf remappings.
Hence, my tf tree looks like this and consequently amcl does not work as the frames are not connected properly:
This is my launch file:
<launch>
<arg name="name" default="turtlebot"/>
<arg name="move_forward_only" default="false"/>
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<group ns="$(arg name)">
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />
<node pkg="gazebo_ros" type="spawn_model" name="spawn_urdf" args="-urdf -model turtlebot3_$(arg model) -x 0.5 -y 0.5 -z 0 -param robot_description" >
<param name="tf_prefix" value="$(arg name)" type="str"/>
</node>
<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="base_frame" value="$(arg name)/base_link"/>
<param name="tf_prefix" value="$(arg name)"/>
</node>
<include file="$(find turtlebot3_movement_manager)/launch/amcl.launch">
<arg name="name" value="$(arg name)"/>
<param name="tf_prefix" value="$(arg name)"/>
</include>
</group>
</launch>
Do you have any hints?
Thanks a lot!