Gazebo | Ignition | Community
Ask Your Question

Kinect (in gazebo) not publishing topics

asked 2018-04-07 08:14:14 -0500

malhar gravatar image



I have also tried rosrun gazebo --verbose and I get a warning - [Wrn] [] Conversion of sensor type[depth] not suppported. I believe this may be due to <sensor name="camera" type="depth"> in XML below.

Question: I have been following this tutorial to simulate a Kinect in Gazebo and then publish image,pointcloud etc to ROS topics. However, rostopic list does not show the required topics in the output.

I have also looked at the following questions on this forum - this and this. The issue in the first one seems to be same as mine. The person suggested to use URDF files instead (which I will try but would still like to know why below approach is not working ).

Here is the relevant XML code for the model.sdf file in the kinect directory that I have modified according to the tutorial mentioned above -

  //some xml 

  <sensor name="camera" type="depth">
                <plugin name="camera_plugin" filename="">
              <!-- Keep this zero, update_rate in the parent <sensor> tag
                will control the frame rate. -->

   // some more xml

I would like to mention the following -

  1. Note that in the XML code - The plugin is defined as a sensor plugin (I am aware that model and sensor plugins are different things in Gazebo and it can lead to an error if the right one is not used.)

  2. I have been using the command - roslaunch gazebo_ros empty_world.launch to open the world.I then manually add the kinect model shown above.

  3. I have also tried rosrun gazebo --verbose and I get a warning - [Wrn] [] Conversion of sensor type[depth] not suppported.

  4. Also, output of rostopic list after launching gazebo and adding the kinect ( Sorry unable to format this as code for some reason ) -

    /clock /gazebo/link_states /gazebo/model_states /gazebo/parameter_descriptions /gazebo/parameter_updates /gazebo/set_link_state /gazebo/set_model_state /rosout /rosout_agg

  5. I have checked rostopic echo /clock , which means the Gazebo simulation is running. o I need to install that plugin ? This seems more like an issue on the Gazebo side and hence I have posted here ( instead of ROS forum. )

Thanks a lot !

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2018-04-07 12:37:14 -0500

malhar gravatar image

updated 2018-04-09 15:24:41 -0500

I found the solution by some trial and error.

