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">
<provideFeedback>true</provideFeedback>
</gazebo>
<gazebo>
<plugin name="ft_sensor" filename="libgazebo_ros_ft_sensor.so">
<updateRate>100.0</updateRate>
<topicName>ft_sensor_topic</topicName>
<jointName>gripper_dummy_prismatic_joint</jointName>
</plugin>
</gazebo>
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)
...
rospy.wait_for_service('/gazebo/reset_simulation')
try:
# reset_proxy.call()
self.reset_proxy()
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?
EDIT:
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.
EDIT#2:
Tried reinstalling gazebo_ros_pkgs but that didn't help
EDIT#3:
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)?