Skip to content

Python API

Public imports

The package root exposes the supported classes without importing Drake until a Drake-backed object is requested:

from online_gcs import (
    GCSPathPlanner,
    IRISRegionBuilder,
    OnlineGCS,
    OnlineGCSStats,
    RRTStarPlanner,
    SceneType,
)

OnlineGCS is the high-level interface. The lower-level planners and region builder are available for research code that needs explicit control, but their method-level details may evolve before 1.0.

Online planner

online_gcs.OnlineGCS

run(num_keypoints=10, prune_interval=20, animation_speed=1.0)

Run the online GCS algorithm.

Parameters:

Name Type Description Default
num_keypoints int

Number of keypoints to extract from RRT path

10
prune_interval int

How often to prune redundant regions (0 = never)

20
animation_speed float

Speed multiplier for animations (higher = faster)

1.0

get_statistics()

Return current statistics of the online GCS algorithm.

save_regions(filepath)

Save current IRIS regions to a YAML file.

Statistics

online_gcs.OnlineGCSStats dataclass

GCS planner

online_gcs.GCSPathPlanner

from_iris_builder(iris_builder, k_shortest_paths=1) classmethod

from_yaml(yaml_path, scene_type, k_shortest_paths=1) classmethod

solve_from_configs(q_start, q_goal, order=3, max_rounded_paths=10, build_missing_regions=False, start_nearest_idx=None, goal_nearest_idx=None)

Solve path planning directly from joint configurations.

Parameters:

Name Type Description Default
q_start ndarray

Start configuration in joint space

required
q_goal ndarray

Goal configuration in joint space

required
order int

Bezier order (1=fast, 3=smooth/short)

3
max_rounded_paths int

GCS rounding parameter

10
build_missing_regions bool

Build IRIS if points not in regions (SLOW!)

False

RRT* planner

online_gcs.RRTStarPlanner

plan(q_start, q_goal, goal_tolerance=0.15)

plan_bidirectional(q_start, q_goal, goal_tolerance=0.15)

IRIS region builder

online_gcs.IRISRegionBuilder

build_regions(num_seeds, collision_samples=3, rng=None)

build_regions_from_seeds(seed_configs, collision_samples=3, existing_regions=None)

Build IRIS regions from provided seed configurations. Seeds already covered by existing_regions or by regions built earlier in this batch are skipped.

save_regions(filepath)

load_regions(filepath)

Scenes

online_gcs.SceneType

Bases: Enum