0
$\begingroup$

Rosanswers logo

I am a beginner in ROS and RViz I would like to get Kinect Module work with UR5 Simulation.

Right now I installed UR5 Library from Universal Robot

After that I installed Openni Kinect Kinetic version on my Ubuntu 16.04. I run these commands:

roslaunch ur_gazebo ur5.launch

And add my Kinect Camera as it is told in the tutorials and my Model.sdf file looks like this:

<?xml version='1.0'?>
<sdf version='1.6'>
  <model name='camera'>
    <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>
      </inertial>
      <self_collide>0</self_collide>
      <kinematic>0</kinematic>
      <sensor name='camera' type='depth'>
        <update_rate>20</update_rate>
        <camera name='__default__'>
          <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>
    <plugin name="camera_plugin" filename="libgazebo_ros_openni_kinect.so">
          <baseline>0.2</baseline>
          <alwaysOn>true</alwaysOn>
          <!-- Keep this zero, update_rate in the parent <sensor> tag
            will control the frame rate. -->
          <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>
      <visual name='visual'>
        <geometry>
          <mesh>
            <uri>model://kinect/meshes/kinect.dae</uri>
          </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>0</static>
    <allow_auto_disable>1</allow_auto_disable>
  </model>
</sdf>

I run these two command for Rviz simulation as it is in the Universal Robot Git.

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true
roslaunch ur5_moveit_config moveit_rviz.launch config:=true

But cannot set Camera_link which is my Camera frame inside this:

phot of Rviz:

But I cannot see anything as a sensor data. And even there is publishers in rostopic nothing published on them with this error

rostopic echo /camera/depth/image_raw
WARNING: no messages received and simulated time is active.
Is /clock being published?

please help :D


Originally posted by Meric on ROS Answers with karma: 23 on 2019-03-21

Post score: 0


Original comments

Comment by Meric on 2019-03-21:
The main problem might be Fixed Frame in my sdf file doesnt exist on Rviz

Comment by Meric on 2019-03-21:
I made my Camera Model.sdf to World as URF Rviz simulation frame, Nothing changed, doesnt see anything published

Comment by Meric on 2019-03-21:
Also Error Log when I insert the Kinect Camera

gzserver: /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreRenderSystem.cpp:546: virtual void Ogre::RenderSystem::setDepthBufferFor(Ogre::RenderTarget*): Assertion `bAttached && "A new DepthBuffer for a RenderTarget was created, but after creation" "it says it's incompatible with that RT"' failed.
Aborted (core dumped)
$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

IT Has nothing to do with Fixed Frame, The Model file can have standalone frame name which should be same with Rviz frame.

Ok After I upgraded to the Gazebo 7.14 Which cost me like nearly a DAY, the problem seem to fixed. I am not sure if is fully fixed but I can see a gray scale image and I can rostopic echo the publishers and some values of arrays comes in.

I wish some one could find this answer usefull. Thanks


Originally posted by Meric with karma: 23 on 2019-03-21

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.