Detecting Collision

It seems like the autonomous mode in this year’s game has high potential for robots having to come near or cross the paths of other robots. Furthermore, some teams may wish to navigate around the switch and other field obstacles to go score on the opposite side. While we can do our best to avoid situations where we crash into these obstacles by coordinating with alliance partners and fine tuning our autos, it would also be in our best interest be able to detect if we have crashed one and handle that event gracefully (e.g. don’t assume following your motion profile after crashing will still get you to your destination).

It seems like detecting a rapid decrease in velocity via your encoders and/or rapid deceleration via an accelerometer could do well here. That said, I am wondering what teams have done in the past to detect this and how you handled that event (simply stop, somehow reorient yourself and continue, follow a new strategy, etc…)?

P.S. This seems like something that must have been talked about in the past but after searching ‘Detecting Collision’, ‘Auto Crash’, and ‘Handle Collision in Auto’, I have not been able to find something on the topic. Feel free to point me to the thread if I missed it.

Found One!

That’s a good idea. I was just playing around with this using the RoboRIO’s built-in accelerometer. I was using LabView to graph the acceleration, then applied a limit to the X-direction which would stop the program if the limit was exceeded. Quite easy to do, and worked quite well.

There are collision detection examples available for the navX in C++, Java, and LabVIEW.

It should be pretty easy to implement something equivalent for a Pigeon or the roboRIO’s built-in accelerometer.

1 Like

Collision detection with the navx is fairly straightforward. Another thing you might want to try is to have one or two range sensors mounted low (just above bumper height) in the direction/orientation you plan to travel. In 2011 we were using range sensors to verify release distance for the inner tubes, and in a practice match and ally took an unexpected turn in front of the robot, causing it to release the tube prematurely. We rewrote the autonomous code so that if the range sensor picked up an obstacle “close” when it was not expected, we stopped for 2 seconds, then if the obstacle was out of the way, we moved continued moving.

Wouldn’t collision avoidance be much better? By the time you collide, the chances of either bot achieving its goal go way down. If you avoid a collision, you might be able to pause and let the other bot pass, and then continue on your way and you both accomplish your goal.

Seems like a range sensor and some logic that knows what field elements (i.g. switch fence, alliance wall) to expect and when something unexpected comes, then stop or even back up if it is coming closer.

Of course, at the higher ends of competition, if both bots have collision avoidance, they might just politely wait for each other, so knowing the expected paths of your partners and configuring who will ‘wait’ for the other (assuming both can wait, which will be generally unlikely)

Another simple approach is to allow your autonomous to be configured to have a variable pause before starting. We did that in 2012 to avoid two or three bots shooting at the same time and balls colliding at the basket. Worked very well.

I’d suggest that for each auto routine you have, you map out a time table of where it is at each 1/2 second mark in the path and have a variable starting time or some variable pauses in the middle of the path so it can be adjusted. Being able to configure in a pause just before passing through high traffic areas is a good idea.

I agree that it is better to avoid collisions, and I think teams wishing to implement any sort of sophisticated autonomous should strive to do so. Two points to add to that:

  1. Collision avoidance is a harder task than collision detection so start with detection.
  2. It is easier to avoid hitting something than it is to avoid being hit by something. Expect on hopefully rare occasions to be hit by your alliance partner.