Unable to pause the gazebo simulation publishes in the topic

I am doing the debugging tools, and I got my laser.bag, the problem is right now 2 nodes in publishing in the /laser_scan topic, when I follow the instruction to pause simulation node, it shows the still is on when I type rostopic info /laser_scan, so I want to know what is the reason causing this issue?

Hi @wang.jianshu,

The problem is not quite clear, but it seems you want to stop some (or all?) nodes from publishing to the /laser_scan topic…

  • Have you stopped the playback of the .bag file? This is the one responsible for the 2nd node publishing to the /laser_scan topic.

Does this fix your issue? If not, please explain the problem better and provide screenshots.

Here is my understanding of this part:

I have recorded data, and run command
$ rosbag play -l laser.bag

but the problem is there are some “inf” data in the data, so I use command
rostopic info /laser_scan

to check the status of the /laser_scan and see there are 2 publishers to this topic:
Publishers:
** * /gazebo (http://rosdscomputer:45501/)**
** * /play_1568296669366215201 (http://rosdscomputer:33483/)**

but our purpose is to get only the recorded data, so we need to disable the publisher from /gazebo, I think that is where “inf” data come from.
and now we should run command:
rosservice call /gazebo/pause_physics "{}"

But it does not work, the Gazebo publisher is still publishing the “inf” data to the topic /laser_scan.
This is what I want to ask, why this command does not terminate the publisher and what should I do now?

HI @wang.jianshu,

Let me have a look at that and get back to you. Sorry for the trouble.

Hi @wang.jianshu, I see that it seems the gazebo node is still publishing the inf messages even after pausing it. But it’s actually not.

When you pause the physics, the node still shows up as a publisher on the topic, but the publishing is “paused”.

You can test this:

  • stop bag playback.
  • echo the laserscan topic
  • pause the physics

You should see that the data flow from the laserscan echo will stop. When you unpause, it will continue.

Please let’s know how it goes.

PS: Thanks to you, we have updated the notebook to clarify this point. The updated notebook will be in production along this week.