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

How to remap robot frame names using gazebo_ros spawn_model

asked 2020-11-05 15:12:46 -0600

verena gravatar image


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: image description

This is my launch file:

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

  <include file="$(find turtlebot3_movement_manager)/launch/amcl.launch">
    <arg name="name" value="$(arg name)"/>
    <param name="tf_prefix" value="$(arg name)"/>




Do you have any hints?

Thanks a lot!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-11-06 07:40:44 -0600

miura gravatar image

How about connecting base_footprint and turtle_bot/base_footprint with static_transform_publisher?

<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0 0 0 0 0 0 0 turtle_bot/base_footprint foot_print 100" />


edit flag offensive delete link more

Question Tools



Asked: 2020-11-05 15:12:46 -0600

Seen: 504 times

Last updated: Nov 06 '20