Rosanswers logo

Hi, I am trying to run a reinforcement learning simulation and I decided, that I needed a force/torque sensor inside my robot to improve it. When I start the simulation, for the first episode everything runs fine. But after I reset the simulation for the first time, the sensor topic stops publishing and my simulation breaks is this because the simulation doeas something to robot model? I have also camera topics and they publish just fine after the reset. Here is the code of implementation inside the robot:

   <gazebo reference="gripper_dummy_prismatic_joint">
    <plugin name="ft_sensor" filename="libgazebo_ros_ft_sensor.so">

And here it is how I read it:

wrench_data = rospy.wait_for_message('/ft_sensor_topic', WrenchStamped, timeout=10)

Here is how the simulation reset is called:

self.reset_proxy = rospy.ServiceProxy(
            '/gazebo/reset_simulation', Empty)
            # reset_proxy.call()

When I try to call the topic manually after the reset I get following line:

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


I've tried to somehow go around the issue, and run subscriber only when the topic has data. That allowed me to keep the simulation running, but there is a side effect: with each episode, it takes longer for the topic to start publishing data, at first it is around a minute, but when I ran the simulation for a few days it ran through ~150 episodes and now it waits more than an hour for the topic. This is quite troublesome, since I'd like to run the sim for about 10000 episodes.


Tried reinstalling gazebo_ros_pkgs but that didn't help


Is it possible to save header values of a topic and when this topic starts again initiate it with them?

Originally posted by Fiddle on ROS Answers with karma: 64 on 2018-02-13

Post score: 0

Original comments

Comment by gvdhoorn on 2018-02-13:
This sounds similar to ros-simulation/gazebo_ros_pkgs#596.

Comment by Fiddle on 2018-02-13:
This seems very similar, and I am wondering if maybe something like sequence header or timestamp could be to blame as it seems that after the reset the sim seems to work again at the time it ended the previous episode. Could/should I set them to 0 right before the reset (or during it)?


1 Answer 1


Rosanswers logo

I've found a solution by finding this issue on github - to ignore this bug updateRate of a sensor in urdf must be set to 0.

Originally posted by Fiddle with karma: 64 on 2018-02-19

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.