meco-group / omg-tools

Optimal Motion Generation-tools: motion planning made easy
GNU Lesser General Public License v3.0
559 stars 97 forks source link

Bouncing obstacles #51

Closed timmercy closed 7 years ago

timmercy commented 7 years ago

Bouncing: can now be done by setting the following option when making an obstacle: options={'bounce':True}

Implemented: Circle - Circle bouncing --> with horizontal, vertical or diagonal movement Rectangle - Rectangle bouncing --> with horizontal, vertical or diagonal movement (with orientation = 0)

Not yet implemented: Circle - rectangle bouncing --> check distance to line, if < radius check if x or y value of center is between min and max of line --> check distance from center to vertices, as extra If orientation != 0 things get a lot more complicated --> need to determine angle between velocity vector and colliding side Bouncing off the border --> for rectangular environments this requires a comparison between vertices and xmin,xmax,ymin,ymax

I will implement bouncing off the border later, but the other two implementations are not worth the effort I think. The things which are implemented allow making enough examples.

timmercy commented 7 years ago

The only thing which doesn't work now is Polyhedron-Polyhedron bouncing (which are no rectangles), or rectangle bouncing with non-zero orientation. For the moment there is no need to implement this, so I will close the issue.