Skip to content

Commit 3ce7a34

Browse files
authored
Add ScheduleGen and the GR1T2 workflow (#102)
* Add ScheduleGen and the GR1T2 workflow Integrate complete-path scheduling with AutoData generation, annotation, and episode export. Add per-environment and buffered generation, PhysX and Newton GR1T2 configurations, the annotated source dataset, and workflow documentation. Signed-off-by: Neel Jawale <njawale@nvidia.com> * Fix ScheduleGen collision validation and dataset edge cases Check reset transitions, dense robot/world samples, carried objects, and projected object pairs. Keep contact permissions aligned with manipulation boundaries. Handle source-pool and configuration edge cases, add optional array validation, and clarify annotation and replay limits. Signed-off-by: Neel Jawale <njawale@nvidia.com> * Align ScheduleGen object states and simplify generation interfaces Keep robot and projected-object samples on the same boundary timeline. Preserve positional extras in generation results, explain shared annotation fields, group launch options, and support saved Rerun output for SkillGen. Cover manual annotation boundaries across bundled workflows. Signed-off-by: Neel Jawale <njawale@nvidia.com> * Keep object collision checks aligned with world geometry Keep native object/world checks while original meshes are active. Start projected sphere-pair checks once both meshes have been replaced, and cover the transition with focused regression tests. Signed-off-by: Neel Jawale <njawale@nvidia.com> * Address ScheduleGen integration review Signed-off-by: Neel Jawale <njawale@nvidia.com> * Configure GR1T2 object masses before physics startup Signed-off-by: Neel Jawale <njawale@nvidia.com> --------- Signed-off-by: Neel Jawale <njawale@nvidia.com>
1 parent ee632f0 commit 3ce7a34

65 files changed

Lines changed: 11195 additions & 379 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/datasets/
2+
/agentic_design/
23
/src/
34
/docs/
45

‎autodata_core/__init__.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Public entrypoints:
77
8-
* :class:`DataGenerator` — orchestrates a single async generation job.
8+
* :class:`DataGenerator` — runs one asynchronous generation job.
99
* :class:`DataGenInfoPool` — source-demo container; built via :meth:`DataGenInfoPool.from_hdf5`.
1010
* :class:`GenerationAlgorithm` and concrete subclasses — pluggable algorithm surface.
1111
* :func:`get_algorithm`, :func:`iter_algorithms` — algorithm registry lookup.
@@ -23,6 +23,7 @@
2323
from autodata_core.data_generator import DataGenerator, GenerationResult
2424
from autodata_core.datagen_info import DatagenInfo
2525
from autodata_core.pool import DataGenInfoPool
26+
from autodata_core.schedulegen import ScheduleGen
2627
from autodata_core.waypoint import MultiWaypoint, Waypoint, WaypointSequence, WaypointTrajectory
2728

2829
__all__ = [
@@ -35,6 +36,7 @@
3536
"MimicGen",
3637
"MultiWaypoint",
3738
"SoftMimicGen",
39+
"ScheduleGen",
3840
"SkillGen",
3941
"Waypoint",
4042
"WaypointSequence",

‎autodata_core/algorithms.py‎

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,59 @@
77
behavior diverges between Mimic, DexMimicGen, SkillGen, etc.
88
Subclasses self-register at import time via :class:`_AlgorithmMeta`.
99
10-
The main behavioral hook is :meth:`GenerationAlgorithm.plan_subtask_trajectory`, called by
11-
``DataGenerator`` every time an EEF needs a new executable trajectory. Object-state adaptation is
12-
routed through :meth:`GenerationAlgorithm.transform_source_eef_poses`. Rigid algorithms use the
13-
default object-pose transform while SoftMimicGen overrides it with nodal TPS registration.
10+
Per-subtask algorithms customize :meth:`GenerationAlgorithm.plan_subtask_trajectory`.
11+
SkillGen adds planned transits, while SoftMimicGen adapts source poses using nodal registration.
12+
ScheduleGen implements :meth:`GenerationAlgorithm.generate_and_execute_episode` because all
13+
paths must be built before scheduling. Both hooks use the shared episode lifecycle.
1414
"""
1515

1616
from __future__ import annotations
1717

1818
import time
1919
import torch
2020
from collections.abc import Iterable, Iterator
21+
from dataclasses import dataclass
2122
from typing import TYPE_CHECKING, Any
2223

2324
from autodata_core.selection_strategy import make_selection_strategy
2425

2526
if TYPE_CHECKING:
27+
from isaaclab.managers import TerminationTermCfg
28+
2629
from autodata_core.data_generator import DataGenerator, _EEFGenerationState
2730
from autodata_core.waypoint import Waypoint
2831
from autodata_interfaces.datastream.datastream import Datastream
2932
from autodata_interfaces.tasks.subtask_spec import Subtask
3033

34+
35+
@dataclass(frozen=True)
36+
class AlgorithmEpisodeResult:
37+
"""Result returned by an episode-level generation algorithm.
38+
39+
Args:
40+
success: Whether the executed episode satisfied the task success term.
41+
diagnostics: Stable scalar diagnostics suitable for generation sidecars.
42+
"""
43+
44+
success: bool
45+
diagnostics: tuple[tuple[str, str], ...] = ()
46+
47+
def __post_init__(self) -> None:
48+
"""Require a boolean outcome and uniquely named diagnostic entries."""
49+
assert isinstance(self.success, bool), "success must be a bool"
50+
assert isinstance(self.diagnostics, tuple), "diagnostics must be a tuple"
51+
names = tuple(name for name, _ in self.diagnostics)
52+
assert len(names) == len(set(names)), "diagnostic names must be unique"
53+
54+
3155
REGISTERED_ALGORITHMS: dict[str, type[GenerationAlgorithm]] = {}
3256

3357

3458
def get_algorithm(name: str, **kwargs: Any) -> GenerationAlgorithm:
3559
"""Construct the algorithm registered under ``name``, forwarding ``kwargs`` to its ``__init__``.
3660
3761
Mimic and DexMimicGen take no kwargs. SkillGen requires ``motion_planners=`` (per-env dict).
62+
ScheduleGen requires ``planning_contexts=`` (per-env arm and full-state planners).
3863
"""
3964
if name not in REGISTERED_ALGORITHMS:
4065
raise KeyError(f"Unknown algorithm {name!r}. Registered: {sorted(REGISTERED_ALGORITHMS)}")
@@ -64,10 +89,41 @@ class GenerationAlgorithm(metaclass=_AlgorithmMeta):
6489
"""
6590

6691
name: str = ""
67-
expected_eef_count: int | tuple[int, ...] = 1
92+
expected_eef_count: int | tuple[int, ...] | None = 1
6893
requires_motion_planner: bool = False
6994
uses_subtask_start_signals: bool = False
7095
supports_coordination: bool = False
96+
plans_complete_episode: bool = False
97+
98+
async def generate_and_execute_episode(
99+
self,
100+
*,
101+
data_generator: DataGenerator,
102+
env_id: int,
103+
success_term: TerminationTermCfg,
104+
env_action_queue: Any,
105+
pause_subtask: bool,
106+
) -> AlgorithmEpisodeResult:
107+
"""Execute an episode-level algorithm after shared reset.
108+
109+
Per-subtask algorithms leave :attr:`plans_complete_episode` false and never enter this
110+
method.
111+
112+
Args:
113+
data_generator: Generator providing source data and environment interfaces.
114+
env_id: Environment used for the attempt.
115+
success_term: Task success condition.
116+
env_action_queue: Queue consumed by the shared environment stepping loop.
117+
pause_subtask: Whether the algorithm should pause at subtask boundaries.
118+
119+
Returns:
120+
Attempt outcome and algorithm diagnostics.
121+
122+
Raises:
123+
NotImplementedError: The algorithm does not plan complete episodes.
124+
"""
125+
126+
raise NotImplementedError(f"algorithm {self.name!r} does not plan complete episodes")
71127

72128
def validate_setup(self, datastream: Datastream) -> None:
73129
"""Validate source annotations against the composed datastream.

0 commit comments

Comments
 (0)