Python API
Публичные импорты
Корень пакета экспортирует поддерживаемые классы, не импортируя Drake до первого обращения к объекту, которому он нужен:
from online_gcs import (
GCSPathPlanner,
IRISRegionBuilder,
OnlineGCS,
OnlineGCSStats,
RRTStarPlanner,
SceneType,
)
OnlineGCS — высокоуровневый интерфейс. Низкоуровневые планировщики и построитель
областей доступны исследовательскому коду, которому нужен явный контроль, но детали
их методов могут меняться до версии 1.0.
Онлайн-планировщик
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.
Статистика
online_gcs.OnlineGCSStats
dataclass
Планировщик GCS
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*
online_gcs.RRTStarPlanner
plan(q_start, q_goal, goal_tolerance=0.15)
plan_bidirectional(q_start, q_goal, goal_tolerance=0.15)
Построитель областей IRIS
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)
Сцены
online_gcs.SceneType
Bases: Enum