Home | Tutorials | Wiki | Issues
Ask Your Question

Why are the sensors not publishing?

asked 2016-12-21 10:27:51 -0500

StevenCoral gravatar image

updated 2016-12-21 13:07:32 -0500

Hi all, I wish to start by saying that I have searched for hours for a solution but nothing seems to fit. I'm having trouble with some (actually every) sensor plugin in gazebo 7, along with ubuntu 16.04 and ROS kinetic. Every example that I'm trying to mimic is of urdf or xacro nature (including the tutorial and the turtlebot_description which i have scoured dozens of times), and its hard to follow when you got 4 files inter-included. I want to get to the bottom of things, trying to build a robot using pure SDF format, but I'll take the question to the simplest form. I took the "stock" kinect model, and added a depth plugin in the following manner:

<?xml version="1.0" ?>
<sdf version="1.5">
  <model name="kinect">
    <pose>0 0 0.036 0 0 0</pose>
    <link name="base">
      <collision name="collision">
            <size>0.073000 0.276000 0.072000</size>
      <visual name="visual">
      <sensor name="camera" type="depth">
        <plugin name="kinect_camera_controller" filename="libgazebo_ros_openni_kinect.so">

I get no parsing errors while spawning, yet there is no topic being published neither using gz topic -l nor with rostopic list. I know I'm doing something wrong because there is no reference pose for the... lets say "image sensor location". i.e. to have the camera positioned at the kinect's lens rather than on its base. Furthermore, launching the turtlebot_sim does publish the kinect topic, readable in Rviz.

Same issue happens with the hokuyo - If I spawn the stock model I do see the "laser field" from the "libRayPlugin.so", but I get no topic published when adding the "libgazebo_ros_gpu_laser.so" plugin. I do have a "scan" topic, but that seem to originate from the "ray" sensor tag and not the plugins.

Its a bit long but I feel like i got it all wrong. Is there anyone that can save my soul? Many thanks in advance, Steve

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-01-01 18:35:57 -0500

hari1234 gravatar image

updated 2017-01-01 18:39:57 -0500

<robot name="robot"> <gazebo reference="camera_link"> <mu1>0.2</mu1> <mu2>0.2</mu2> <material>Gazebo/Yellow</material> </gazebo> <gazebo reference="camera_link"> <sensor type="depth" name="kinect"> <always_on>1</always_on> <visualize>true</visualize>
<camera> <horizontal_fov>1.047</horizontal_fov>
<image> <width>640</width> <height>480</height> <format>R8G8B8</format> </image> <depth_camera>

             <plugin name="camera_controller" filename="libgazebo_ros_openni_kinect.so">

These is working for me, u can either launch this camera from launch file or directly by using ros spawn methode described in gazebo roslaunch tutorial.

edit flag offensive delete link more


Thank you for your answer. Appearantly I was launching gazebo through gazebo and not the ros_gazebo package, therefore topics were not published. silly me.

StevenCoral gravatar imageStevenCoral ( 2017-01-03 04:23:44 -0500 )edit

I am not able to see topics being published even after I launch the world using rosrun gazebo_ros gazebo and then adding the world. My sdf files is as following The kinect sdf is [https://gist.github.com/arpit15/a900bb0ed0a49cc610223c7097740fce] and my world file is [https://gist.github.com/arpit15/cdd0dfd7df206c07179481c7d3566d5a]

arpit159 gravatar imagearpit159 ( 2017-04-10 12:22:13 -0500 )edit

Hi @arpit, I am having the same issue. Have you found a solution ?

malhar gravatar imagemalhar ( 2018-02-25 15:45:25 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-12-21 10:27:51 -0500

Seen: 2,661 times

Last updated: Jan 01 '17