Ask Your Question
0

Force torque sensor stops publishing

asked 2018-02-13 03:08:27 -0500

Fiddle gravatar image

updated 2018-02-15 06:09:44 -0500

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?

edit retag flag offensive close merge delete

Comments

This sounds similar to ros-simulation/gazebo_ros_pkgs#596.

gvdhoorn gravatar imagegvdhoorn ( 2018-02-13 04:59:51 -0500 )edit

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)?

Fiddle gravatar imageFiddle ( 2018-02-13 07:10:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-02-19 05:31:16 -0500

Fiddle gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2018-02-13 03:08:27 -0500

Seen: 262 times

Last updated: Feb 19 '18