Ardrones are unable to takeoff after launching in gazebo.When i tried to roswtf i getting tf multiple authority contention

asked 2019-04-10 02:29:32 -0600

Pramod gravatar image

updated 2019-04-12 00:03:22 -0600

Here's my launch file :

<?xml version="1.0"?>
<launch>

  <!-- Include the world -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find cvg_sim_gazebo)/worlds/empty.world"/>
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
  </include>


  <!-- send the robot XML to param server -->
  <arg name="model_urdf" value="$(find cvg_sim_gazebo)/urdf/quadrotor_sensors.urdf.xacro"/>

  <!-- Spawn 1st simulated quadrotor uav -->
  <group ns="ardrone_1">  
    <param name="robot_description" command="$(find xacro)/xacro.py '$(arg model_urdf)'"/>
    <node name="spawn_robot_ardrone" pkg="gazebo_ros" type="spawn_model"
          args="-param robot_description
                -urdf
                -x 0
                -y 0
                -z 0.5
                -R 0
                -P 0 
                -Y 0
                -model ardrone_1"
           respawn="false" output="screen"/>

    <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="tf_prefix" value="ardrone_1" />
    </node>
    <node name="ground_truth_to_tf" pkg="message_to_tf" type="message_to_tf" output="screen">
      <param name="odometry_topic" value="ground_truth/state" />
      <param name="frame_id" value="nav" />
      <param name="tf_prefix" value="ardrone_1" />
    </node>
  </group> 


  <!-- Spawn 2nd simulated quadrotor uav -->
  <group ns="ardrone_2">
    <param name="robot_description" command="$(find xacro)/xacro.py '$(arg model_urdf)'"/>
    <node name="spawn_robot_ardrone_2" pkg="gazebo_ros" type="spawn_model"
          args="-param robot_description
                -urdf
                -x 1.0 
                -y 1.0
                -z 0.5
                -R 0
                -P 0 
                -Y 0
                -model ardrone_2"
          respawn="false" output="screen"/>

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher_2" output="screen" >
      <param name="publish_frequency" type="double" value="50.0" />
      <param name="tf_prefix" value="ardrone_2" />
    </node>

    <node name="ground_truth_to_tf_2" pkg="message_to_tf" type="message_to_tf" output="screen">
      <param name="odometry_topic" value="ground_truth/state" />
      <param name="frame_id" value="nav" />
      <param name="tf_prefix" value="ardrone_2" />
    </node>
  </group>

  <!-- Spawn 3rd simulated quadrotor uav -->
 <group ns="ardrone_3">
    <param name="robot_description" command="$(find xacro)/xacro.py '$(arg model_urdf)'"/>
    <node name="spawn_robot_ardrone_3" pkg="gazebo_ros" type="spawn_model"
          args="-param robot_description
                -urdf
                -x 0 
                -y 1
                -z 0.5
                -R 0
                -P 0 
                -Y 0
                -model ardrone_3"
          respawn="false" output="screen"/>

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher_3" output="screen" >   
      <param name="publish_frequency" type="double" value="50.0" />
      <param name="tf_prefix" value="ardrone_3"/>
    </node>

    <node name="ground_truth_to_tf_3" pkg="message_to_tf" type="message_to_tf" output="screen">
      <param name="odometry_topic" value="ground_truth/state" />
      <param name="frame_id" value="map" />
      <param name="tf_prefix" value="ardrone_3"/>
    </node> 
  </group>

</launch>

and Iam getting errors like this in roswtf:

WARNING These nodes have died:
 * ardrone_2/spawn_robot_ardrone_2-7
 * ardrone_1/spawn_robot_ardrone-4
 * ardrone_3/spawn_robot_ardrone_3-10


Found 2 error(s).

ERROR TF multiple authority contention:
 * node [/ardrone_3/ground_truth_to_tf_3] publishing transform [base_footprint] with parent [map] already published by node [/ardrone_1/ground_truth_to_tf]
 * node [/ardrone_3/ground_truth_to_tf_3] publishing transform [base_stabilized] with parent [base_footprint] already published by node [/ardrone_1/ground_truth_to_tf]
 * node [/ardrone_3/ground_truth_to_tf_3] publishing transform [base_link] with parent [base_stabilized] already published by node [/ardrone_1/ground_truth_to_tf]
 * node [/ardrone_2/ground_truth_to_tf_2] publishing transform [base_footprint] with parent [map] already published by node [/ardrone_3/ground_truth_to_tf_3]
 * node [/ardrone_2/ground_truth_to_tf_2] publishing transform [base_stabilized] with parent [base_footprint] already published by node [/ardrone_3/ground_truth_to_tf_3]
 * node [/ardrone_2/ground_truth_to_tf_2] publishing transform [base_link] with parent [base_stabilized] already published by node [/ardrone_3/ground_truth_to_tf_3]
 * node [/ardrone_1/ground_truth_to_tf] publishing transform [base_footprint] with parent [map] already published by node ...
(more)
edit retag flag offensive close merge delete

Comments

How are you running this and what package(s) did you install to simulate the AR.Drone?

jayess gravatar imagejayess ( 2019-04-12 02:00:08 -0600 )edit

iam running it in gazebo.I installed tum_simulator,tum_ardrone,robot_state_publisher,ardrone_autonomy.I tried navigating on 1 drone.its working.But while trying with multiple ardrones,the nodes are dieing as you can see in the errors.Thank you for the response :)

Pramod gravatar imagePramod ( 2019-04-12 02:25:14 -0600 )edit

Can you provide links? There's more than one tum_simulator as far as I'm aware. As for the tf issue, you should look into using a tf_prefix for each drone and checkout the answer to this question

jayess gravatar imagejayess ( 2019-04-12 02:39:52 -0600 )edit

https://github.com/angelsantamaria/tu... . This is the version of tum_simulator im using and im using tf_prefix for each node.You can see it in launch file above.

Pramod gravatar imagePramod ( 2019-04-13 00:50:17 -0600 )edit

I changed files in message_to_tf .Those errors are not coming now but still those nodes are dying.Iam getting errors in shell.

Pramod gravatar imagePramod ( 2019-04-13 03:46:50 -0600 )edit