Contact Guided RRT

class discopygal.solvers.rrt.contact_guided_rrt.Contact_Guided_RRT(num_landmarks: int, step_size: float, sliding_samples: int = 5, use_analytic_sliding: int = 0, num_trees: int = 1, **kwargs: Any)

Bases: SamplingSolver

RRT with Sampling-Based Contact Guidance for SE(2) Planning.

add_edge(p: tuple[Point_2, FT], q: tuple[Point_2, FT], weight: float, clockwise: bool) None

Add a bidirectional edge between two configurations in the roadmap.

add_node(p: tuple[Point_2, FT]) None

Add a configuration node to the roadmap.

build_roadmap() DiGraph

Build the multi-tree roadmap using the contact-guided RRT algorithm.

collision_free(p: tuple[Point_2, FT], q: tuple[Point_2, FT], clockwise: bool) bool

Check if the path between two configurations is collision-free.

classmethod get_arguments() dict[str, Any]

Return a list of arguments and their description, defaults and types. Can be used by a GUI to generate fields dynamically. Should be overridded by solvers.

Returns:

arguments dict

Return type:

dict

get_dist(p: tuple[Point_2, FT], q: tuple[Point_2, FT]) float

Helper wrapper to dynamically pass the robot’s actual length as alpha to the metric.

get_graph() DiGraph

Return a graph (if applicable). Can be overridded by solvers.

Returns:

graph whose vertices are Point_2 or Point_d

Return type:

networkx.Graph or None

get_nearest_vertex(point: tuple[Point_2, FT], tree_idx: int = 0) tuple[Point_2, FT]

Get the nearest vertex in the tree to point

point_to_vec3(point: tuple[Point_2, FT])

Convert a configuration tuple (Point_2, FT) to a 3D Point_d vector.

sample_random_point() tuple[Point_2, FT]

Sample a random point in the configuration space

search_path_on_roadmap() PathCollection

Find the shortest path on the completed roadmap from start to end.

steer(p_near: tuple[Point_2, FT], p_rand: tuple[Point_2, FT]) tuple[Point_2, FT]

Steer from p_near towards p_rand by at most step_size.