0
$\begingroup$

Rosanswers logo

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!


Originally posted by scopus on ROS Answers with karma: 279 on 2014-09-05

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

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


Originally posted by SL Remy with karma: 2022 on 2014-09-06

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by scopus on 2014-09-09:
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..”

Comment by SL Remy on 2014-09-13:
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.

Comment by scopus on 2014-09-19:
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?

Comment by SL Remy on 2014-09-19:
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 willow-four-erratics.world, /robot_0/odom provides information about robot_0. Subscribe to it and compare with the desired value.

Comment by scopus on 2014-09-23:
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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.