ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Detecting host timeout in rosserial_arduino

asked 2017-02-12 22:19:03 -0600

Cerin gravatar image

How do you detect on the Arduino's end when the host has stopped responding with rosserial_arduino?

I'd like to implement a safety feature where if the host crashes or otherwise becomes unresponsive, the Arduino will immediately halt any motors. However, nothing in the documentation explains how to access the last read times from the node handle.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-02-13 00:20:26 -0600

ahendrix gravatar image

There's a connected() method in the underlying rosserial_client API: ; it looks like it does this by monitoring the time sync messages, and the timeout is about 10 seconds.

That's probably a bit too long for a safety timeout, and I'm not aware of any other periodic messages that are built into rosserial.

Probably the best thing to do is to implement your own timeout; my favorite way to do this is to set a timeout on the command message itself. If my firmware doesn't receive a command within 3x the expected command interval, it commands an immediate stop. (I'm not using rosserial, but the principle is the same)

edit flag offensive delete link more

Question Tools



Asked: 2017-02-12 22:19:03 -0600

Seen: 462 times

Last updated: Feb 13 '17