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
814 changes: 814 additions & 0 deletions embodichain/gen_sim/action_engine/generation/config_builder.py

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions embodichain/gen_sim/action_engine/generation/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2021-2026 DexForce Technology Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------

"""Small value objects used by Action Engine config generation."""

from __future__ import annotations

from dataclasses import dataclass
from pathlib import Path
from typing import Any

__all__ = ["GeneratedConfigPaths", "PreparedScene"]


@dataclass(frozen=True)
class GeneratedConfigPaths:
"""Paths written by one successful generation transaction."""

gym_config: Path
agent_config: Path
task_spec: Path
scene_requirements: Path
seed_task_graph: Path
seed_task_graph_png: Path
planning_mode: str = "offline"

@property
def execution_program(self) -> Path:
"""Retain the Python API alias for callers migrating to SeedGraph v3."""
return self.seed_task_graph

@property
def offline_seed_task_graph(self) -> Path:
"""Explicit A/B alias for the immutable offline SeedGraph artifact."""
return self.seed_task_graph

@property
def seed_task_graph_path(self) -> Path:
"""Path-style alias used by runtime config loaders."""
return self.seed_task_graph

@property
def offline_seed_task_graph_path(self) -> Path:
"""Verbose alias for callers that distinguish A/B graph branches."""
return self.seed_task_graph

@property
def offline_seed_task_graph_png(self) -> Path:
"""Explicit A/B alias for the review rendering of the offline graph."""
return self.seed_task_graph_png


@dataclass(frozen=True)
class PreparedScene:
"""A source scene normalized for both planning and simulator loading."""

source_config_path: Path
scene_dir: Path
planner_objects: tuple[dict[str, Any], ...]
background: tuple[dict[str, Any], ...]
rigid_objects: tuple[dict[str, Any], ...]
articulations: tuple[dict[str, Any], ...]
uid_map: dict[str, str]
table_top_z: float | None
z_rotation_degrees: float
body_scale_policy: str
body_scale: tuple[float, float, float]
asset_hashes: dict[str, str]
asset_provenance: tuple[dict[str, Any], ...] = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"dual_franka": {
"aliases": ["franka", "panda", "dual_panda", "dual_franka_panda"],
"template": "dual_franka_robot.json",
"robot_family": "franka",
"tabletop_clearance": 0.05,
"arm_component_z": 0.4,
"arm_base_x": -1.45,
"gripper_open_state": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"gripper_close_state": [0.7, -0.7, 0.7, -0.7, -0.7, 0.7]
},
"dual_ur3": {
"aliases": ["ur3", "dual_ur3_dh_pgi", "dual_ur3_robotiq", "dual_ur3_robotiq_arg2f_140"],
"template": "dual_ur_robot.json",
"robot_family": "ur3",
"tabletop_clearance": 0.05,
"arm_component_z": 0.4,
"arm_base_x": -1.45,
"max_effort": 56.0,
"gripper_open_state": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"gripper_close_state": [0.7, -0.7, 0.7, -0.7, -0.7, 0.7]
},
"dual_ur5": {
"aliases": ["ur5", "dual_ur5_dh_pgi", "dual_ur5_robotiq", "dual_ur5_robotiq_arg2f_140"],
"template": "dual_ur_robot.json",
"robot_family": "ur5",
"tabletop_clearance": 0.05,
"arm_component_z": 0.4,
"arm_base_x": -1.45,
"max_effort": 10000.0,
"gripper_open_state": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"gripper_close_state": [0.7, -0.7, 0.7, -0.7, -0.7, 0.7]
},
"dual_ur10": {
"aliases": ["ur10", "dual_ur10_dh_pgi", "dual_ur10_robotiq", "dual_ur10_robotiq_arg2f_140"],
"template": "dual_ur_robot.json",
"robot_family": "ur10",
"tabletop_clearance": 0.05,
"arm_component_z": 0.3,
"arm_base_x": -1.1,
"max_effort": 330.0,
"gripper_open_state": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"gripper_close_state": [0.7, -0.7, 0.7, -0.7, -0.7, 0.7]
}
}
48 changes: 48 additions & 0 deletions embodichain/gen_sim/action_engine/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2021-2026 DexForce Technology Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------

"""Task-first generation and scene hand-off for Action Engine v2."""

from __future__ import annotations

from .assembly import GroundedTaskSpec
from .interpretation import (
GroundingCaller,
INSTRUCTION_INTENT_SCHEMA,
InstructionDraftResult,
InstructionCaller,
InstructionIntent,
ground_instruction_draft,
interpret_instruction_draft,
interpret_and_ground_task_spec,
validate_instruction_intent,
)
from .scene import SceneHandoff, validate_scene_handoff

__all__ = [
"GroundedTaskSpec",
"GroundingCaller",
"INSTRUCTION_INTENT_SCHEMA",
"InstructionDraftResult",
"InstructionCaller",
"InstructionIntent",
"SceneHandoff",
"ground_instruction_draft",
"interpret_instruction_draft",
"interpret_and_ground_task_spec",
"validate_instruction_intent",
"validate_scene_handoff",
]
Loading