Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can't get sonar data with rostopic echo

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'>
  <update_rate>10</update_rate>
  <always_on>true</always_on>
  <visualize>true</visualize>
  <ray>
    <scan>
      <horizontal>
        <samples>100</samples>
        <resolution>1</resolution>
        <min_angle>-0.5</min_angle>
        <max_angle>0.5</max_angle>
      </horizontal>
      <vertical>
        <samples>50</samples>
        <min_angle>-0.5</min_angle>
        <max_angle>0.5</max_angle>
      </vertical>
    </scan>
    <range>
      <min>0.2</min>
      <max>5</max>
      <resolution>0.1</resolution>
    </range>
  </ray>
  <plugin filename="libhector_gazebo_ros_sonar.so" name="gazebo_ros_sonar1_controller">
<gaussianNoise>0.005</gaussianNoise>
    <topicName>/sensor/sonar0</topicName>
    <frameName>sonar1</frameName>
  </plugin>
</sensor>

</gazebo>

In Topic Visualization window inside gazebo gui i see the topic

/gazebo/default/robot/link_name/sonar_sensor/scan

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!

Can't get sonar data with rostopic echo

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'>
  <update_rate>10</update_rate>
  <always_on>true</always_on>
  <visualize>true</visualize>
  <ray>
    <scan>
      <horizontal>
        <samples>100</samples>
        <resolution>1</resolution>
        <min_angle>-0.5</min_angle>
        <max_angle>0.5</max_angle>
      </horizontal>
      <vertical>
        <samples>50</samples>
        <min_angle>-0.5</min_angle>
        <max_angle>0.5</max_angle>
      </vertical>
    </scan>
    <range>
      <min>0.2</min>
      <max>5</max>
      <resolution>0.1</resolution>
    </range>
  </ray>
  <plugin filename="libhector_gazebo_ros_sonar.so" name="gazebo_ros_sonar1_controller">
<gaussianNoise>0.005</gaussianNoise>
    <topicName>/sensor/sonar0</topicName>
    <frameName>sonar1</frameName>
  </plugin>
</sensor>

</gazebo>

In Topic Visualization window inside gazebo gui i see the topic

/gazebo/default/robot/link_name/sonar_sensor/scan

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!