### Setup Virtual Environment and Install Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/scripts/lerobot_conversion/README.md Create a virtual environment using uv, activate it, and install the project dependencies. This is the initial setup step before running the conversion. ```bash uv venv source .venv/bin/activate uv pip install -e . --verbose ``` -------------------------------- ### Verifying Environment Setup with ReplayPolicy Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/api-reference/replay_policy.md Initializes and runs the ReplayPolicy within a simulated environment to verify setup. This example demonstrates resetting the policy and environment, then iterating through steps to get actions and observe environment responses. ```python from gr00t.policy import ReplayPolicy policy = ReplayPolicy( dataset_path="demo_data/droid_sample", modality_configs=modality_configs, execution_horizon=16 ) env = MyRobotEnvironment() for episode in range(3): obs, info = env.reset() policy.reset() for step in range(100): try: action, policy_info = policy.get_action(obs) obs, reward, done, truncated, info = env.step(action) if done or truncated: break except Exception as e: print(f"Error at step {step}: {e}") break ``` -------------------------------- ### Setup SimplerEnv Simulation Environment Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/SimplerEnv/README.md Installs necessary packages and runs the setup script for the SimplerEnv. This is a one-time setup for each simulation benchmark. ```bash sudo apt update sudo apt install libegl1-mesa-dev libglu1-mesa bash gr00t/eval/sim/SimplerEnv/setup_SimplerEnv.sh ``` -------------------------------- ### Setup LIBERO Evaluation Simulation Environment Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/LIBERO/README.md Installs necessary packages and runs the setup script for the LIBERO evaluation simulation environment. ```bash sudo apt update sudo apt install libegl1-mesa-dev libglu1-mesa bash gr00t/eval/sim/LIBERO/setup_libero.sh ``` -------------------------------- ### Setup RoboCasa Evaluation Environment Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/robocasa/README.md Installs necessary packages and runs the RoboCasa setup script. This should be performed once per simulation benchmark. ```bash sudo apt update sudo apt install libegl1-mesa-dev libglu1-mesa bash gr00t/eval/sim/robocasa/setup_RoboCasa.sh ``` -------------------------------- ### Setup Evaluation Simulation Environment Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/robocasa-gr1-tabletop-tasks/README.md Installs necessary dependencies and sets up the simulation environment for evaluating the GR00T model on RoboCasa GR1 Tabletop Tasks. This setup is required once per benchmark. ```bash sudo apt update sudo apt install libegl1-mesa-dev libglu1-mesa bash gr00t/eval/sim/robocasa-gr1-tabletop-tasks/setup_RoboCasaGR1TabletopTasks.sh ``` -------------------------------- ### Start gr00t Server with ReplayPolicy Source: https://github.com/nvidia/isaac-gr00t/blob/main/getting_started/policy.md Use this command to start the gr00t server in replay mode, loading actions from a dataset. Ensure the execution horizon matches your environment's setup. ```bash uv run python gr00t/eval/run_gr00t_server.py \ --dataset-path /path/to/lerobot_dataset \ --embodiment-tag NEW_EMBODIMENT \ --host 0.0.0.0 \ --port 5555 \ --execution-horizon 8 ``` -------------------------------- ### Policy Wrapper Workflow Example Source: https://github.com/nvidia/isaac-gr00t/blob/main/getting_started/policy.md This example demonstrates the typical workflow for adapting a GR00T policy to a custom environment. It involves transforming observations, getting actions from the policy, and transforming actions back to the environment's format. ```python # In your environment loop env_obs = env.reset() # Environment-specific format # Transform to Policy API format policy_obs = transform_observation(env_obs) # Get action from policy policy_action, _ = policy.get_action(policy_obs) # Transform back to environment format env_action = transform_action(policy_action) # Execute in environment env_obs, reward, done, info = env.step(env_action) ``` -------------------------------- ### Setup Client Dependencies for Closed-Loop Evaluation Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/SO100/README.md Installs necessary client-side dependencies for closed-loop evaluation within the SO100 real robot environment. This involves activating a virtual environment and installing packages. ```bash cd gr00t/eval/real_robot/SO100 uv venv source .venv/bin/activate uv pip install -e . --verbose uv pip install --no-deps -e ../../../../ ``` -------------------------------- ### Install Thor Bare Metal Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/scripts/deployment/README.md One-time installation script for Thor bare metal setup, including NVPL libs, uv, Python dependencies, and torchcodec build. ```bash # One-time install (temporarily copies the Thor pyproject.toml and uv.lock to repo root, # installs NVPL libs, uv, Python deps, and builds torchcodec from source against the # system FFmpeg runtime) bash scripts/deployment/thor/install_deps.sh ``` -------------------------------- ### Install uv Dependency Manager Source: https://github.com/nvidia/isaac-gr00t/blob/main/README.md Install uv, a fast and reproducible dependency manager, using the provided installation script. ```sh curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Validate LIBERO Environment with ReplayPolicy Source: https://github.com/nvidia/isaac-gr00t/blob/main/getting_started/policy.md This example demonstrates starting the replay server and running a policy rollout to validate a simulation environment. It helps identify issues with environment resets, observation preprocessing, or action space mismatches. ```bash # Terminal 1: Start the replay server uv run python gr00t/eval/run_gr00t_server.py \ --dataset-path \ --embodiment-tag \ --action-horizon 8 \ --use-sim-policy-wrapper # Terminal 2: Run evaluation with the replay policy uv run python gr00t/eval/rollout_policy.py \ --n-episodes 1 \ --policy-client-host 127.0.0.1 \ --policy-client-port 5555 \ --max-episode-steps 720 \ --env-name / \ --n-action-steps 8 \ --n-envs 1 ``` -------------------------------- ### Install GR00T Client Source: https://github.com/nvidia/isaac-gr00t/blob/main/getting_started/policy.md Installs the local GR00T client code using pip. This is the minimal installation required for most deployment environments. ```bash uv pip install -e . --verbose --no-deps ``` -------------------------------- ### Install Isaac GR00T with uv Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/README.md Clone the repository with submodules, install uv, sync dependencies for Python 3.10, and verify the GR00T installation. ```bash git clone --recurse-submodules https://github.com/NVIDIA/Isaac-GR00T cd Isaac-GR00T curl -LsSf https://astral.sh/uv/install.sh | sh uv sync --python 3.10 uv run python -c "import gr00t; print('GR00T installed successfully')" ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/AGENTS.md Installs the project in development mode with all optional dependencies included. Uses uv for package management. ```bash # Install (dev mode with all extras) uv sync --all-extras ``` -------------------------------- ### Synchronize UV Environment and Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/scripts/deployment/README.md Installs GPU dependencies like flash-attn, onnx, and tensorrt. This command is used for dGPU local environment setup. ```bash uv sync ``` -------------------------------- ### Training Dataloading Optimization Example Source: https://github.com/nvidia/isaac-gr00t/blob/main/getting_started/policy.md Provides an example of command-line arguments for optimizing dataloading speed versus memory usage during model training. Adjust numbers to manage memory. ```bash uv run python gr00t/experiment/launch_finetune.py \ .... \ --num-shards-per-epoch 100 \ --dataloader-num-workers 2 --shard-size 512 \ ``` -------------------------------- ### Install FFmpeg for Video Backend Source: https://github.com/nvidia/isaac-gr00t/blob/main/README.md Install FFmpeg, which is required by torchcodec, the only supported video backend for GR00T. ```sh sudo apt-get update && sudo apt-get install -y ffmpeg ``` -------------------------------- ### Example Usage of BasePolicy.get_action Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/api-reference/base_policy.md Demonstrates how to implement and use a custom policy inheriting from `BasePolicy`. This example shows setting up validation methods and computing an action. ```python from gr00t.policy import BasePolicy class MyPolicy(BasePolicy): def check_observation(self, obs): assert "state" in obs assert isinstance(obs["state"], dict) def check_action(self, action): assert "joint_positions" in action def _get_action(self, observation, options=None): # Compute action from observation action = {"joint_positions": [0.0] * 7} info = {"status": "success"} return action, info def reset(self, options=None): return {} policy = MyPolicy(strict=True) obs = {"state": {"x": 1.0, "y": 2.0}} action, info = policy.get_action(obs) ``` -------------------------------- ### Initialize and Use Policy Client Source: https://github.com/nvidia/isaac-gr00t/blob/main/README.md Demonstrates how to initialize a PolicyClient and interact with the environment to get actions. Assumes a running policy server. ```python from gr00t.policy.server_client import PolicyClient policy = PolicyClient(host="localhost", port=5555) env = YourEnvironment() obs, info = env.reset() action, info = policy.get_action(obs) obs, reward, done, truncated, info = env.step(action) ``` -------------------------------- ### Install Dependencies for Orin Bare Metal Source: https://github.com/nvidia/isaac-gr00t/blob/main/scripts/deployment/README.md Installs dependencies for bare-metal deployment on Orin. This is a one-time setup script that configures the Python environment and builds necessary components against JetPack's FFmpeg. ```bash bash scripts/deployment/orin/install_deps.sh ``` -------------------------------- ### Execute Finetuning Script Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/robocasa/README.md Launches the finetuning process using the specified dataset path and embodiment tag. Configure GPU count, training steps, batch size, and save frequency as needed. ```bash NUM_GPUS=8 MAX_STEPS=60000 GLOBAL_BATCH_SIZE=512 SAVE_STEPS=2000 uv run bash examples/finetune.sh \ --base-model-path nvidia/GR00T-N1.7-3B \ --dataset-path "$DATASET_PATH" \ --embodiment-tag ROBOCASA_PANDA_OMRON \ --output-dir /tmp/robocasa_finetune ``` -------------------------------- ### Example Modality Configurations Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/types.md Illustrates how to configure ModalityConfig for video, state, and action modalities. Shows temporal sampling, key selection, and embedding options. ```python from gr00t.data.types import ModalityConfig, ActionConfig, ActionRepresentation, ActionType, ActionFormat # Video modality: 2-frame stack of 2 cameras video_config = ModalityConfig( delta_indices=[0, 1], modality_keys=["front_cam", "rear_cam"] ) # State modality: current and previous states state_config = ModalityConfig( delta_indices=[0, 1], modality_keys=["joint_positions", "joint_velocities"], sin_cos_embedding_keys=["joint_positions"], # Angles use sin/cos mean_std_embedding_keys=["joint_velocities"] ) # Action modality: 16-step horizon with two action types action_config = ModalityConfig( delta_indices=list(range(16)), modality_keys=["eef_actions", "gripper_action"], action_configs=[ ActionConfig( rep=ActionRepresentation.RELATIVE, type=ActionType.EEF, format=ActionFormat.XYZ_ROT6D, state_key="eef_pose" ), ActionConfig( rep=ActionRepresentation.RELATIVE, type=ActionType.NON_EEF, format=ActionFormat.DEFAULT, state_key=None ), ] ) ``` -------------------------------- ### Start GR00T Policy Server Source: https://github.com/nvidia/isaac-gr00t/blob/main/getting_started/policy.md Launch the GR00T policy server using `run_gr00t_server.py`. Ensure you provide the correct embodiment tag, model path, and device. The server listens on the specified host and port. ```bash uv run python gr00t/eval/run_gr00t_server.py \ --embodiment-tag NEW_EMBODIMENT \ --model-path /path/to/your/checkpoint \ --device cuda:0 \ --host 0.0.0.0 \ --port 5555 ``` -------------------------------- ### Run PyTorch Inference Source: https://github.com/nvidia/isaac-gr00t/blob/main/scripts/deployment/README.md Execute inference on demo trajectories using PyTorch. This is a quick start option that does not require TensorRT setup. ```bash uv run python scripts/deployment/standalone_inference_script.py \ --model-path checkpoints/GR00T-N1.7-LIBERO/libero_10 \ --dataset-path demo_data/libero_demo \ --embodiment-tag LIBERO_PANDA \ --traj-ids 0 1 2 3 4 \ --inference-mode pytorch \ --action-horizon 8 ``` -------------------------------- ### Use Context Managers for Server-Client Connections Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/errors.md This example demonstrates how to use a context manager to establish and manage a connection to a PolicyClient. It includes connection verification and ensures cleanup. ```python from contextlib import contextmanager @contextmanager def client_connection(host: str, port: int, timeout_ms: int = 30000): from gr00t.policy.server_client import PolicyClient client = PolicyClient(host=host, port=port, timeout_ms=timeout_ms) try: # Verify connection client.ping() yield client except Exception as e: print(f"Connection failed: {e}") raise finally: # Cleanup if needed pass # Usage with client_connection("gpu_server", 5555) as client: action, info = client.get_action(observation) ``` -------------------------------- ### Setup LIBERO Environment and Run TRT Evaluation Source: https://github.com/nvidia/isaac-gr00t/blob/main/scripts/deployment/README.md One-time setup for LIBERO, activation of its virtual environment, and running TRT full pipeline evaluation for a specific kitchen scene task. ```bash # One-time LIBERO setup (~10 min) bash gr00t/eval/sim/LIBERO/setup_libero.sh # Activate LIBERO venv and install additional deps source gr00t/eval/sim/LIBERO/libero_uv/.venv/bin/activate uv pip install diffusers transformers accelerate safetensors torchcodec # TRT full pipeline evaluation python gr00t/eval/rollout_policy.py \ --model-path checkpoints/GR00T-N1.7-LIBERO/libero_10 \ --env-name "libero_sim/KITCHEN_SCENE3_turn_on_the_stove_and_put_the_moka_pot_on_it" \ --n-episodes 20 --n-envs 1 --max-episode-steps 504 \ --trt-engine-path ./gr00t_trt_deployment/engines \ --trt-mode n17_full_pipeline ``` -------------------------------- ### Download DROID Demo Data Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/DROID/README.md Installs the jsonlines dependency and downloads a small sample of DROID data for testing purposes. This is a one-time setup step. ```bash uv pip install jsonlines # one-time dependency python scripts/download_droid_sample.py ``` -------------------------------- ### Example Usage of Embodiment Tag Groups Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/types.md Demonstrates how to check which category an embodiment tag belongs to, guiding the selection of appropriate models or finetuning procedures. ```python from gr00t.data.embodiment_tags import PRETRAIN_TAGS, POSTTRAIN_TAGS, FINETUNE_ONLY_TAGS if tag in PRETRAIN_TAGS: print("This embodiment works with the base model") elif tag in POSTTRAIN_TAGS: print("This embodiment requires a finetuned checkpoint") elif tag in FINETUNE_ONLY_TAGS: print("This embodiment is for custom finetuning") ``` -------------------------------- ### Initialize and Run PolicyServer Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/api-reference/policy_server_client.md Instantiate a Gr00tPolicy and then create and run a PolicyServer to serve it. The server binds to all network interfaces on port 5555. ```python from gr00t.policy import Gr00tPolicy, PolicyServer # Create policy policy = Gr00tPolicy( embodiment_tag="OXE_DROID_RELATIVE_EEF_RELATIVE_JOINT", model_path="nvidia/GR00T-N1.7-3B", device="cuda:0" ) # Create and run server server = PolicyServer( policy=policy, host="0.0.0.0", port=5555 ) server.run() ``` -------------------------------- ### Create and Sync Environment with uv Source: https://github.com/nvidia/isaac-gr00t/blob/main/README.md Create a Python 3.10 environment using uv and install GR00T and its dependencies. ```sh uv sync --python 3.10 ``` -------------------------------- ### Get Action with Gr00t Policy Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/api-reference/gr00t_policy.md Compute and return the next action based on the current observation. This example demonstrates the expected observation structure and how to call the get_action method. ```python import numpy as np # Observation structure (batch size 1) observation = { "video": { "front_cam": np.random.randint(0, 256, (1, 2, 480, 640, 3), dtype=np.uint8), }, "state": { "joint_positions": np.random.randn(1, 2, 7).astype(np.float32), }, "language": { "task": [["pick up the cube"]], # (batch, temporal) } } action, info = policy.get_action(observation) print(f"Predicted action shape: {action['joint_velocities'].shape}") print(f"Action values: {action['joint_velocities']}") ``` -------------------------------- ### Install lerobot with Git LFS Skip Source: https://github.com/nvidia/isaac-gr00t/blob/main/scripts/lerobot_conversion/README.md Install the lerobot package from a specific Git commit while skipping Git LFS smudge. This is a prerequisite if you encounter issues with Git LFS during installation. ```bash GIT_LFS_SKIP_SMUDGE=1 uv pip install "lerobot @ git+https://github.com/huggingface/lerobot.git@c75455a6de5c818fa1bb69fb2d92423e86c70475" ``` -------------------------------- ### Install GR00T Robot Control Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/DROID/README.md Installs necessary Python packages for the GR00T robot control script in the robot's environment. Ensure the DROID package is installed first. ```bash pip install tyro pydantic numpy==1.26.4 ``` -------------------------------- ### Verify GR00T Installation Source: https://github.com/nvidia/isaac-gr00t/blob/main/README.md Run a Python command to verify that GR00T has been installed successfully. ```sh uv run python -c "import gr00t; print('GR00T installed successfully')" ``` -------------------------------- ### Sample meta/episodes.jsonl Content Source: https://github.com/nvidia/isaac-gr00t/blob/main/getting_started/data_preparation.md An example of the 'episodes.jsonl' file, which contains information about each episode, including its tasks and length. ```json {"episode_index": 0, "tasks": [...], "length": 416} {"episode_index": 1, "tasks": [...], "length": 470} ``` -------------------------------- ### Install Thor Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/AGENTS.md Installs CUDA 13.0 dependencies for Jetson Thor platforms. ```bash # Jetson Thor: CUDA 13.0 — install via scripts/deployment/thor/install_deps.sh ``` -------------------------------- ### Alternative: Install GR00T with pip Source: https://github.com/nvidia/isaac-gr00t/blob/main/README.md Install GR00T using pip within a Python 3.10 virtual environment if you prefer not to use uv. Note that GPU dependencies might need manual installation. ```sh python3.10 -m venv .venv && source .venv/bin/activate pip install -e . ``` -------------------------------- ### Install DGX Spark Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/CLAUDE.md Installs CUDA 13.0 dependencies for DGX Spark platforms. ```bash # DGX Spark: CUDA 13.0 — install via `scripts/deployment/spark/install_deps.sh` ``` -------------------------------- ### Run LIBERO Goal Finetune Launcher Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/LIBERO/README.md Launches the shared finetune script for the LIBERO goal dataset with specified parameters for GPUs, steps, batch size, and save steps. ```bash NUM_GPUS=8 MAX_STEPS=20000 GLOBAL_BATCH_SIZE=640 SAVE_STEPS=1000 uv run bash examples/finetune.sh \ --base-model-path nvidia/GR00T-N1.7-3B \ --dataset-path examples/LIBERO/libero_goal_no_noops_1.0.0_lerobot/ \ --embodiment-tag LIBERO_PANDA \ --output-dir /tmp/libero_goal ``` -------------------------------- ### Initialize Policy Client Source: https://github.com/nvidia/isaac-gr00t/blob/main/getting_started/policy.md Connect to a running GR00T policy server from your client code using `PolicyClient`. Configure the host, port, and timeout. It's recommended to set `strict=False` on the client if the server handles validation. ```python from gr00t.policy.server_client import PolicyClient # Connect to the policy server policy = PolicyClient( host="localhost", # or IP address of your GPU server port=5555, timeout_ms=15000, # 15 second timeout for inference strict=False, # leave the validation to the server ) # Verify connection if not policy.ping(): raise RuntimeError("Cannot connect to policy server!") # Use just like a regular policy observation = get_observation() # Your observation in Policy API format action, info = policy.get_action(observation) ``` -------------------------------- ### Install Jetson Thor Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/CLAUDE.md Installs CUDA 13.0 dependencies for Jetson Thor platforms. ```bash # Jetson Thor: CUDA 13.0 — install via `scripts/deployment/thor/install_deps.sh` ``` -------------------------------- ### Instantiate PolicyClient Source: https://github.com/nvidia/isaac-gr00t/blob/main/_autodocs/api-reference/policy_server_client.md Create an instance of the PolicyClient. Configure the server host, port, and request timeout. An API token can be provided for authentication if enabled on the server. ```python from gr00t.policy.server_client import PolicyClient client = PolicyClient( host="192.168.1.100", port=5555, timeout_ms=30000 ) ``` -------------------------------- ### Install Jetson Orin Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/CLAUDE.md Installs CUDA 12.6 dependencies for Jetson Orin platforms. ```bash # Jetson Orin: CUDA 12.6 — install via `scripts/deployment/orin/install_deps.sh` ``` -------------------------------- ### Build Project Package Source: https://github.com/nvidia/isaac-gr00t/blob/main/AGENTS.md Builds the project's distributable package using uv. ```bash # Build package uv build ``` -------------------------------- ### Install dGPU Dependencies Source: https://github.com/nvidia/isaac-gr00t/blob/main/AGENTS.md Installs CUDA 12.8 dependencies for dGPU platforms (H100, A100, RTX). ```bash # dGPU (H100, A100, RTX): CUDA 12.8 — install via scripts/deployment/dgpu/install_deps.sh ``` -------------------------------- ### Finetune Simpler Env Google Robot Source: https://github.com/nvidia/isaac-gr00t/blob/main/examples/SimplerEnv/README.md Launches the finetuning script for the Google robot using the fractal dataset. Requires NUM_GPUS, MAX_STEPS, GLOBAL_BATCH_SIZE, and SAVE_STEPS to be set. ```bash NUM_GPUS=8 MAX_STEPS=20000 GLOBAL_BATCH_SIZE=1024 SAVE_STEPS=1000 uv run bash examples/finetune.sh \ --base-model-path nvidia/GR00T-N1.7-3B \ --dataset-path examples/SimplerEnv/fractal20220817_data_lerobot/ \ --embodiment-tag SIMPLER_ENV_GOOGLE \ --output-dir /tmp/fractal_finetune \ --state-dropout-prob 0.5 ```