Ask Your Question

where does this warning come from in Stage?

asked 2014-09-05 23:15:40 -0500

scopus gravatar image

Hi, all! I am learning a multi-robot collision avoidance algorithm by using simulator Stage.

please see following image: image description

I think the yellow warning( exclamation mark) is saying that two robots crash with each other. I want to know where the code in Stage that this warning comes from, or in other words: what kind of topic is published when a collision is detected and which callback function in Stage is for response when a message( like topic?) about detecting collision is published? Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2014-09-06 09:15:12 -0500

SL Remy gravatar image

updated 2014-09-19 08:21:49 -0500

As a general note, the best source for Stage details is github, but it's embedded in stageros doesn't publish this information. The condition is identified in

You could modify stageros.cpp to detect when a model is stalled (collisions) and to publish a message on a topic.

As a final note, you could also just evaluate the /robot_X/odom message and compare the observed velocity to the intended velocity of the robot. (Compare the embedded twist message to the twist command that you issued.)

edit flag offensive delete link more


Thank you very much for your attention. So do you mean the warnning is from /robot_x/stall topic? I don't know how to display /robot_x/odom topic and /robot_x/cmd_vel topic. These two topics can't be displayed in rqt_plot. And It is very hard to watch them in terminals by inputing "rostopic echo..”

scopus gravatar image scopus  ( 2014-09-09 04:47:39 -0500 )edit

Your robot controller could subscribe to the odom topic (it's already publishing to the the cmd_vel topic). Since it knows what the robot should be doing, it can detect that the commanded velocities are not being observed. rostopic list should let you know all the topics that you can use.

SL Remy gravatar image SL Remy  ( 2014-09-13 18:19:03 -0500 )edit

sorry, I can't understand your guidance. I don't know how to compare the observed velocity to the intended velocity of the robot. I also can't get any signal about the yellow warning by displaying topics /robot_x/odom and /robot_x/cmd_vel or comparing them. Would you like to explain more clearly?

scopus gravatar image scopus  ( 2014-09-19 07:55:19 -0500 )edit

If you issue a Twist message with a non-zero velocity and the observed velocity is zero (your robot isn't moving), then you can infer that you've hit an obstacle. For, /robot_0/odom provides information about robot_0. Subscribe to it and compare with the desired value.

SL Remy gravatar image SL Remy  ( 2014-09-19 08:16:23 -0500 )edit

Although the yellow warning indicates a collision, but the speed of robot is not zero. It is very hard to see a collision is happenning if no yellow warning exists. This is why I said I couldn't compare those topics of /robot_x/odom and Twist message to find some inconsisitencies. Thank you

scopus gravatar image scopus  ( 2014-09-23 04:29:41 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2014-09-05 23:15:40 -0500

Seen: 585 times

Last updated: Sep 19 '14