Can't get sonar data with rostopic echo

asked 2017-11-28 07:03:35 -0500

moshimojo gravatar image

updated 2017-12-05 07:56:26 -0500

I've added a sonar sensor on my custom robot model, and i also added the plugin for the sonar in my xacro file like this:

  <gazebo reference="sonar1">
<sensor name='sonar_sensor' type='ray'>
  <plugin filename="" name="gazebo_ros_sonar1_controller">


In Topic Visualization window inside gazebo gui i see the topic


and i can view the data with the

gz topic -e /gazebo/default/robot/link_name/sonar_sensor/scan

but i want to see the sonar data via

rostopic echo /sensor/sonar0

which is the topicName inside the plugin. So i followed evarobot tutorials and subscribed on that topic. The problem is that when i run

rosrun evarobot_sonar_subs sonar_listener

and then

rostopic echo /sensor/sonar0

i get the message

WARNING: no messages received and simulated time is active. Is /clock being published?

Do i miss something? Thanks in advance!

edit retag flag offensive close merge delete


So I'm getting the same issue but with my imu sensor instead. Using orocos for the plugins instead of gazebo plugins. Funny thing is, the exact same code works on another pc running the same lts+indigo package, and shows the values for the imu when I use rostopic echo /imu but it doesnt work for me.

dhruv7396 gravatar image dhruv7396  ( 2018-05-24 04:03:24 -0500 )edit

Did you get any fix?

dhruv7396 gravatar image dhruv7396  ( 2018-05-24 04:03:38 -0500 )edit