ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Gazebo kinect plugin needs <interial>

asked 2018-02-28 08:03:21 -0500

ipa-hsd gravatar image

updated 2018-02-28 08:09:22 -0500

I am trying to mount a kinect camera on the end-effector of a manipulator in the URDF. But the plug-in is loaded only when the reference frame has an <inertial> tag:

<!-- setup empty world -->
<link name="camera_depth_frame">
<inertial>
  <mass value="0.001" />
  <origin xyz="0 0 0" />
  <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
           iyy="0.0001" iyz="0.0"
           izz="0.0001" />
</inertial>
</link>
<link name="camera_depth_optical_frame">
<inertial>
  <mass value="0.001" />
  <origin xyz="0 0 0" />
  <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
           iyy="0.0001" iyz="0.0"
           izz="0.0001" />
</inertial>
</link>
<joint name="camera_depth_optical_joint" type="fixed">
  <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
  <parent link="camera_depth_frame" />
  <child link="camera_depth_optical_frame" />
</joint>
<gazebo reference="camera_depth_frame">
  <sensor type="depth" name="camera">
    <always_on>true</always_on>
    <update_rate>20.0</update_rate>
    <camera>
      <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
      <image>
        <format>B8G8R8</format>
        <width>640</width>
        <height>480</height>
      </image>
      <clip>
        <near>0.05</near>
        <far>8.0</far>
      </clip>
    </camera>
    <plugin name="kinect_camera_controller" filename="libgazebo_ros_openni_kinect.so">
      <cameraName>camera</cameraName>
      <alwaysOn>true</alwaysOn>
      <updateRate>10</updateRate>
      <imageTopicName>color/image_raw</imageTopicName>
      <depthImageTopicName>depth/image_raw</depthImageTopicName>
      <pointCloudTopicName>depth/points</pointCloudTopicName>
      <cameraInfoTopicName>color/camera_info</cameraInfoTopicName>
      <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
      <frameName>camera_depth_optical_frame</frameName>
      <baseline>0.1</baseline>
      <distortion_k1>0.0</distortion_k1>
      <distortion_k2>0.0</distortion_k2>
      <distortion_k3>0.0</distortion_k3>
      <distortion_t1>0.0</distortion_t1>
      <distortion_t2>0.0</distortion_t2>
      <pointCloudCutoff>0.4</pointCloudCutoff>
    </plugin>
  </sensor>
</gazebo>

If I remove the <inertial> tag, then the plugin is not loaded anymore. Why is that? None of the tutorials mention this.

Also, the plug-in is loaded only when the parent of the camera_depth_frame is fixed. As in, if it is mounted on an end-effector frame, then the plugin is not loaded. What is happening here?

I am using ROS-kinetic on Ubuntu 16.04.

edit retag flag offensive close merge delete

Comments

Is it possible that the problem arises since my manipulator does not have transmissions defined?

ipa-hsd gravatar image ipa-hsd  ( 2018-02-28 08:59:51 -0500 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2018-02-28 08:30:24 -0500

Delb gravatar image

Gazebo is a physic engine so you have to define the physical properties in your urdf or else Gazebo wouldn't know how to interract with your model and the world.

If the parent of camera_depth_frame is mounted on an end-effector frame it still has to be fixed on it or else you could be able to move your camera while the effector is moving which makes no sense.

edit flag offensive delete link more

Comments

@Delb thanks for your answer. Yes the camera frame is fixed to the end-effector. But I guess since the URDF does not define the transmissions, the plugin is not loaded. I don't know why though.

ipa-hsd gravatar image ipa-hsd  ( 2018-02-28 10:05:17 -0500 )edit
3

I wouldn't be surprised if elements of the tree are trimmed when a parent link cannot be simulated. It's mentioned in this tutorial that a inertial elements are required for simulation:

tfoote gravatar image tfoote  ( 2018-02-28 20:05:23 -0500 )edit

That's strange because when I view the TF tree in rviz, I could see all the frames correctly. But as you said, I could not visualize the links beyond base in Gazebo. Why this discrepancy? Thanks for the link regarding inertial!

ipa-hsd gravatar image ipa-hsd  ( 2018-03-01 10:33:44 -0500 )edit

How can you view it in rviz ? You should use rqt_tf_tree or tf view_frames. What are the links you can't visualize ? Even if the tf tree is correct the Gazebo simulation takes more parameters so your configuration might be correct for rviz and not for Gazebo you should check it again

Delb gravatar image Delb  ( 2018-03-02 02:41:20 -0500 )edit
1

@tfoote 's comment is correct. Gazebo doesn't simulate links without inertia. The links will still show up in TF and RViz, but that has nothing to do with it. If you look at the left side of the Gazebo GUI, you'll see that only links with inertia show up.

Martin Günther gravatar image Martin Günther  ( 2018-03-05 04:26:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-02-28 08:03:21 -0500

Seen: 1,082 times

Last updated: Feb 28 '18