curobo.graph.prm module

class PRMStar(
config: GraphConfig,
)

Bases: GraphPlanBase

_find_paths(
x_init_batch,
x_goal_batch,
all_paths=False,
)
_add_bias_graph(
x_init_batch,
x_goal_batch,
node_set_batch,
node_set,
)
_find_one_path(
x_init_batch,
x_goal_batch,
)

Find path from a batch of initial and goal configs

Parameters:
  • x_init ([type]) – batch of start

  • x_goal ([type]) – batch of goal

  • return_path_lengths (bool, optional) – [description]. Defaults to False.

Returns:

b, h, dof

Return type:

[type]

_find_all_path(
x_init_batch,
x_goal_batch,
)

Find path from a batch of initial and goal configs

Parameters:
  • x_init ([type]) – batch of start

  • x_goal ([type]) – batch of goal

  • return_path_lengths (bool, optional) – [description]. Defaults to False.

Returns:

b, h, dof

Return type:

[type]

build_graph(
x_start=None,
x_goal=None,
number_of_nodes=None,
lazy=False,
bias_samples=False,
k_nn=5,
c_max=10,
c_min=1,
lazy_nodes=False,
)
warmup(
x_start: Tensor | None = None,
x_goal: Tensor | None = None,
)
_add_batch_edges_to_graph(
new_nodes,
start_nodes,
lazy=False,
add_exact_node=False,
)
_add_unique_nodes_to_graph(
nodes,
add_exact_node=False,
skip_unique_check=False,
)
_batch_k_nearest(
sample_point,
current_graph,
k=10,
)
_batch_steer(
start_nodes,
desired_nodes,
steer_radius=None,
add_steer_pts=-1,
lazy=False,
)
_batch_steer_and_connect(
start_nodes,
goal_nodes,
add_steer_pts=-1,
lazy=False,
add_exact_node=False,
)

Connect node from start to goal where both are batched.

Parameters:
  • start_node ([type]) – [description]

  • goal_nodes ([type]) – [description]

_compute_rotation_frame(
x_start,
x_goal,
)
_cuda_graph_rollout_constraint(
x_samples,
use_batch_env=False,
)
_distance(
pt,
batch_pts,
norm=True,
)
_get_graph_shortest_path(
start_node_idx,
goal_node_idx,
return_length=False,
)
_hybrid_nearest(
sample_node,
path,
radius,
k_n=10,
)
_k_nearest(
sample_point,
current_graph,
k=10,
)
_mask_samples(x_samples)
_mask_samples_cuda_graph(
x_samples,
)
_near(
sample_point,
current_graph,
radius,
)
_nearest(
sample_point,
current_graph,
)
_sample_pts(
n_samples=None,
bounded=False,
unit_ball=False,
seed=123,
)
_validate_graph()
add_nodes_to_graph(
nodes,
add_exact_node=False,
)
batch_get_graph_shortest_path(
start_idx_list,
goal_idx_list,
return_length=False,
)
batch_path_exists(
start_idx_list,
goal_idx_list,
all_paths=False,
)
batch_shortcut_path(
g_path,
start_idx,
goal_idx,
)
check_feasibility(x_set)
compute_path_length(path)
connect_nodes(
x_set=None,
connect_mode='knn',
debug=False,
lazy=False,
add_exact_node=False,
k_nn=10,
edge_set=None,
)
distance(
pt,
batch_pts,
norm=True,
)
find_paths(
x_init,
x_goal,
interpolation_steps: int | None = None,
) GraphResult
static from_dict(
graph_dict: Dict,
tensor_args: TensorDeviceType,
rollout_fn: RolloutBase,
safety_rollout_fn: RolloutBase,
use_cuda_graph: bool = True,
)
get_all_rollout_instances() List[RolloutBase]
get_biased_vertex_set(
x_start,
x_goal,
c_max=10.0,
c_min=1,
n=None,
lazy=False,
)
get_feasible_sample_set(
x_samples,
)
get_graph()
get_graph_edges()

Return edges in the graph with start node and end node locations

Returns:

tensor

get_graph_shortest_path_lengths(
goal_idx: int,
)
get_interpolated_trajectory(
trajectory: List[Tensor],
interpolation_steps: int | None = None,
)
get_metrics(
state: State,
)
get_new_vertex_set(
n=None,
lazy=False,
)
get_node_idx(
goal_state,
exact=False,
) int | None
get_path_lengths(goal_idx)
get_paths(path_list)
get_samples(
n_samples: int,
bounded: bool = True,
)
interpolation_acceleration_scale: float = 0.5
interpolation_deviation: float = 0.05
interpolation_dt: float = 0.02
static load_from_robot_config(
robot_cfg: str | Dict | RobotConfig,
world_model: str | Dict | WorldConfig | None = None,
tensor_args: TensorDeviceType = TensorDeviceType(device=device(type='cuda', index=0), dtype=torch.float32, collision_geometry_dtype=torch.float32, collision_gradient_dtype=torch.float32, collision_distance_dtype=torch.float32),
world_coll_checker: WorldCollision | None = None,
base_cfg_file: str = 'base_cfg.yml',
graph_file: str = 'graph.yml',
self_collision_check: bool = True,
use_cuda_graph: bool = True,
seed: int | None = None,
)
mask_samples(x_samples)
path_exists(
start_node_idx,
goal_node_idx,
)
reset_buffer()
reset_cuda_graph()
reset_graph()
reset_seed()
validate_graph()
max_nodes: int
steer_delta_buffer: int
sample_pts: int
node_similarity_distance: float
rejection_ratio: int
k_nn: int
c_max: float
vertex_n: int
graph_max_attempts: int
graph_min_attempts: int
init_nodes: int
use_bias_node: bool
dof: int
bounds: torch.Tensor
tensor_args: TensorDeviceType
rollout_fn: RolloutBase
safety_rollout_fn: RolloutBase
max_buffer: int
max_cg_buffer: int
compute_metrics: bool
interpolation_type: InterpolateType
interpolation_steps: int
seed: int
use_cuda_graph_mask_samples: bool
distance_weight: torch.Tensor
bias_node: tensor.T_DOF