烘箱和unitree

This commit is contained in:
2026-04-16 09:49:00 +08:00
parent 579cd5f8c1
commit 1281ca5209
7 changed files with 1000 additions and 37 deletions

View File

@@ -27,10 +27,27 @@ optional arguments:
# Standard library imports
import argparse
import contextlib
import os
import sys
import traceback
# Isaac Lab AppLauncher
from isaaclab.app import AppLauncher
# Ensure local workspace packages are importable before any mindbot imports.
# The repository contains the Python package under source/mindbot, while this
# script lives under scripts/tools. Without adding these paths early, Python may
# resolve to an older installed mindbot package that still uses the legacy G1
# tri-hand joint names (for example: left_hand_index_0_joint).
_REPO_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
_LOCAL_IMPORT_PATHS = (
os.path.join(_REPO_ROOT, "source", "mindbot"),
_REPO_ROOT,
)
for _path in reversed(_LOCAL_IMPORT_PATHS):
if _path not in sys.path:
sys.path.insert(0, _path)
# add argparse arguments
parser = argparse.ArgumentParser(description="Record demonstrations for Isaac Lab environments.")
parser.add_argument("--task", type=str, required=True, help="Name of the task.")
@@ -91,8 +108,6 @@ simulation_app = app_launcher.app
# Third-party imports
import logging
import os
import sys
import time
import gymnasium as gym
@@ -107,9 +122,13 @@ from isaaclab.devices.teleop_device_factory import create_teleop_device
import isaaclab_mimic.envs # noqa: F401
from isaaclab_mimic.ui.instruction_display import InstructionDisplay, show_subtask_instructions
# if args_cli.enable_pinocchio:
# import isaaclab_tasks.manager_based.locomanipulation.pick_place # noqa: F401
# import isaaclab_tasks.manager_based.manipulation.pick_place # noqa: F401
if args_cli.enable_pinocchio:
import isaaclab_tasks.manager_based.locomanipulation.pick_place # noqa: F401
import isaaclab_tasks.manager_based.manipulation.pick_place # noqa: F401
import mindbot.tasks.manager_based.il.locomanipulation.pick_place # noqa: F401
import mindbot.tasks.manager_based.il.manipulation.pick_place # noqa: F401
from collections.abc import Callable
@@ -118,11 +137,6 @@ from isaaclab.envs.mdp.recorders.recorders_cfg import ActionStateRecorderManager
from isaaclab.envs.ui import EmptyWindow
from isaaclab.managers import DatasetExportMode
# Add workspace root to sys.path so mindrobot_keyboard is importable as a package path.
# record_demos.py lives at scripts/tools/, workspace root is three levels up.
_ws_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
if _ws_root not in sys.path:
sys.path.insert(0, _ws_root)
from scripts.environments.teleoperation.mindrobot_keyboard import MindRobotCombinedKeyboard # noqa: E402
import isaaclab_tasks # noqa: F401
@@ -265,6 +279,7 @@ def create_environment(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg) -> gym.En
return env
except Exception as e:
logger.error(f"Failed to create environment: {e}")
traceback.print_exc()
exit(1)