Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Publishing tf from Gazebo camera to Rviz

Hello,

I am using the braccio_arm (https://github.com/grassjelly/ros_braccio_urdf) and trying to learn and simulate pick and place. I am able to launch the arm independently and work with it. Now, I created a world in Gazebo and would like to publish the PCL data from gazebo to Rviz and then plan to use pick and place. I face 2 issues, 1. I am unable to transform data from camera_link in Gazebo to base_link of robot. Kindly help. I followed the tutorial here and was added camera_link on my gazebo fie and URDF file.

Gazebo plugin code:

  <plugin name='camera_link_plugin' filename='libgazebo_ros_openni_kinect.so'>
    <baseline>0.2</baseline>
    <alwaysOn>true</alwaysOn>
    <updateRate>0.0</updateRate>
    <cameraName>camera_ir</cameraName>
    <imageTopicName>/camera/depth/image_raw</imageTopicName>
    <cameraInfoTopicName>/camera/depth/camera_info</cameraInfoTopicName>
    <depthImageTopicName>/camera/depth/image_raw</depthImageTopicName>
    <depthImageInfoTopicName>/camera/depth/camera_info</depthImageInfoTopicName>
    <pointCloudTopicName>/camera/depth/points</pointCloudTopicName>
    <frameName>camera_link</frameName>
    <pointCloudCutoff>0.05</pointCloudCutoff>
    <distortionK1>0</distortionK1>
    <distortionK2>0</distortionK2>
    <distortionK3>0</distortionK3>
    <distortionT1>0</distortionT1>
    <distortionT2>0</distortionT2>
    <CxPrime>0</CxPrime>
    <Cx>0</Cx>
    <Cy>0</Cy>
    <focalLength>0</focalLength>
    <hackBaseline>0</hackBaseline>
  </plugin>
</sensor>

My URDF links for Camera:

 <link name="camera_link">
    <visual>    
        <geometry>
                <box>
                  <size>0.073 0.276 0.072</size>
                </box>
            </geometry>
    <origin xyz="1.4 0 0.1" rpy="0 0 0"/>   
    </visual>

    <collision> 
        <geometry>
                <box>
                  <size>0.073 0.276 0.072</size>
                </box>
              </geometry>
    <origin xyz="1.4 0 0.1" rpy="0 0 0"/>   
    </collision>
      <material name="orange"/>
    </link>

  <joint name="camera_joint" type="fixed">
    <origin xyz="1.4 0 0.1" rpy="0 0 0"/>   
    <parent link="base_link"/>
    <child link="camera_link"/>
  </joint>
  1. When I visualize the PCL data it is rendered in Rviz perpendicular to y-axis, what could be the issue here?

Publishing tf from Gazebo camera to Rviz

Hello,

I am using the braccio_arm (https://github.com/grassjelly/ros_braccio_urdf) and trying to learn and simulate pick and place. I am able to launch the arm independently and work with it. Now, I created a world in Gazebo and would like to publish the PCL data from gazebo to Rviz and then plan to use pick and place. I face 2 issues, 1. I am unable to transform data from camera_link in Gazebo to base_link of robot. Kindly help. I followed the tutorial here and was added camera_link on my gazebo fie and URDF file.

Gazebo plugin code:

  <plugin name='camera_link_plugin' filename='libgazebo_ros_openni_kinect.so'>
    <baseline>0.2</baseline>
    <alwaysOn>true</alwaysOn>
    <updateRate>0.0</updateRate>
    <cameraName>camera_ir</cameraName>
    <imageTopicName>/camera/depth/image_raw</imageTopicName>
    <cameraInfoTopicName>/camera/depth/camera_info</cameraInfoTopicName>
    <depthImageTopicName>/camera/depth/image_raw</depthImageTopicName>
    <depthImageInfoTopicName>/camera/depth/camera_info</depthImageInfoTopicName>
    <pointCloudTopicName>/camera/depth/points</pointCloudTopicName>
    <frameName>camera_link</frameName>
    <pointCloudCutoff>0.05</pointCloudCutoff>
    <distortionK1>0</distortionK1>
    <distortionK2>0</distortionK2>
    <distortionK3>0</distortionK3>
    <distortionT1>0</distortionT1>
    <distortionT2>0</distortionT2>
    <CxPrime>0</CxPrime>
    <Cx>0</Cx>
    <Cy>0</Cy>
    <focalLength>0</focalLength>
    <hackBaseline>0</hackBaseline>
  </plugin>
</sensor>

My URDF links for World and Camera:

 <link name="camera_link">
    <visual>    
  name="world"/>

<joint name="world_joint" type="fixed">
    <parent link="world"/>
    <child link="base_link"/>
  </joint>

    <link name="base_link">
    <visual>
      <geometry>
                <box>
                  <size>0.073 0.276 0.072</size>
                </box>
      <cylinder length="0.01" radius=".053" />
      </geometry>
      <material name="black"/>
      <origin xyz="1.4 rpy="0 0 0.1" 0" xyz="0 0 0"/>
    </visual>
    <inertial>
      <mass value="2"/>
    <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
  </link>

    <link name="camera_link" />

  <joint name="camera_joint" type="fixed">
    <origin xyz="0 0 1.1" rpy="0 0 0"/>   
    </visual>

    <collision> 
        <geometry>
                <box>
                  <size>0.073 0.276 0.072</size>
                </box>
              </geometry>
    <origin xyz="1.4 0 0.1" rpy="0 0 0"/>   
    </collision>
      <material name="orange"/>
    </link>

  <joint name="camera_joint" type="fixed">
    <origin xyz="1.4 0 0.1" rpy="0 0 0"/>   
    <parent link="base_link"/>
    <child link="camera_link"/>
  </joint>
  1. When I visualize the PCL data it is rendered in Rviz perpendicular to y-axis, what could be the issue here?

Publishing tf from Gazebo camera to Rviz

Hello,

I am using the braccio_arm (https://github.com/grassjelly/ros_braccio_urdf) and trying to learn and simulate pick and place. I am able to launch the arm independently and work with it. Now, I created a world in Gazebo and would like to publish the PCL data from gazebo to Rviz and then plan to use pick and place. I face 2 issues, 1. I am unable to transform data from camera_link in Gazebo to base_link of robot. Kindly help. I followed the tutorial here and was added camera_link on my gazebo fie and URDF file.

Gazebo world has a kinect at 1.1 m in z and a table with 3 shapes on it. The kinect plugin code:

  <plugin name='camera_link_plugin' filename='libgazebo_ros_openni_kinect.so'>
    <baseline>0.2</baseline>
    <alwaysOn>true</alwaysOn>
    <updateRate>0.0</updateRate>
    <cameraName>camera_ir</cameraName>
    <imageTopicName>/camera/depth/image_raw</imageTopicName>
    <cameraInfoTopicName>/camera/depth/camera_info</cameraInfoTopicName>
    <depthImageTopicName>/camera/depth/image_raw</depthImageTopicName>
    <depthImageInfoTopicName>/camera/depth/camera_info</depthImageInfoTopicName>
    <pointCloudTopicName>/camera/depth/points</pointCloudTopicName>
    <frameName>camera_link</frameName>
    <pointCloudCutoff>0.05</pointCloudCutoff>
    <distortionK1>0</distortionK1>
    <distortionK2>0</distortionK2>
    <distortionK3>0</distortionK3>
    <distortionT1>0</distortionT1>
    <distortionT2>0</distortionT2>
    <CxPrime>0</CxPrime>
    <Cx>0</Cx>
    <Cy>0</Cy>
    <focalLength>0</focalLength>
    <hackBaseline>0</hackBaseline>
  </plugin>
</sensor>

My URDF links for World and Camera:the robot:

<?xml version="1.0" ?>
<robot name="braccio" xmlns:xacro="http://www.ros.org/wiki/xacro">

  <xacro:property name="camera_link" value="0.05" /> <!-- Size of square 'camera' box -->
  <xacro:property name="damping_value" value="241.35"/>
  <xacro:property name="friction_value" value="24.135"/>

<xacro:property name="kinect_box_length" value="0.3556" />
<xacro:property name="kinect_box_width" value="0.1778" />
<xacro:property name="kinect_box_height" value="0.0762" />
<xacro:property name="kinect_box_mass" value="1.274595" />

<xacro:macro name="inertial_matrix_cuboid" params="mass box_length box_width">
               <inertial>
                       <mass value="${mass}" />
                       <inertia ixx="${mass/12*(box_length*box_length)}" 
                                ixy = "0" ixz = "0"
                                iyy="${mass/12*(box_width*box_width)}" iyz = "0"
                                izz="${mass/12*(box_length*box_length + box_width*box_width)}" />
               </inertial>
</xacro:macro>

<xacro:macro name="transmission_block" params="joint_name idx">
      <transmission name="tran_${idx}">
        <type>transmission_interface/SimpleTransmission</type>
        <joint name="${joint_name}">
          <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        </joint>
        <actuator name="motor__${idx}">
          <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
          <mechanicalReduction>1</mechanicalReduction>
        </actuator>
      </transmission>
</xacro:macro>

<link name="world"/>
name="base_footprint"/>

<joint name="world_joint" name="base_footprint_joint" type="fixed">
    <parent link="world"/>
link="base_footprint"/>
    <child link="base_link"/>
  </joint>

    <link name="base_link">
    <visual>
      <geometry>
    <cylinder length="0.01" radius=".053" />
      </geometry>
      <material name="black"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
    </visual>
    <inertial>
      <mass value="2"/>
    <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
  </link>

    <link name="camera_link" />
name="camera_link"> 
    <xacro:inertial_matrix_cuboid mass="${kinect_box_mass}" box_length="${kinect_box_length}" box_width="${kinect_box_width}"/>
    </link>

  <joint name="camera_joint" type="fixed">
    <origin xyz="0 0 1.1" rpy="0 0 0"/> 
    <parent link="base_link"/>
    <child link="camera_link"/>
  </joint>

  <link name="braccio_base_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 3.1416" xyz="0 0.004 0" />
    </visual>
    <inertial>
      <mass value="2"/>
      <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
    <collision>
      <origin rpy="0 0 3.1416" xyz="0 0.004 0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="shoulder_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_shoulder.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="-0.0045 0.0055 -0.026"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0045 0.0055 -0.026"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="elbow_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_elbow.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="-0.0045 0.005 -0.025"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0045 0.005 -0.025"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_elbow.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="wrist_pitch_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_pitch.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="0.003 -0.0004 -0.024"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0.003 -0.0004 -0.024"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_pitch.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="wrist_roll_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_roll.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 0 0" xyz="0.006 0 0.0"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0.006 0 0.0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_roll.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="left_gripper_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_left_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_left_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="right_gripper_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_right_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0.010"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0.010"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_right_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <joint name="base_joint" type="revolute">
    <axis xyz="0 0 1"/>
    <limit effort="1000.0" lower="0.0" upper="3.1416" velocity="1.0"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <parent link="base_link"/>
    <child link="braccio_base_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="shoulder_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0.2618" upper="2.8798" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 -.002 0.072"/>
    <parent link="braccio_base_link"/>
    <child link="shoulder_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="elbow_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0" upper="3.1416" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 0 0.125"/>
    <parent link="shoulder_link"/>
    <child link="elbow_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="wrist_pitch_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0" upper="3.1416" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 0 0.125"/>
    <parent link="elbow_link"/>
    <child link="wrist_pitch_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="wrist_roll_joint" type="revolute">
    <axis xyz="0 0 -1"/>
    <limit effort="1000.0" lower="0.0" upper="3.1416" velocity="1.0"/>
    <origin rpy="0 0 1.5708" xyz="0 0.0 0.06"/>
    <parent link="wrist_pitch_link"/>
    <child link="wrist_roll_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="gripper_joint" type="revolute">
    <axis xyz="0 -1 0"/>
    <limit effort="1000.0" lower="0.1750" upper="1.2741" velocity="1.0"/>
    <origin rpy="0 -0.2967 0" xyz="0.010 0 0.03"/>
    <parent link="wrist_roll_link"/>
    <child link="right_gripper_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="sub_gripper_joint" type="revolute">
    <axis xyz="0 1 0"/>
    <mimic joint="gripper_joint"/>
    <limit effort="1000.0" lower="1.2741" upper="2.3732" velocity="1.0"/>
    <origin rpy="0 3.4383 0" xyz="-0.010 0 0.03"/>
    <parent link="wrist_roll_link"/>
    <child link="left_gripper_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <material name="orange">
    <color rgba="0.57 0.17 0.0 1"/>
  </material>
  <material name="white">
    <color rgba="0.8 0.8 0.8 1.0"/>
  </material>
  <material name="black">
    <color rgba="0 0 0 0.50"/>
  </material>


   <xacro:transmission_block joint_name="base_joint" idx="1"/>
   <xacro:transmission_block joint_name="shoulder_joint" idx="2"/>
   <xacro:transmission_block joint_name="elbow_joint" idx="3"/>
   <xacro:transmission_block joint_name="wrist_pitch_joint" idx="4"/>
   <xacro:transmission_block joint_name="wrist_roll_joint" idx="5"/>
   <xacro:transmission_block joint_name="gripper_joint" idx="6"/>
   <xacro:transmission_block joint_name="sub_gripper_joint" idx="7"/>

<gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/braccio</robotNamespace>
  </plugin>
</gazebo>

</robot>
  1. When I visualize the PCL data it is rendered in Rviz perpendicular to y-axis, what could be the issue here?

Publishing tf from Gazebo camera to Rviz

Hello,

I am using the braccio_arm (https://github.com/grassjelly/ros_braccio_urdf) and trying to learn and simulate pick and place. I am able to launch the arm independently and work with it. Now, I created a world in Gazebo and would like to publish the PCL data from gazebo to Rviz and then plan to use pick and place. I face 2 issues, 1. I am unable to transform data from camera_link in Gazebo to base_link of robot. Kindly help. I followed the tutorial here and was added camera_link on my gazebo fie and URDF file.

Gazebo world has a kinect at 1.1 m in z and a table with 3 shapes on it. The kinect plugin code:

  <plugin name='camera_link_plugin' filename='libgazebo_ros_openni_kinect.so'>
    <baseline>0.2</baseline>
    <alwaysOn>true</alwaysOn>
    <updateRate>0.0</updateRate>
    <cameraName>camera_ir</cameraName>
    <imageTopicName>/camera/depth/image_raw</imageTopicName>
    <cameraInfoTopicName>/camera/depth/camera_info</cameraInfoTopicName>
    <depthImageTopicName>/camera/depth/image_raw</depthImageTopicName>
    <depthImageInfoTopicName>/camera/depth/camera_info</depthImageInfoTopicName>
    <pointCloudTopicName>/camera/depth/points</pointCloudTopicName>
    <frameName>camera_link</frameName>
    <pointCloudCutoff>0.05</pointCloudCutoff>
    <distortionK1>0</distortionK1>
    <distortionK2>0</distortionK2>
    <distortionK3>0</distortionK3>
    <distortionT1>0</distortionT1>
    <distortionT2>0</distortionT2>
    <CxPrime>0</CxPrime>
    <Cx>0</Cx>
    <Cy>0</Cy>
    <focalLength>0</focalLength>
    <hackBaseline>0</hackBaseline>
  </plugin>
</sensor>

My URDF links for the robot:

<?xml version="1.0" ?>
<robot name="braccio" xmlns:xacro="http://www.ros.org/wiki/xacro">

  <xacro:property name="camera_link" value="0.05" /> <!-- Size of square 'camera' box -->
  <xacro:property name="damping_value" value="241.35"/>
  <xacro:property name="friction_value" value="24.135"/>

<xacro:property name="kinect_box_length" value="0.3556" />
<xacro:property name="kinect_box_width" value="0.1778" />
<xacro:property name="kinect_box_height" value="0.0762" />
<xacro:property name="kinect_box_mass" value="1.274595" />

<xacro:macro name="inertial_matrix_cuboid" params="mass box_length box_width">
               <inertial>
                       <mass value="${mass}" />
                       <inertia ixx="${mass/12*(box_length*box_length)}" 
                                ixy = "0" ixz = "0"
                                iyy="${mass/12*(box_width*box_width)}" iyz = "0"
                                izz="${mass/12*(box_length*box_length + box_width*box_width)}" />
               </inertial>
</xacro:macro>

<xacro:macro name="transmission_block" params="joint_name idx">
      <transmission name="tran_${idx}">
        <type>transmission_interface/SimpleTransmission</type>
        <joint name="${joint_name}">
          <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        </joint>
        <actuator name="motor__${idx}">
          <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
          <mechanicalReduction>1</mechanicalReduction>
        </actuator>
      </transmission>
</xacro:macro>

<link name="base_footprint"/>

<joint name="base_footprint_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
  </joint>

    <link name="base_link">
    <visual>
      <geometry>
    <cylinder length="0.01" radius=".053" />
      </geometry>
      <material name="black"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
    </visual>
    <inertial>
      <mass value="2"/>
    <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
  </link>

    <link name="camera_link"> 
    <xacro:inertial_matrix_cuboid mass="${kinect_box_mass}" box_length="${kinect_box_length}" box_width="${kinect_box_width}"/>
    </link>

  <joint name="camera_joint" type="fixed">
    <origin xyz="0 0 1.1" rpy="0 0 0"/> 
    <parent link="base_link"/>
    <child link="camera_link"/>
  </joint>

  <link name="braccio_base_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 3.1416" xyz="0 0.004 0" />
    </visual>
    <inertial>
      <mass value="2"/>
      <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
    <collision>
      <origin rpy="0 0 3.1416" xyz="0 0.004 0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="shoulder_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_shoulder.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="-0.0045 0.0055 -0.026"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0045 0.0055 -0.026"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="elbow_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_elbow.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="-0.0045 0.005 -0.025"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0045 0.005 -0.025"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_elbow.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="wrist_pitch_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_pitch.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="0.003 -0.0004 -0.024"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0.003 -0.0004 -0.024"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_pitch.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="wrist_roll_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_roll.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 0 0" xyz="0.006 0 0.0"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0.006 0 0.0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_roll.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="left_gripper_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_left_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_left_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="right_gripper_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_right_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0.010"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0.010"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_right_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <joint name="base_joint" type="revolute">
    <axis xyz="0 0 1"/>
    <limit effort="1000.0" lower="0.0" upper="3.1416" velocity="1.0"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <parent link="base_link"/>
    <child link="braccio_base_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="shoulder_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0.2618" upper="2.8798" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 -.002 0.072"/>
    <parent link="braccio_base_link"/>
    <child link="shoulder_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="elbow_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0" upper="3.1416" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 0 0.125"/>
    <parent link="shoulder_link"/>
    <child link="elbow_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="wrist_pitch_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0" upper="3.1416" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 0 0.125"/>
    <parent link="elbow_link"/>
    <child link="wrist_pitch_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="wrist_roll_joint" type="revolute">
    <axis xyz="0 0 -1"/>
    <limit effort="1000.0" lower="0.0" upper="3.1416" velocity="1.0"/>
    <origin rpy="0 0 1.5708" xyz="0 0.0 0.06"/>
    <parent link="wrist_pitch_link"/>
    <child link="wrist_roll_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="gripper_joint" type="revolute">
    <axis xyz="0 -1 0"/>
    <limit effort="1000.0" lower="0.1750" upper="1.2741" velocity="1.0"/>
    <origin rpy="0 -0.2967 0" xyz="0.010 0 0.03"/>
    <parent link="wrist_roll_link"/>
    <child link="right_gripper_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="sub_gripper_joint" type="revolute">
    <axis xyz="0 1 0"/>
    <mimic joint="gripper_joint"/>
    <limit effort="1000.0" lower="1.2741" upper="2.3732" velocity="1.0"/>
    <origin rpy="0 3.4383 0" xyz="-0.010 0 0.03"/>
    <parent link="wrist_roll_link"/>
    <child link="left_gripper_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <material name="orange">
    <color rgba="0.57 0.17 0.0 1"/>
  </material>
  <material name="white">
    <color rgba="0.8 0.8 0.8 1.0"/>
  </material>
  <material name="black">
    <color rgba="0 0 0 0.50"/>
  </material>


   <xacro:transmission_block joint_name="base_joint" idx="1"/>
   <xacro:transmission_block joint_name="shoulder_joint" idx="2"/>
   <xacro:transmission_block joint_name="elbow_joint" idx="3"/>
   <xacro:transmission_block joint_name="wrist_pitch_joint" idx="4"/>
   <xacro:transmission_block joint_name="wrist_roll_joint" idx="5"/>
   <xacro:transmission_block joint_name="gripper_joint" idx="6"/>
   <xacro:transmission_block joint_name="sub_gripper_joint" idx="7"/>

<gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/braccio</robotNamespace>
  </plugin>
</gazebo>

</robot>

My launch file in Gazebo:

<launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>

  <!-- We resume the logic in empty_world.launch -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">

   <arg name="world_name" default="$(find braccio_gazebo)/worlds/pick_place_multi.world"/>  

    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>

<!-- Convert an xacro and put on parameter server -->
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find braccio_arduino_ros_rviz)/urdf/braccio_arm.xacro" />

<!-- Spawn a robot into Gazebo -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -x 1.3 -y -0.3 -z 0.8 -model braccio" />

</launch>

My launch file in Rviz,

<launch>
    <arg name="model" default="$(find braccio_arduino_ros_rviz)/urdf/braccio_arm.xacro"/>
    <arg name="gui" default="true"/>
    <arg name="rvizconfig" default="$(find braccio_arduino_ros_rviz)/rviz/urdf.rviz" />

    <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)"/>
    <param name="use_gui" value="gui"/>

    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
        <param name="use_gui" value="gui"/>
    </node>
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
  </launch>
  1. When I visualize the PCL data it is rendered in Rviz perpendicular to y-axis, what could be the issue here?

Publishing tf from Gazebo camera to Rviz

Hello,

I am using the braccio_arm (https://github.com/grassjelly/ros_braccio_urdf) and trying to learn and simulate pick and place. I am able to launch the arm independently and work with it. Now, I created a world in Gazebo and would like to publish the PCL data from gazebo to Rviz and then plan to use pick and place. I face 2 issues, 1. I am unable to transform data from camera_link in Gazebo to base_link of robot. Kindly help. I followed the tutorial here and was added camera_link on my gazebo fie and URDF file.

Gazebo world has a kinect at 1.1 m in z and a table with 3 shapes on it. The kinect plugin code:

  <plugin name='camera_link_plugin' filename='libgazebo_ros_openni_kinect.so'>
    <baseline>0.2</baseline>
    <alwaysOn>true</alwaysOn>
    <updateRate>0.0</updateRate>
    <cameraName>camera_ir</cameraName>
    <imageTopicName>/camera/depth/image_raw</imageTopicName>
    <cameraInfoTopicName>/camera/depth/camera_info</cameraInfoTopicName>
    <depthImageTopicName>/camera/depth/image_raw</depthImageTopicName>
    <depthImageInfoTopicName>/camera/depth/camera_info</depthImageInfoTopicName>
    <pointCloudTopicName>/camera/depth/points</pointCloudTopicName>
    <frameName>camera_link</frameName>
    <pointCloudCutoff>0.05</pointCloudCutoff>
    <distortionK1>0</distortionK1>
    <distortionK2>0</distortionK2>
    <distortionK3>0</distortionK3>
    <distortionT1>0</distortionT1>
    <distortionT2>0</distortionT2>
    <CxPrime>0</CxPrime>
    <Cx>0</Cx>
    <Cy>0</Cy>
    <focalLength>0</focalLength>
    <hackBaseline>0</hackBaseline>
  </plugin>
</sensor>

My URDF links for the robot:

<?xml version="1.0" ?>
<robot name="braccio" xmlns:xacro="http://www.ros.org/wiki/xacro">
xmlns:xacro="http://www.ros.org/wiki/xacro" 
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
    xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
    xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
name="braccio">

  <xacro:property name="camera_link" value="0.05" /> <!-- Size of square 'camera' box -->
  <xacro:property name="damping_value" value="241.35"/>
  <xacro:property name="friction_value" value="24.135"/>

<xacro:property name="kinect_box_length" value="0.3556" />
<xacro:property name="kinect_box_width" value="0.1778" />
<xacro:property name="kinect_box_height" value="0.0762" />
<xacro:property name="kinect_box_mass" value="1.274595" />

<xacro:macro name="inertial_matrix_cuboid" params="mass box_length box_width">
               <inertial>
                       <mass value="${mass}" />
                       <inertia ixx="${mass/12*(box_length*box_length)}" 
                                ixy = "0" ixz = "0"
                                iyy="${mass/12*(box_width*box_width)}" iyz = "0"
                                izz="${mass/12*(box_length*box_length + box_width*box_width)}" />
               </inertial>
</xacro:macro>

<xacro:macro name="transmission_block" params="joint_name idx">
      <transmission name="tran_${idx}">
        <type>transmission_interface/SimpleTransmission</type>
        <joint name="${joint_name}">
          <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        </joint>
        <actuator name="motor__${idx}">
          <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
          <mechanicalReduction>1</mechanicalReduction>
        </actuator>
      </transmission>
</xacro:macro>

<link name="base_footprint"/>

<joint name="base_footprint_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
  </joint>

    <link name="base_link">
    <visual>
      <geometry>
    <cylinder length="0.01" radius=".053" />
      </geometry>
      <material name="black"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
    </visual>
    <inertial>
      <mass value="2"/>
    <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
  </link>

    <link name="camera_link"> 
    <xacro:inertial_matrix_cuboid mass="${kinect_box_mass}" box_length="${kinect_box_length}" box_width="${kinect_box_width}"/>
    </link>

  <joint name="camera_joint" type="fixed">
    <origin xyz="0 0 1.1" rpy="0 0 0"/> 
    <parent link="base_link"/>
    <child link="camera_link"/>
  </joint>

  <link name="braccio_base_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 3.1416" xyz="0 0.004 0" />
    </visual>
    <inertial>
      <mass value="2"/>
      <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
    <collision>
      <origin rpy="0 0 3.1416" xyz="0 0.004 0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="shoulder_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_shoulder.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="-0.0045 0.0055 -0.026"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0045 0.0055 -0.026"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="elbow_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_elbow.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="-0.0045 0.005 -0.025"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0045 0.005 -0.025"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_elbow.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="wrist_pitch_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_pitch.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="0.003 -0.0004 -0.024"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0.003 -0.0004 -0.024"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_pitch.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="wrist_roll_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_roll.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 0 0" xyz="0.006 0 0.0"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0.006 0 0.0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_roll.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="left_gripper_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_left_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_left_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="right_gripper_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_right_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0.010"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0.010"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_right_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <joint name="base_joint" type="revolute">
    <axis xyz="0 0 1"/>
    <limit effort="1000.0" lower="0.0" upper="3.1416" velocity="1.0"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <parent link="base_link"/>
    <child link="braccio_base_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="shoulder_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0.2618" upper="2.8798" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 -.002 0.072"/>
    <parent link="braccio_base_link"/>
    <child link="shoulder_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="elbow_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0" upper="3.1416" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 0 0.125"/>
    <parent link="shoulder_link"/>
    <child link="elbow_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="wrist_pitch_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0" upper="3.1416" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 0 0.125"/>
    <parent link="elbow_link"/>
    <child link="wrist_pitch_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="wrist_roll_joint" type="revolute">
    <axis xyz="0 0 -1"/>
    <limit effort="1000.0" lower="0.0" upper="3.1416" velocity="1.0"/>
    <origin rpy="0 0 1.5708" xyz="0 0.0 0.06"/>
    <parent link="wrist_pitch_link"/>
    <child link="wrist_roll_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="gripper_joint" type="revolute">
    <axis xyz="0 -1 0"/>
    <limit effort="1000.0" lower="0.1750" upper="1.2741" velocity="1.0"/>
    <origin rpy="0 -0.2967 0" xyz="0.010 0 0.03"/>
    <parent link="wrist_roll_link"/>
    <child link="right_gripper_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="sub_gripper_joint" type="revolute">
    <axis xyz="0 1 0"/>
    <mimic joint="gripper_joint"/>
    <limit effort="1000.0" lower="1.2741" upper="2.3732" velocity="1.0"/>
    <origin rpy="0 3.4383 0" xyz="-0.010 0 0.03"/>
    <parent link="wrist_roll_link"/>
    <child link="left_gripper_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <material name="orange">
    <color rgba="0.57 0.17 0.0 1"/>
  </material>
  <material name="white">
    <color rgba="0.8 0.8 0.8 1.0"/>
  </material>
  <material name="black">
    <color rgba="0 0 0 0.50"/>
  </material>


   <xacro:transmission_block joint_name="base_joint" idx="1"/>
   <xacro:transmission_block joint_name="shoulder_joint" idx="2"/>
   <xacro:transmission_block joint_name="elbow_joint" idx="3"/>
   <xacro:transmission_block joint_name="wrist_pitch_joint" idx="4"/>
   <xacro:transmission_block joint_name="wrist_roll_joint" idx="5"/>
   <xacro:transmission_block joint_name="gripper_joint" idx="6"/>
   <xacro:transmission_block joint_name="sub_gripper_joint" idx="7"/>

<gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/braccio</robotNamespace>
  </plugin>
</gazebo>

</robot>

My launch file in Gazebo:

<launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>

  <!-- We resume the logic in empty_world.launch -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">

   <arg name="world_name" default="$(find braccio_gazebo)/worlds/pick_place_multi.world"/>  

    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>

<!-- Convert an xacro and put on parameter server -->
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find braccio_arduino_ros_rviz)/urdf/braccio_arm.xacro" />

<!-- Spawn a robot into Gazebo -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -x 1.3 -y -0.3 -z 0.8 -model braccio" />

</launch>

My launch file in Rviz,

<launch>
    <arg name="model" default="$(find braccio_arduino_ros_rviz)/urdf/braccio_arm.xacro"/>
    <arg name="gui" default="true"/>
    <arg name="rvizconfig" default="$(find braccio_arduino_ros_rviz)/rviz/urdf.rviz" />

    <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)"/>
    <param name="use_gui" value="gui"/>

    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
        <param name="use_gui" value="gui"/>
    </node>
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
  </launch>
  1. When I visualize the PCL data it is rendered in Rviz perpendicular to y-axis, what could be the issue here?

Publishing tf from Gazebo camera to Rviz

Hello,

I am using the braccio_arm (https://github.com/grassjelly/ros_braccio_urdf) and trying to learn and simulate pick and place. I am able to launch the arm independently and work with it. Now, I created a world in Gazebo and would like to publish the PCL data from gazebo to Rviz and then plan to use pick and place. I face 2 issues, 1. I am unable to transform data from camera_link in Gazebo to base_link of robot. Kindly help. I followed the tutorial here and was added camera_link on my gazebo fie and URDF file.

Gazebo world has a kinect at 1.1 m in z and a table with 3 shapes on it. The kinect plugin code:

  <plugin name='camera_link_plugin' filename='libgazebo_ros_openni_kinect.so'>
    <baseline>0.2</baseline>
    <alwaysOn>true</alwaysOn>
    <updateRate>0.0</updateRate>
    <cameraName>camera_ir</cameraName>
    <imageTopicName>/camera/depth/image_raw</imageTopicName>
    <cameraInfoTopicName>/camera/depth/camera_info</cameraInfoTopicName>
    <depthImageTopicName>/camera/depth/image_raw</depthImageTopicName>
    <depthImageInfoTopicName>/camera/depth/camera_info</depthImageInfoTopicName>
    <pointCloudTopicName>/camera/depth/points</pointCloudTopicName>
    <frameName>camera_link</frameName>
    <pointCloudCutoff>0.05</pointCloudCutoff>
    <distortionK1>0</distortionK1>
    <distortionK2>0</distortionK2>
    <distortionK3>0</distortionK3>
    <distortionT1>0</distortionT1>
    <distortionT2>0</distortionT2>
    <CxPrime>0</CxPrime>
    <Cx>0</Cx>
    <Cy>0</Cy>
    <focalLength>0</focalLength>
    <hackBaseline>0</hackBaseline>
  </plugin>
</sensor>

My URDF links for the robot:

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" 
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
    xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
    xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
name="braccio">

  <xacro:property name="camera_link" value="0.05" /> <!-- Size of square 'camera' box -->
  <xacro:property name="damping_value" value="241.35"/>
  <xacro:property name="friction_value" value="24.135"/>

<xacro:property name="kinect_box_length" value="0.3556" />
<xacro:property name="kinect_box_width" value="0.1778" />
<xacro:property name="kinect_box_height" value="0.0762" />
<xacro:property name="kinect_box_mass" value="1.274595" />

<xacro:macro name="inertial_matrix_cuboid" params="mass box_length box_width">
               <inertial>
                       <mass value="${mass}" />
                       <inertia ixx="${mass/12*(box_length*box_length)}" 
                                ixy = "0" ixz = "0"
                                iyy="${mass/12*(box_width*box_width)}" iyz = "0"
                                izz="${mass/12*(box_length*box_length + box_width*box_width)}" />
               </inertial>
</xacro:macro>

<xacro:macro name="transmission_block" params="joint_name idx">
      <transmission name="tran_${idx}">
        <type>transmission_interface/SimpleTransmission</type>
        <joint name="${joint_name}">
          <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
        </joint>
        <actuator name="motor__${idx}">
          <hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
          <mechanicalReduction>1</mechanicalReduction>
        </actuator>
      </transmission>
</xacro:macro>

<link name="base_footprint"/>

<joint name="base_footprint_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
  </joint>

    <link name="base_link">
    <visual>
      <geometry>
    <cylinder length="0.01" radius=".053" />
      </geometry>
      <material name="black"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
    </visual>
    <inertial>
      <mass value="2"/>
    <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
  </link>

    <link name="camera_link"> 
    <xacro:inertial_matrix_cuboid mass="${kinect_box_mass}" box_length="${kinect_box_length}" box_width="${kinect_box_width}"/>
    </link>

  <joint name="camera_joint" type="fixed">
    <origin xyz="0 0 1.1" rpy="0 0 0"/> 
    <parent link="base_link"/>
    <child link="camera_link"/>
  </joint>

  <link name="braccio_base_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 3.1416" xyz="0 0.004 0" />
    </visual>
    <inertial>
      <mass value="2"/>
      <inertia ixx="0.015" ixy="0" ixz="0" iyy="0.00666666666667" iyz="0" izz="0.0216666666667"/>
    </inertial>
    <collision>
      <origin rpy="0 0 3.1416" xyz="0 0.004 0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="shoulder_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_shoulder.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="-0.0045 0.0055 -0.026"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0045 0.0055 -0.026"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_base.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="elbow_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_elbow.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="-0.0045 0.005 -0.025"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="-0.0045 0.005 -0.025"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_elbow.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="wrist_pitch_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_pitch.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="orange"/>
      <origin rpy="0 0 0" xyz="0.003 -0.0004 -0.024"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0.003 -0.0004 -0.024"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_pitch.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="wrist_roll_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_roll.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 0 0" xyz="0.006 0 0.0"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0.006 0 0.0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_wrist_roll.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="left_gripper_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_left_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_left_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <link name="right_gripper_link">
    <visual>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_right_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
      <material name="white"/>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0.010"/>
    </visual>
    <inertial>
      <mass value="0.1"/>
      <inertia ixx="0.000348958333333" ixy="0" ixz="0" iyy="0.000348958333333" iyz="0" izz="3.125e-05"/>
    </inertial>
    <collision>
      <origin rpy="0 1.5708 0" xyz="0 -0.012 0.010"/>
      <geometry>
        <mesh filename="package://braccio_arduino_ros_rviz/stl/braccio_right_gripper.stl" scale="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link>
  <joint name="base_joint" type="revolute">
    <axis xyz="0 0 1"/>
    <limit effort="1000.0" lower="0.0" upper="3.1416" velocity="1.0"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <parent link="base_link"/>
    <child link="braccio_base_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="shoulder_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0.2618" upper="2.8798" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 -.002 0.072"/>
    <parent link="braccio_base_link"/>
    <child link="shoulder_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="elbow_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0" upper="3.1416" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 0 0.125"/>
    <parent link="shoulder_link"/>
    <child link="elbow_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="wrist_pitch_joint" type="revolute">
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="0" upper="3.1416" velocity="1.0"/>
    <origin rpy="-1.5708 0 0" xyz="0 0 0.125"/>
    <parent link="elbow_link"/>
    <child link="wrist_pitch_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="wrist_roll_joint" type="revolute">
    <axis xyz="0 0 -1"/>
    <limit effort="1000.0" lower="0.0" upper="3.1416" velocity="1.0"/>
    <origin rpy="0 0 1.5708" xyz="0 0.0 0.06"/>
    <parent link="wrist_pitch_link"/>
    <child link="wrist_roll_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="gripper_joint" type="revolute">
    <axis xyz="0 -1 0"/>
    <limit effort="1000.0" lower="0.1750" upper="1.2741" velocity="1.0"/>
    <origin rpy="0 -0.2967 0" xyz="0.010 0 0.03"/>
    <parent link="wrist_roll_link"/>
    <child link="right_gripper_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <joint name="sub_gripper_joint" type="revolute">
    <axis xyz="0 1 0"/>
    <mimic joint="gripper_joint"/>
    <limit effort="1000.0" lower="1.2741" upper="2.3732" velocity="1.0"/>
    <origin rpy="0 3.4383 0" xyz="-0.010 0 0.03"/>
    <parent link="wrist_roll_link"/>
    <child link="left_gripper_link"/>
    <dynamics damping="${damping_value}" friction="${friction_value}"/>
  </joint>
  <material name="orange">
    <color rgba="0.57 0.17 0.0 1"/>
  </material>
  <material name="white">
    <color rgba="0.8 0.8 0.8 1.0"/>
  </material>
  <material name="black">
    <color rgba="0 0 0 0.50"/>
  </material>


   <xacro:transmission_block joint_name="base_joint" idx="1"/>
   <xacro:transmission_block joint_name="shoulder_joint" idx="2"/>
   <xacro:transmission_block joint_name="elbow_joint" idx="3"/>
   <xacro:transmission_block joint_name="wrist_pitch_joint" idx="4"/>
   <xacro:transmission_block joint_name="wrist_roll_joint" idx="5"/>
   <xacro:transmission_block joint_name="gripper_joint" idx="6"/>
   <xacro:transmission_block joint_name="sub_gripper_joint" idx="7"/>

<gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/braccio</robotNamespace>
  </plugin>
</gazebo>

</robot>

My launch file in Gazebo:

<launch>

  <!-- these are the arguments you can pass this launch file, for example paused:=true -->
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>

  <!-- We resume the logic in empty_world.launch -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">

   <arg name="world_name" default="$(find braccio_gazebo)/worlds/pick_place_multi.world"/>  

    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
  </include>

<!-- Convert an xacro and put on parameter server -->
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find braccio_arduino_ros_rviz)/urdf/braccio_arm.xacro" />

<!-- Spawn a robot into Gazebo -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -x 1.3 -y -0.3 -z 0.8 -model braccio" />

</launch>

My launch file in Rviz,

<launch>
    <arg name="model" default="$(find braccio_arduino_ros_rviz)/urdf/braccio_arm.xacro"/>
    <arg name="gui" default="true"/>
    <arg name="rvizconfig" default="$(find braccio_arduino_ros_rviz)/rviz/urdf.rviz" />

    <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)"/>
    <param name="use_gui" value="gui"/>

    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
        <param name="use_gui" value="gui"/>
    </node>
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
  </launch>
  1. When I visualize the PCL data it is rendered in Rviz perpendicular to y-axis, what could be the issue here?here? image description