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

AMCL + Robot_localization conflicts in TF with Gazebo

asked 2023-01-17 08:45:03 -0500

Li-Wei Yang gravatar image

I was trying to fuse AMCL pose with imu and odom in Gazebo for a classic mobile manipulator. The mobile manipulator has diff_drive_controller to publish odom topic (/robot_base_velocity_controller/odom)

My mobile manipulator does not define base_footprint, so I use base_link instead.

My knowledge to tf is that, map->odom->base_link->other links, AMCL will deal with map->odom part, and ekf_localization_node deal with the odom->base_link part, and robot_state_publisher deal with other links.

But roswtf would give off below error:

ERROR TF multiple authority contention:
 * node [/base_to_odom_ekf] publishing transform [base_link] with parent [odom] already published by node [/gazebo]
 * node [/gazebo] publishing transform [base_link] with parent [odom] already published by node [/base_to_odom_ekf]

Is there a way to turn off robot_state_publisher for a certain tf? Or I configured the tf wrong.

In main.launch file:

<node name="robot_state_publisher" pkg="robot_state_publisher" 
    type="robot_state_publisher" respawn="false" output="screen">
<node pkg="robot_localization" type="ekf_localization_node" name="base_to_odom_ekf">
    <remap from="odometry/filtered" to="odom" />
    <rosparam command="load" file="$(find postoffice_sim)/config/ekf/base_to_odom.yaml" />
</node>

base_to_odom.yaml:

frequency: 50
two_d_mode: true
odom0: /robot_base_velocity_controller/odom
odom0_config: [false, false, false,
               false, false, false,
                true,  true, false,
               false, false, true,
               false, false, false]

imu0: imu_data
imu0_config: [false, false, false,
              false, false, true,
              false, false, false,
              false, false,  true,
              false, false, false]

pose0: amcl_pose
pose0_config: [true,  true,  true,
               true,  true,  false,
               false, false, false,
               false, false, false,
               false, false, false]
publish_tf: true
map_frame: map
odom_frame: odom
base_link_frame: base_link
world_frame: odom
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-01-17 23:58:48 -0500

https://github.com/ros-controls/ros_c...

Seems like setting enable_odom_tf to false in your URDF under the diff drive controller plugin.

edit flag offensive delete link more

Comments

Thank you, this solves my problem. It turns out that in my launch file, I loaded .yaml for params

  <rosparam command="load" file="$(find robot_description)/config/control.yaml" />
  <node name="base_controller_spawner" pkg="controller_manager" type="spawner" args="robot_base_joint_publisher robot_base_velocity_controller" />

So simply change URDF is not enough, for others' reference.

Li-Wei Yang gravatar image Li-Wei Yang  ( 2023-01-18 05:58:59 -0500 )edit

@Li-Wei Yang Is your project open-sourced and/or available to check online?

ljaniec gravatar image ljaniec  ( 2023-01-19 18:48:19 -0500 )edit
1

I just push it to GitHub. https://github.com/liver121888/postof... The manipulator is from chapter 5 of https://github.com/PacktPublishing/RO... I made a lot of changes, though, cuz the original code is a mess and uncomplete.

Li-Wei Yang gravatar image Li-Wei Yang  ( 2023-01-21 10:58:08 -0500 )edit
1

@Li-Wei Yang Thank you

ljaniec gravatar image ljaniec  ( 2023-01-22 18:42:57 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-01-17 08:44:38 -0500

Seen: 150 times

Last updated: Jan 17 '23