Collision Detection
- class discopygal.geometry_utils.collision_detection.ObjectCollisionDetection(obstaclces, robot, offset=0.05)
A class object that handles collision detection of a single object with obstacles. The collision detector builds a CGAL arrangement representing the scene and allows to (quickly) query the arrangement for collisions.
- Parameters:
- build_cspace()
Build the Cspace arrangement
- clean_redundant_halfedges(arr)
Given an arrangement, clear any halfedge that its both incident faces are nonfree.
- Parameters:
arr (
Arrangement_2
) – arrangement to clean
- expanded_obstacle_arrangement(obstacle)
Given a robot shape and the current obstacle, generate an arrangement that contains the (single) expanded obstacle
- Parameters:
obstacle (
Obstacle
) – obstacle to expand- Returns:
arrangement with expanded obstacle
- Return type:
- is_edge_valid(edge)
Check if a edge (start point with angle to end point with angle) is valid (i.e. not colliding with anything).
- Parameters:
edge (
Segment_2
) – edge to check- Returns:
False if edge intersects with the interior of an obstacle
- Return type:
bool
- is_edge_valid_rod(edge, clockwise)
Check if a edge is valid (i.e. not colliding with anything).
- Parameters:
- Returns:
False if edge intersects with the interior of an obstacle
- Return type:
bool
- is_point_valid(point)
Check if a point is valid (i.e. not colliding with anything).
- Parameters:
point (
Point_2
) – point to check- Returns:
False if point lies in the interior of an obstacle
- Return type:
bool
- is_point_valid_rod(point)
Check if (rod) point and rotation are valid (i.e., not colliding with anything).
- Parameters:
point – point to check: (point, angle)
- Returns:
False if point lies in the interior of an obstacle
- Return type:
bool
- discopygal.geometry_utils.collision_detection.collide_disc_with_disc(center1, r1, center2, r2)
Collide (center ,r) disc with (center ,r) disc
- discopygal.geometry_utils.collision_detection.collide_disc_with_polygon(center, r, polygon)
Collide (center ,r) disc with CGAL polygon
- discopygal.geometry_utils.collision_detection.collide_disc_with_rod(center, r, x, y, a, length)
Collide (center, r) disc with (x, y, a, length) rod
- discopygal.geometry_utils.collision_detection.collide_two_robots(robot1, edge1, robot2, edge2)
Get two robots and an edge of their movement, and check if at any point during their movement they intersect