Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Tutorial: Intermediate: Connect to ROS - Laser is not spinning

Hi,

i have recently started with Gazebo and ROS hence I thought it is a good start doing the tutorial http://gazebosim.org/tutorials?cat=guided_i&tut=guided_i6

I have followed all the previous steps in the tutorial - everything worked well and I could also spin the laser by sending a message over the API I created.

The problem I now face is that Gazebo seems not to subscribe to the topic I start with ROS. Following the tutorial step by step (sourcing every step and maintaining the default directory structure )has not lead to success.

When running rostopic info /my_velodyne/vel_cmd I get the following:

Type: std_msgs/Float32

Publishers: 
 * /rostopic_13126_1485965572986 (http://ThinkPad-T460p:45658/)

Subscribers: None

So it seems that I publish a value which I can also read using rostopic echo /my_velodyne/vel_cmd but nothing (gazebo) is not listening to that value.

Since I usually work with catkin and ros I have no idea how to let gazebo subsribe to the given topic.

I am running ubuntu 16.04 and gazebo 7.0.0 and ros kinetic.

Thank you so much for your help! Any advice is appreciated!

Tutorial: Intermediate: Connect to ROS - Laser is not spinning

Hi,

i have recently started with Gazebo and ROS hence I thought it is a good start doing the tutorial http://gazebosim.org/tutorials?cat=guided_i&tut=guided_i6

I have followed all the previous steps in the tutorial - everything worked well and I could also spin the laser by sending a message over the API I created.

The problem I now face is that Gazebo seems not to subscribe to the topic I start with ROS. Following the tutorial step by step (sourcing every step and maintaining the default directory structure )has not lead to success.

When running rostopic info /my_velodyne/vel_cmd I get the following:

Type: std_msgs/Float32

Publishers: 
 * /rostopic_13126_1485965572986 (http://ThinkPad-T460p:45658/)

Subscribers: None

So it seems that I publish a value which I can also read using rostopic echo /my_velodyne/vel_cmd but nothing (gazebo) is not listening to that value.

Since I usually work with catkin and ros I have no idea how to let gazebo subsribe to the given topic.

I am running ubuntu 16.04 and gazebo 7.0.0 and ros kinetic.

Thank you so much for your help! Any advice is appreciated!

Thanks for the fast fast response! Unfortunately I have both your suggestions did not help. I can run other ros code in my console and I also sourced the setup.bash in every new terminal I opended. Also the velodyne.world file is calling the model name="my_velodyne".

Hence I will share the code with you now!

velodyne.world:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
    <!-- A ground plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>

    <!-- A testing model that includes the Velodyne sensor model -->
    <model name="my_velodyne">
      <include>
        <uri>model://velodyne_hdl32</uri>
      </include>

      <!-- Attach the plugin to this model -->
      <plugin name="velodyne_control" filename="libvelodyne_plugin.so">
    <velocity>2</velocity>
      </plugin>
    </model>

  </world>
</sdf>

velodyne_plugin.cc

Tutorial: Intermediate: Connect to ROS - Laser is not spinning

Hi,

i have recently started with Gazebo and ROS hence I thought it is a good start doing the tutorial http://gazebosim.org/tutorials?cat=guided_i&tut=guided_i6

I have followed all the previous steps in the tutorial - everything worked well and I could also spin the laser by sending a message over the API I created.

The problem I now face is that Gazebo seems not to subscribe to the topic I start with ROS. Following the tutorial step by step (sourcing every step and maintaining the default directory structure )has not lead to success.

When running rostopic info /my_velodyne/vel_cmd I get the following:

Type: std_msgs/Float32

Publishers: 
 * /rostopic_13126_1485965572986 (http://ThinkPad-T460p:45658/)

Subscribers: None

So it seems that I publish a value which I can also read using rostopic echo /my_velodyne/vel_cmd but nothing (gazebo) is not listening to that value.

Since I usually work with catkin and ros I have no idea how to let gazebo subsribe to the given topic.

I am running ubuntu 16.04 and gazebo 7.0.0 and ros kinetic.

Thank you so much for your help! Any advice is appreciated!

Thanks for the fast fast response! Unfortunately I have both your suggestions did not help. I can run other ros code in my console and I also sourced the setup.bash in every new terminal I opended. Also the velodyne.world file is calling the model name="my_velodyne".

Hence I will share the code with you now!

velodyne.world:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
    <!-- A ground plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>

    <!-- A testing model that includes the Velodyne sensor model -->
    <model name="my_velodyne">
      <include>
        <uri>model://velodyne_hdl32</uri>
      </include>

      <!-- Attach the plugin to this model -->
      <plugin name="velodyne_control" filename="libvelodyne_plugin.so">
    <velocity>2</velocity>
      </plugin>
    </model>

  </world>
</sdf>

velodyne_plugin.cc