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

how to stop the robot if something goes wrong

asked 2012-03-29 23:00:56 -0600

brice rebsamen gravatar image

I am trying to setup a diagnostic mechanism on my robot so that it will stop if something goes wrong: a sensor stops working, the TF tree becomes too old, some critical node dies, etc.

I am wondering what's the best practice for that?

I am considering using the diagnostics tools. The monitors seem to be written to inform the operator only, and not take action. Maybe I could write my own node, based on robot_monitor, that would command the motors to stop whenever a diagnostic becomes ERROR...

Also, how to detect that a node died? In some cases, subscribers can report that a publisher is dead if no data was received for some time. But there are other scenarios (A node that does not publish periodically, etc.)

Finally, how to monitor the TF tree? My robot has 2 computers that tend to get out of sync (although I am using NTP to keep their clock synchronized ...) and at times this causes problems that lead the robot to the wall. How could I monitor that, besides periodically testing transforms and catching exceptions (ExtrapolationException ?) ?

For the action part, I am first going to have a node that will stop the motors if something goes wrong, but later I will include a hardware controller that will cut the power and brake if a heart beat signal stops (watchdog).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-03-29 23:17:08 -0600

dornhege gravatar image

Regarding old data, tf, etc. I would say the usually nobody should work on old data. E.g. if you laser data is 5s old, you won't declare the space free and move there.

I think you are aiming for something more generic, where some other node watches such critical things. I agree with your understanding of diagnostics to be only for monitoring.

For what you are planning to do I would probably use a simple node that can detect different failure conditions that would need to be defined.

Diagnostics being an error is quite simple. Regarding tf and nodes sending data in general there is no real generic way as it depends on what is supposed to happen. Maybe some tf is only sent if available and thus it is absolutely normal to not receive tf. Others should always come with 10Hz. Such frequency things can also be monitored using diagnostics in the sender.

Checking a node died should be possible using rosnode list or the master api or in the simplest case by checking the binary is running. Unfortunately those are two different things. You can have a binary running that is not connected to ROS and you can have a ros node connected to others that the master doesn't know (e.g. by restarting the master). Both aren't desired.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-03-29 23:00:56 -0600

Seen: 931 times

Last updated: Mar 29 '12