Multiple robot (UR5) TF Problem

asked 2019-10-05 06:05:14 -0500

mkb_10062949 gravatar image

updated 2019-10-05 06:09:40 -0500

Hello, I have created a launch file that can successfully launch and control two UR5 robots. But it seems that the TF of both the robots is not published separately, they are published as one. I need two to have two unique TF's for both the robots. I dont know where I have made mistake.

here is my launch file

<?xml version="1.0"?>
<launch>
  <param name="red_box_path" type="str" value="$(find ur5_notebook)/urdf/red_box.urdf"/>
  <arg name="robot_name"/>
  <!-- <arg name="init_pose"/> -->
  <arg name="limited" default="true"/>
  <arg name="paused" default="false"/>
  <arg name="gui" default="true"/>
  <arg name="debug" default="false" />
  <arg name="sim" default="true" />

  <!-- startup simulated world -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" default="worlds/empty.world"/>
    <arg name="paused" value="$(arg paused)"/>
    <arg name="gui" value="$(arg gui)"/>
  </include>

  <node name="bin" pkg="gazebo_ros" type="spawn_model" args="-file $(find ur5_notebook)/urdf/bin.urdf -urdf -model bin -y 0.8 -x -0.5 -z 0.05" />
  <!-- <node name="bin2" pkg="gazebo_ros" type="spawn_model" args="-file $(find ur5_notebook)/urdf/bin.urdf -urdf -model bin -y -0.8 -x 0.5 -z 0.05" /> -->

  <!-- spawn the conveyor_belt in gazebo -->
  <node name="spawn_conveyor_belt" pkg="gazebo_ros" type="spawn_model" args="-file $(find ur5_notebook)/urdf/conveyor_belt.urdf -urdf -model conveyor_belt" />
  <!-- spawn the conveyor_belt in gazebo -->

  <!-- the red blocks spawner node -->

  <node name="blocks_spawner" pkg="ur5_notebook" type="blocks_spawner" output="screen" />
  <!-- <node name="blocks_spawner2" pkg="ur5_notebook" type="blocks_spawner2" output="screen" /> -->

  <node name="blocks_poses_publisher" pkg="ur5_notebook" type="blocks_poses_publisher" output="screen" />

  <group ns="robot1">
    <param name="tf_prefix" value="robot1_tf" />
      <include file="$(find ur_gazebo)/launch/ur5.launch">
        <arg name="init_pose" value="-z 0.2 -y 0.7"/>
        <arg name="robot_name" value="robot1"/>
        <!-- <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model $(arg robot_name)-x 0.5 -z 0.2 -y 1.1" respawn="false" output="screen" /> -->
      </include>

      <include file="$(find ur5_moveit_config)/launch/move_group.launch">
        <arg name="limited" default="$(arg limited)"/>
        <arg name="debug" default="$(arg debug)" />
      </include>

      <!-- <node name="ur5_vision" pkg="ur5_notebook" type="ur5_vision.py" output="screen" />
      <node name="ur5_gripper" pkg="ur5_notebook" type="ur5_gripper.py" output="screen"/> -->

      <remap if="$(arg sim)" from="follow_joint_trajectory" to="arm_controller/follow_joint_trajectory"/>

      <node name="ur5_vision_robot1" pkg="ur5_notebook" type="ur5_vision_robot1.py" output="screen" />
  <!-- <node name="ur5_mp_robot1" pkg="ur5_notebook" type="ur5_mp_robot1.py" output="screen" /> -->
      <node name="ur5_gripper_robot1" pkg="ur5_notebook" type="ur5_gripper_robot1.py" output="screen"/>



  </group>

  <group ns="robot2">
    <param name="tf_prefix" value="robot2_tf" />
      <include file="$(find ur_gazebo)/launch/ur5_r2.launch">
        <arg name="init_pose" value="-z 0.2 -y -0.70"/>
        <arg name="robot_name" value="robot2"/>
        <!-- <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model $(arg robot_name)-x 0.5 -z ...
(more)
edit retag flag offensive close merge delete

Comments

This reads like a duplicate (or is at least related to): #q334644.

gvdhoorn gravatar imagegvdhoorn ( 2019-10-08 03:51:01 -0500 )edit