Ask Your Question

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">
  <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" />
<link name="camera_depth_optical_frame">
  <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" />
<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" />
<gazebo reference="camera_depth_frame">
  <sensor type="depth" name="camera">
    <plugin name="kinect_camera_controller" filename="">

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


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

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


@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

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

@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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 845 times

Last updated: Feb 28 '18