Update: What I did -

  1. Go to folder ~/.gazebo/models
  2. Make a copy of the ~/.gazebo/models/kinect folder (in the same directory ,ie ~/.gazebo/models ) and rename it as kinect_ros or whatever you want.
  3. As said in this tutorial, update the model.config and model.sdf file with the <name_from_step_2>.
  4. Open Gazebo and try adding the <name_from_step_2> model from the "Insert" tab ( If you can find it in the list )
  5. Assuming step 4 worked and you added the kinect into the Gazebo scene, try rostopic list (and the rest of the tutorial link mentioned above).
  6. If step 5 didnt work, then copy paste (as directed in the tutorial above, so after the closing </camera> tag) the <plugin> ... code from tutorial .. </plugin> code into all the model*.sdf files ( model.sdf, model-1_2.sdf, model-1_3.sdf , model-1_4.sdf ).
  7. Re-launch gazebo_ros and check rostopic or rviz for pointcloud.
  8. If step 7 also didnt work, I can only think of one last thing ( not 100% sure if this makes a difference but try to change this in all the model* files -


For some reason (probably due to the sdf version) I had to copy paste that plugin into all the model*.sdf files in the kinect folder. (or the duplicated one if you don't want to overwrite it). It works now like the tutorial describes.

edit flag offensive delete link more


I have exactly the same problem. Unfortunately, your solution doesn't work for me, I still see no camera topic with rostopic list. Even if I insert the Kinect-Model from database (and not the one from the ~/.gazebo/models folder). I have also apt-get installed gazebo_ros_pkg, but I'm not quite sure how Gazebo/ROS finds & loads the Can you give me any additional information on how you did it (e.g. that you used a catkin ws etc.)? Thank you!

RedJohn gravatar imageRedJohn ( 2018-04-09 09:44:54 -0500 )edit

Hi, Just check the answer, I just updated it. And no, I didn't use a catkin_ws. Almost identical procedure as mentioned in the tutorial.

malhar gravatar imagemalhar ( 2018-04-09 15:16:36 -0500 )edit

Thank you for your updated answer. Unfortunately, something still doesn't work, because no matter what I do, I can't see the camera topics with rostopic list. What Gazebo/ROS version do you use? I have ROS Kinetic with Gazebo 7.0.0 on a Ubuntu 16.04 (in a VM on a Win10 PC).

RedJohn gravatar imageRedJohn ( 2018-04-12 02:53:53 -0500 )edit

Also, after inserting the Kinect, I get a new error/INFO log and my Gazebo chrashes: Camera Plugin: The 'robotNamespace' param did not exit 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. The Conversion-warning is also still there.

RedJohn gravatar imageRedJohn ( 2018-04-12 03:02:23 -0500 )edit

Hey! I followed your method and it worked till one point. Like the point cloud was visible and all the topics were visible. However, when I place objects in front of it, I don't see anything in RViz. The Rviz window has this error which states ' No tf data. Actual error: Fixed Frame [camera_link] does not exist'. Any ideas how to fix this?

aadityacr7 gravatar imageaadityacr7 ( 2018-04-30 04:52:23 -0500 )edit

Hi, I get the same error in Rviz, but I can see my point cloud in Rviz, so I think you can ignore this error message. Even in the tutorial you can see that there's a warning. I find it strange that one has to enter camera_link as a fixed frame, even though the link doesn't exist... Anyway, did you add a PointCloud2 in Rviz and have you selected the right topic (usually /camera/depth/points)? Additionally, one of the links in my answer below might help you further.

RedJohn gravatar imageRedJohn ( 2018-05-01 08:58:14 -0500 )edit

Hi, the solution to make it work on rviz is so simple that it nearly stupid, all you have to do is to write manually in the fixed frame input the framename from the plugin ("camera_link" in this tutorial for exemple :

NaruLatr gravatar imageNaruLatr ( 2018-05-21 18:39:21 -0500 )edit

Hi, I followed the tutorial link in this thread but faced a very similar issue while importing kinect in gazebo. I can publish almost all of the topics except the frame-name. Nothing show up in RViz as there is no camera_link. Would anyone knows the solution to this problem? The gazebo and ROS are all up to date. Thanks!

bartyy gravatar imagebartyy ( 2018-06-01 18:34:31 -0500 )edit

upgrade the version or add the <plugin></plugin> to all the codes can solve the rostopic list problem. change the fixed frame name can help to solve the point clouds problem. Be careful!! it is fixed frame, not the fixed frame in the global status

ddliu gravatar imageddliu ( 2018-11-19 13:01:02 -0500 )edit

With steps 1 to 5 it worked for me. Thanks a lot.

Gaurav K gravatar imageGaurav K ( 2020-09-14 03:52:42 -0500 )edit

answered 2018-04-12 04:35:10 -0500

RedJohn gravatar image

After almost 2 days of digging into this issue, I finally managed to get the kinect sensor in Gazebo publish its topics (and see the point cloud in rviz), horray!

I "just" had to upgrade my Gazebo 7.0.0 to 7.11 (follow the alternative step-by-step-installation here (you can do that even if you already have Gazebo & ROS installed). After that, following the tutorial and the answer from from malhar worked quite well.

If you have the same issue, please also check if you have installed the plugin packages and the gazebo_ros packages

sudo apt install ros-kinetic-gazebo-plugins ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control

in order to have the /opt/ros/kinetic/lib/ file and the gazebo-ros-bindings.

Just FYI: I'm running ROS Kinetic with Gazebo 7 (7.11) on Ubuntu 16.04 (on a VM with Oracle VM VirtualBox, which runs on a Win10 host). I got my solution from this site (quite at the bottom of the page). It seems there was a bug with Gazebo 7.0.0 inside VMs, which then got resolved in a later version of Gazebo 7. Other solutions I tried can be found here, here, here or here, in case my solution still doesn't solve your problem.

edit flag offensive delete link more


Upgrade can solve partial problem. rostopic list show, but the Rviz cannot show the point cloud.

ddliu gravatar imageddliu ( 2018-11-19 12:37:13 -0500 )edit

This worked for me, thanks!

Roberto Z. gravatar imageRoberto Z. ( 2019-02-14 06:42:34 -0500 )edit

Question Tools



Asked: 2018-04-07 08:14:14 -0500

Seen: 9,761 times

Last updated: Apr 12 '18