Can not visualize Gazibo depth camera pointcloud output in rviz

asked 2017-08-17 10:26:21 -0600

YJK gravatar image

I connected a kinect(Depth) camera to Labro example in Gazibo simulation environment. Output of the depth image and camera image can be visualize via rqt_gui, however when I try to visualize PointCloud, Depth camera output through rviz it gives following error.

Transform [sender=unknown_publisher]
For frame [kinect_depth_optical_frame]: Frame [kinect_depth_optical_frame] does not exist

I'm trying to get PointCloud data from depth camera and feed it to Octomap Server, then to generate a 3D map.

Following is the modified Labrob code. <robot name="labrob" xmlns:xacro="">

  <!-- Included URDF/XACRO Files -->
  <xacro:include filename="$(find labrob_description)/urdf/materials.urdf.xacro" />
  <xacro:include filename="$(find labrob_description)/urdf/wheel.urdf.xacro" />
  <xacro:include filename="$(find labrob_description)/urdf/kinect_camera.urdf.xacro" />

  <!-- PROPERTY LIST -->
  <!--All units in m-kg-s-radians unit system -->
  <property name="M_PI" value="3.1415926535897931" />

  <!-- Main Body-base -->
  <property name="base_x_size" value="1.0" /> 
  <property name="base_y_size" value="0.5" /> 
  <property name="base_z_size" value="0.25" />
  <property name="base_mass" value="35" /> <!-- in kg-->

  <property name="camera_link" value="0.05" /> <!-- Size of square 'camera' box -->

  <!--Inertial macros for the box and cylinder. Units are kg*m^2-->
  <macro name="box_inertia" params="m x y z">
    <inertia  ixx="${m*(y*y+z*z)/12}" ixy = "0" ixz = "0"
              iyy="${m*(x*x+z*z)/12}" iyz = "0"
              izz="${m*(x*x+z*z)/12}" /> 

  <!-- base_footprint is a fictitious link(frame) that is on the ground right below base_link origin -->
  <link name="base_footprint">
      <mass value="0.0001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
          iyy="0.0001" iyz="0.0" 
          izz="0.0001" />
        <origin xyz="0 0 0" rpy="0 0 0" />
            <box size="0.001 0.001 0.001" />

  <gazebo reference="base_footprint">

  <joint name="base_footprint_joint" type="fixed">
  <origin xyz="0 0 ${wheel_radius - base_z_origin_to_wheel_origin}" rpy="0 0 0" />
    <parent link="base_footprint"/>
    <child link="base_link" />

  <!-- BASE-LINK -->
  <!--Actual body/chassis of the robot-->
  <link name="base_link">
      <mass value="${base_mass}" />
      <origin xyz="0 0 0" />
      <!--The 3x3 rotational inertia matrix. -->
      <box_inertia  m="${base_mass}" x="${base_x_size}" y="${base_y_size}" z="${base_z_size}"/> 
      <origin xyz="0 0 0" rpy="0 0 0" />
        <box size="1 0.5 0.25"/>
      <material name="Yellow" />
      <origin xyz="0 0 0" rpy="0 0 0 " />
        <box size="1 0.5 0.25"/>
  <gazebo reference="base_link">

  <!-- WHEELs -->
  <wheel fb="front" lr="right" parent="base_link" translateX="1" translateY="-1" flipY="-1"/>
  <wheel fb="front" lr="left" parent="base_link" translateX="1" translateY="1" flipY="-1"/>
  <wheel fb="back" lr="right" parent="base_link" translateX="-1" translateY="-1" flipY="-1"/>
  <wheel fb="back" lr="left" parent="base_link" translateX="-1" translateY="1" flipY="-1"/>

    <plugin name="skid_steer_drive_controller" filename="">
      <wheelDiameter>${2*wheel_radius}</wheelDiameter ...
edit retag flag offensive close merge delete