How to map robot2 coordinate system to robot1? so that they share the same coordinate system

asked 2019-10-01 15:26:43 -0500

mkb_10062949 gravatar image

Hello, I am using two UR5 for a pick and place task. I have created another instance of the same robot using the <group ns = "robot1" /> and <group ns = "robot2" /> tags. Now what I observe here is that when i launch the robots each of the robots uses its own coordinate system. Therefore, if I try to give the position x,y,z and the orientation values of the end effector of the robot1 (which is holding an object in its gripper) to the robot2 it just copies the pose of the end effector instead of making its end-effector reach the pose of the end effector and grap the object. The problem is here is that each robot has its own coordinate system.

How can I keep the coordinate system of robot1 as constant and offset the same coordinate system for the robot2 such that the robot2 also shares the same coordinate system like that of robot1?

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 ...
(more)
edit retag flag offensive close merge delete