Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions embodichain/lab/gym/envs/expert_program/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
AntipodalGraspAffordanceBinding,
ArticulationOperationAffordanceBinding,
ArticulationOperationTargetBinding,
ContainerAffordanceBinding,
ControlPartCommandPreset,
ControlPartEndpointBinding,
ControlPartResourceBinding,
Expand All @@ -129,6 +130,7 @@
SimulationRobotResourceBinding,
SimulationRobotSkillProfileBinding,
SimulationSceneBinding,
SupportSurfaceAffordanceBinding,
)
from .catalog import (
ExpertProgramIntegrationCatalog,
Expand Down Expand Up @@ -180,6 +182,7 @@
"CompiledProgramValidator",
"CompiledRepeatFrame",
"CompiledTargetSelection",
"ContainerAffordanceBinding",
"ControlCommandStateEvidenceTracker",
"ControlPartCommandPreset",
"ControlPartEndpointBinding",
Expand Down Expand Up @@ -261,6 +264,7 @@
"SimulationSceneBinding",
"SimulationSegmentPolicyPort",
"StandardExtensionDeclarations",
"SupportSurfaceAffordanceBinding",
"SUPPORTED_EXPERT_PROGRAM_SCHEMA_VERSIONS",
"TargetCfg",
"TargetRefCfg",
Expand Down
24 changes: 23 additions & 1 deletion embodichain/lab/gym/envs/expert_program/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
PLACE_ON_AFFORDANCE_CAPABILITY,
POSE_RELATION_EFFECT_CHANNEL,
BoundRobotSkillProfile,
ContainerRelationTargetGrounder,
HandOverPoseProvider,
OperateArticulation,
Place,
Expand All @@ -74,6 +75,7 @@
SemanticIntegrationManifest,
SemanticValidationError,
SkillPolicyPreset,
SupportSurfaceRelationTargetGrounder,
builtin_semantic_call_catalog,
)
from embodichain.lab.sim.skills.effects import (
Expand Down Expand Up @@ -301,6 +303,18 @@ def _snapshot_relation_grounders(
return tuple(values)


def _builtin_relation_grounders(
scene_binding: SimulationSceneBinding,
) -> tuple[RelationTargetGrounder, ...]:
"""Install standard grounders for declared production relation bindings."""
values: list[RelationTargetGrounder] = []
if scene_binding.support_surfaces:
values.append(SupportSurfaceRelationTargetGrounder())
if scene_binding.containers:
values.append(ContainerRelationTargetGrounder())
return tuple(values)


def _snapshot_relation_grounder_keys(
values: frozenset[tuple[str, type[Affordance], str]],
) -> frozenset[tuple[str, type[Affordance], str]]:
Expand Down Expand Up @@ -1262,7 +1276,15 @@ def __post_init__(self) -> None:
_validate_standard_call_catalog(self.call_catalog)
settle_presets = _snapshot_settle_presets(self.settle_presets)
object.__setattr__(self, "settle_presets", settle_presets)
relation_grounders = _snapshot_relation_grounders(self.relation_grounders)
configured_relation_grounders = _snapshot_relation_grounders(
self.relation_grounders
)
relation_grounders = _snapshot_relation_grounders(
(
*_builtin_relation_grounders(self.scene_binding),
*configured_relation_grounders,
)
)
object.__setattr__(self, "relation_grounders", relation_grounders)
relation_grounder_keys = frozenset(
_relation_grounder_key(grounder) for grounder in relation_grounders
Expand Down
Loading