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

Unconnected tree in hector_slam ( How to kill the gazebo broadcaster node / Delete a frame from tf tree)

asked 2016-08-27 01:47:14 -0600

patrchri gravatar image

updated 2016-08-27 22:23:02 -0600

Hello,

I am looking at the hector_mapping package of the hector_slam stack and I have an issue.

If I visit this page at the bottom of the page I can see the required tf transforms for the node to run. Which is a tf from lidar frame -> base_link. I provide this transform fine to the node via the robot_state_publisher.

I have the following launch file for the node:

<?xml version="1.0"?>

<launch>
  <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
  <arg name="base_frame" default="base_footprint"/>
  <arg name="odom_frame" default="base_footprint"/>
  <arg name="pub_map_odom_transform" default="true"/>
  <arg name="scan_subscriber_queue_size" default="5"/>
  <arg name="scan_topic" default="/labrob/laser/scan"/>
  <arg name="map_size" default="2048"/>

  <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

    <!-- Frame names -->
    <param name="map_frame" value="map" />
    <param name="base_frame" value="$(arg base_frame)" />
    <param name="odom_frame" value="$(arg odom_frame)" />

    <!-- Tf use -->
    <param name="use_tf_scan_transformation" value="true"/>
    <param name="use_tf_pose_start_estimate" value="false"/>
    <param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>

    <!-- Map size / start point -->
    <param name="map_resolution" value="0.050"/>
    <param name="map_size" value="$(arg map_size)"/>
    <param name="map_start_x" value="0.5"/>
    <param name="map_start_y" value="0.5" />
    <param name="map_multi_res_levels" value="2" />

    <!-- Map update parameters -->
    <param name="update_factor_free" value="0.4"/>
    <param name="update_factor_occupied" value="0.9" />    
    <param name="map_update_distance_thresh" value="0.01"/>
    <param name="map_update_angle_thresh" value="0.001" />
    <param name="laser_z_min_value" value = "-1.0" />
    <param name="laser_z_max_value" value = "1.0" />

    <!-- Advertising config --> 
    <param name="advertise_map_service" value="true"/>

    <param name="scan_subscriber_queue_size" value="$(arg scan_subscriber_queue_size)"/>
    <param name="scan_topic" value="$(arg scan_topic)"/>

    <!-- Debug parameters -->
    <!--
      <param name="output_timing" value="false"/>
      <param name="pub_drawings" value="true"/>
      <param name="pub_debug_output" value="true"/>
    -->
    <param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
  </node>

  <!--<node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 map nav 100"/>-->
</launch>

When I test the node in rviz, I get good map results. However, when I rosrun tf view_frames I see the following tree :

image description

I ran roswtf and I get the following errors:

Found 2 error(s).

ERROR TF re-parenting contention:
 * reparenting of [base_footprint] to [map] by [/hector_mapping]
 * reparenting of [base_footprint] to [odom] by [/gazebo]

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

The cause of this is that the existence of 2 parents for the base_footprint frame, correctly? I have the following plugin in my urdf model as a gazebo element, which automatically broadcasts the connection odom -> base_footprint:

  <gazebo>
   <plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">

            <rosDebugLevel>Debug</rosDebugLevel>
            <publishWheelTF>False</publishWheelTF>
            <publishWheelJointState>True</publishWheelJointState>
            <alwaysOn>True</alwaysOn>
            <updateRate>100.0</updateRate>
            <leftJoint>joint_r_wheel</leftJoint>
            <rightJoint>joint_l_wheel</rightJoint>
        <wheelSeparation>0.22</wheelSeparation>
            <wheelDiameter>0.16</wheelDiameter>
            <broadcastTF>0</broadcastTF>            
            <wheelTorque>30</wheelTorque>
        <commandTopic>/labrob/cmd_vel</commandTopic>
            <robotBaseFrame>base_footprint</robotBaseFrame>
        <legacyMode>true</legacyMode>

   </plugin>
  </gazebo>

Whatever I try to change, the broadcasting from the gazebo node remains.

How is it possible to kill the gazebo broadcasting without killing the gazebo simulation or is it possible to delete a frame from ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-08-28 02:25:10 -0600

DavidN gravatar image
edit flag offensive delete link more

Comments

Firstly, thank you for your idea ! :) I didn't think of remapping.

For me for some reason it doesn't work the remapping you specifically proposed, probably it's something wrong that I do, but I hope I will find it.

patrchri gravatar image patrchri  ( 2016-08-28 06:49:15 -0600 )edit

I tried to modify the launch file in the root directory and for some reason the gazebo node kept using the tf. I then tried to copy paste the empty_world.launch to my package directory and use it from there still didn't work. Anyway in case I don't find something, I will ask again. Thanks again :)

patrchri gravatar image patrchri  ( 2016-08-28 06:51:38 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-08-27 01:47:14 -0600

Seen: 601 times

Last updated: Aug 28 '16