Overview
Theparc_4_phys_record.py script uses the trained tracking controller to record physically simulated versions of the generated kinematic motions. It runs the tracker on all reference motions in parallel and saves only the successfully tracked motions back to the dataset.
Purpose
This is Stage 4 (final stage) of the PARC pipeline. It:- Loads the trained tracking controller from Stage 3
- Loads the kinematic motions generated in Stage 2
- Simulates tracking all motions in parallel
- Records only successfully tracked motions (no early terminations)
- Saves physically plausible motions for the next iteration
- Handles difficult-to-track motions with retry logic at different start times
Usage
Basic Command
Default Configuration
Command-Line Arguments
| Argument | Required | Description |
|---|---|---|
--config | No | Path to the physics recording configuration YAML file |
Key Configuration Parameters
Model and Environment Files
model_file: Path to the trained tracker model (from Stage 3)env_file: Path to environment configuration YAMLagent_file: Path to agent configuration YAML
Dataset Configuration
create_dataset_config: Path to dataset creation configdataset_file: Path to motion dataset YAML (automatically set from create_dataset_config)
Execution Settings
device: Device for running inference (e.g., “cuda:0”, “cpu”)output_dir: Directory for saving recorded motions and logs
Recording Process
Dataset Preparation
- Loads dataset creation config
- Creates unified dataset YAML from generated motion folders
- Counts total number of motions in dataset
- Sets number of parallel environments equal to number of motions
Parallel Recording
The script:- Spawns one environment per motion
- Runs all tracking attempts in parallel
- Records the physically simulated motion trajectory
- Saves only motions without early termination (successful tracks)
Retry Logic for Difficult Motions
For motions that fail to track completely:- The script re-attempts tracking starting at later time offsets
- If the full motion can’t be tracked, tries starting at 25%, 50%, etc.
- Saves partial successful segments if full motion tracking fails
- Gives up after a maximum number of retries
Example Configuration
Output Files
After recording, the following files and directories are created:Recorded Motion Files
Each.pkl file in recorded_motions/ contains:
- Physically simulated motion frames
- Root positions, rotations, joint rotations
- Contact states
- Associated terrain data
- Metadata about the recording
Environment Configuration
The script automatically updates the environment config with:- Motion dataset file path
- Terrain save path
- Output directory for recorded motions
- Recording mode flag
Dataset Creation Config
The dataset creation config typically specifies:Success Criteria
A motion is considered successfully recorded if:- The tracking controller completes the full motion without early termination
- No catastrophic failures (falling, excessive penetration, etc.)
- Contact patterns match the reference motion reasonably well
Usage in Next Iteration
The recorded motions from this stage become part of the training dataset for the next PARC iteration:Implementation Details
Key Files
scripts/run_tracker.py: Contains the main recording logic (mode=“record”)parc/motion_tracker/envs/ig_parkour/dm_env.py: Environment with recording supportparc/util/create_dataset.py: Dataset creation utilities
Recording vs Training Mode
The script runsrun_tracker.py with --mode record which:
- Disables learning (no policy updates)
- Records state trajectories
- Saves successful episodes to disk
- Uses deterministic policy evaluation
Hardware Requirements
- NVIDIA GPU with CUDA support
- Isaac Gym installation
- Sufficient GPU memory for parallel environments (scales with number of motions)
Typical Recording Times
Recording time depends on:- Number of generated motions (~500 motions typical)
- Motion lengths
- GPU performance
- Typically takes 10-60 minutes for a full batch
Usage in PARC Pipeline
Quality Filtering
The automatic filtering (by only saving non-terminated episodes) ensures:- Physics plausibility of all recorded motions
- Natural motion dynamics
- Contact consistency with terrains
- No catastrophic failures in the dataset
Location
scripts/parc_4_phys_record.py