Code center > Darwinbots3

Collision detection tests

<< < (3/10) > >>

Botsareus:
Peter, what is your level of knowledge Math/Physics wise?

(I flunked calculus believe it or not :P One of this days I will have to buy some self study kits)

Peter:
Quite rusty, learned it at some point, but don't have to use it much. Might need to read in a bit on differential equations or geometry.

Possibly you'll learn better completely on your own then with a teacher. Sadly some teachers manage to make it more complicated then it actually is.

Numsgil:

--- Quote from: Peter on July 31, 2013, 05:42:00 AM ---In VS2010 I can compile Annulus and Azimuth, but I get an compatibility wizard with the onlinecalculator that's in Azimuth.

--- End quote ---

Ignore that.  I think it's unloaded from the solution by default?  It was going to be a way to do some math via a web interface to help me spec out some stuff, but it never went anywhere and the window of usefulness sort of passed on it.

Anyway, now that things are building can you take a look at Modules/Annulus/Annulus.UnitTests/SweptCollisionDetection/RotatingPointvsRotatingLineTests.cs and see if it sort of makes sense to you?

Basically, for the collision of a box vs another box, I've decomposed it in to vertices (points in space) vs line segments.  And to do point vs. line segment, I first do point vs. infinite line, and then clip it to the segment's range.

SimpleLinearMotion_Velocity should hopefully make sense to you, for instance.  It might help to draw some of the tests out on graph paper to get an idea of what they're doing.  There should be ample comments in the actual source code for all the different parameters on the input struct.

I basically need to test a variety of combinations of linear and angular motion to be sure that the code is actually working.  The point vs line tests are mostly done, but point vs. segment I think are missing some tests still, and polygon vs polygon are pretty much missing entirely.

For point vs. segment tests, in addition to just hitting the line segment squarely in the center other good tests are to hit it exactly on its end, to be sure that the code that clips the points to the segments is working correctly.

If you start looking at what tests are there, it will hopefully inspire you about what other tests could be done.

Most new tests you write will probably fail, just because the backend code isn't done, so don't worry about that.

Peter:
I think I understand enough of it to make some tests. I think I'll make some tomorrow.

What's the DOUBLE_ROOT in the ending states, 2 intersections?

Numsgil:

--- Quote from: Peter on July 31, 2013, 02:55:53 PM ---I think I understand enough of it to make some tests. I think I'll make some tomorrow.

What's the DOUBLE_ROOT in the ending states, 2 intersections?

--- End quote ---

I redid a lot of the backend and won't need it anymore, but basically it represented a parabola that didn't quite hit the X axis.  Imagine y = x^2 + 1e-10, for instance.  It was the way the root solver flagged that the first derivative had hit 0, but it hadn't managed to actually find the root.  But it would only occur for things that were almost roots.  Usually issues with floating point accuracy.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version