Ask Your Question
0

How to remap robot frame names using gazebo_ros spawn_model

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

verena gravatar image

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

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

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

ref: https://wiki.ros.org/tf#static_transf...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 150 times

Last updated: Nov 06 '20