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

Predator/Prey simulation

asked 2012-12-17 18:11:27 -0600

tleyden gravatar image

I want to create two simulated robots which will engage in predator/prey behavior. I don't actually care what kind of robots they are, the simpler the better. But I do need a way to detect when the predator collides with the prey in order to remove the prey from the simulation (due to being eaten).

I've managed to get a few turtles running in the turtlesim, but how would I go about doing collision detection? Would I have to roll my own node or is there something existing I can use?

If I switched from turtlesim to either stage or gazebo, would this be easier to leverage pre-built tools do the collision detection?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-12-17 22:04:24 -0600

KruseT gravatar image

In Turtlesim you'd have to write your own node that would detect collision based on turtle distance. However since your predator/prey code needs a node anyway, you can implement that in that node.

Turtlesim is meant as a toy for learning how to program, but it might be sufficient for your needs.

The advantage of stage and Gazebo are that much more complex robots can be represented, that they have an actual shape, and there can be an environment with walls. however detecting a collision and removing the prey would probably be at least as hard as in turtlesim.

edit flag offensive delete link more


Thanks! My plan is to see how far I can get with turtlesim, then switch over to Stage or Gazebo. (probably Gazebo). I just asked a more specific question regarding collision detection in gazebo:

tleyden gravatar image tleyden  ( 2012-12-18 03:54:06 -0600 )edit

Question Tools

1 follower


Asked: 2012-12-17 18:11:27 -0600

Seen: 576 times

Last updated: Dec 17 '12