Gazebo sensor kinect link not exist in rviz

asked 2017-10-08 23:15:50 -0600

jacknlliu gravatar image

I create a world file which including a kinect sensor with gazebo plugin for ros.

part of model kinect in my world file as follows

    <model name='kinect'>
  <link name='link'>
    <pose frame=''>0 0 0 0 -0 0</pose>
    <inertial>
      <mass>0.1</mass>
      <inertia>
        <ixx>1</ixx>
        <ixy>0</ixy>
        <ixz>0</ixz>
        <iyy>1</iyy>
        <iyz>0</iyz>
        <izz>1</izz>
      </inertia>
      <pose frame=''>0 0 0 0 -0 0</pose>
    </inertial>
    <self_collide>0</self_collide>
    <kinematic>0</kinematic>
    <sensor name='camera' type='depth'>
      <always_on>true</always_on>
      <update_rate>20</update_rate>
      <camera name='3dcamera'>
        <horizontal_fov>1.0472</horizontal_fov>
        <image>
          <width>640</width>
          <height>480</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.05</near>
          <far>3</far>
        </clip>
      </camera>
      <!--we add a kinect plugin here-->
      <plugin name="kinect_controller" filename="libgazebo_ros_openni_kinect.so">
        <baseline>0.2</baseline>
        <alwaysOn>true</alwaysOn>
        <updateRate>1.0</updateRate>
        <cameraName>3dcamera</cameraName>
        <imageTopicName>/3dcamera/rgb/image_raw</imageTopicName>
        <cameraInfoTopicName>/3dcamera/depth/camera_info</cameraInfoTopicName>
        <depthImageTopicName>/3dcamera/depth/image_raw</depthImageTopicName>
        <depthImageInfoTopicName>/3dcamera/depth/camera_info</depthImageInfoTopicName>
        <pointCloudTopicName>/3dcamera/depth/points</pointCloudTopicName>
        <frameName>kinect_link</frameName>
        <pointCloudCutoff>0.5</pointCloudCutoff>
        <distortionK1>0.00000001</distortionK1>
        <distortionK2>0.00000001</distortionK2>
        <distortionK3>0.00000001</distortionK3>
        <distortionT1>0.00000001</distortionT1>
        <distortionT2>0.00000001</distortionT2>
        <CxPrime>0</CxPrime>
        <Cx>0</Cx>
        <Cy>0</Cy>
        <focalLength>0</focalLength>
        <hackBaseline>0</hackBaseline>
      </plugin>
      <!--added a kinect plugin-->
    </sensor>
    <gravity>1</gravity>
    <visual name='visual'>
      <geometry>
        <mesh>
          <uri>model://kinect/meshes/kinect.dae</uri>
          <scale>1 1 1</scale>
        </mesh>
      </geometry>
      <pose frame=''>0 0 0 0 -0 0</pose>
      <cast_shadows>1</cast_shadows>
      <transparency>0</transparency>
    </visual>
    <collision name='collision'>
      <laser_retro>0</laser_retro>
      <max_contacts>10</max_contacts>
      <pose frame=''>0 0 0 0 -0 0</pose>
      <geometry>
        <box>
          <size>0.073 0.276 0.072</size>
        </box>
      </geometry>
      <surface>
        <friction>
          <ode>
            <mu>1</mu>
            <mu2>1</mu2>
            <fdir1>0 0 0</fdir1>
            <slip1>0</slip1>
            <slip2>0</slip2>
          </ode>
          <torsional>
            <coefficient>1</coefficient>
            <patch_radius>0</patch_radius>
            <surface_radius>0</surface_radius>
            <use_patch_radius>1</use_patch_radius>
            <ode>
              <slip>0</slip>
            </ode>
          </torsional>
        </friction>
        <bounce>
          <restitution_coefficient>0</restitution_coefficient>
          <threshold>1e+06</threshold>
        </bounce>
        <contact>
          <collide_without_contact>0</collide_without_contact>
          <collide_without_contact_bitmask>1</collide_without_contact_bitmask>
          <collide_bitmask>1</collide_bitmask>
          <ode>
            <soft_cfm>0</soft_cfm>
            <soft_erp>0.2</soft_erp>
            <kp>1e+13</kp>
            <kd>1</kd>
            <max_vel>0.01</max_vel>
            <min_depth>0</min_depth>
          </ode>
          <bullet>
            <split_impulse>1</split_impulse>
            <split_impulse_penetration_threshold>-0.01</split_impulse_penetration_threshold>
            <soft_cfm>0</soft_cfm>
            <soft_erp>0.2</soft_erp>
            <kp>1e+13</kp>
            <kd>1</kd>
          </bullet>
        </contact>
      </surface>
    </collision>
  </link>
  <static>1</static>
  <allow_auto_disable>1</allow_auto_disable>
  <pose frame=''>2.3468 -2.09018 1.20453 0 -0 2.17579</pose>
</model>

And then I load my world file using gazebo_ros in my ros launch file, like

<!-- startup simulated world -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" default="$(find assembler_description)/world/myworkcell-with-all-1.world"/>
<arg name="paused" value="$(arg paused)"/>
<arg name="gui" value="$(arg gui)"/>
<env name="GAZEBO_MODEL_PATH" value="/home/ros/.gazebo/models:$(find ur_description)/meshes:$(find assembler_description)/models:${GAZEBO_MODEL_PATH}"/>
</include>

 <!-- send robot urdf to param server as 'robot_description' -->
 <include file="$(find assembler_description)/launch/robot_upload.launch">
 <arg name="limited" value="$(arg limited ...
(more)
edit retag flag offensive close merge delete

Comments

Hey! Did you find any solution for the same? Thanks in advance!

aadityacr7 gravatar imageaadityacr7 ( 2018-05-01 16:43:31 -0600 )edit