Overview
Concrete YAML configuration file templates for defining task environment parameters and training hyperparameters, with Cartpole as the reference example.
Description
Each new IsaacGymEnvs task requires two Hydra YAML files: a task config that defines the environment structure and physics settings, and a train config that defines the rl_games PPO training hyperparameters. This document provides complete templates for both files, annotated with explanations of each field.
Usage
Copy the templates below, adjust the parameters to match your task design specification, and place them in the correct directories: cfg/task/ for the task config and cfg/train/ for the training config.
Code Reference
Source Location
- Repository: NVIDIA-Omniverse/IsaacGymEnvs
- Task config: cfg/task/Cartpole.yaml (L1-45)
- Train config: cfg/train/CartpolePPO.yaml (L1-68)
- Top-level: cfg/config.yaml (L1-73)
Task Config Template
File: cfg/task/MyTask.yaml
# Task configuration for MyTask
# See IsaacGymEnvs cfg/task/Cartpole.yaml for reference
name: MyTask
physics_engine: ${..physics_engine} # Inherited from top-level config
env:
numEnvs: ${resolve_default:512,${...num_envs}}
numObservations: 4 # Must match task's observation vector dimension
numActions: 1 # Must match task's action vector dimension
envSpacing: 4.0 # Spacing between parallel environments (meters)
episodeLength: 500 # Maximum steps per episode
enableDebugVis: False # Enable debug visualization markers
# Task-specific parameters
resetDist: 3.0 # Distance threshold for cart reset
maxEffort: 400.0 # Maximum force applied by actions
# Clipping ranges (applied to observations before passing to policy)
clipObservations: 5.0
clipActions: 1.0
sim:
dt: 0.0166 # Physics timestep (1/60 second)
substeps: 2 # Physics substeps per control step
up_axis: "z" # Up axis (z for most tasks)
use_gpu_pipeline: ${eq:${...pipeline},"gpu"}
gravity:
- 0.0
- 0.0
- -9.81
physx:
num_threads: ${....num_threads}
solver_type: 1 # 0=PGS, 1=TGS
num_position_iterations: 4
num_velocity_iterations: 0
contact_offset: 0.02 # Distance at which contacts are detected
rest_offset: 0.001 # Distance at which contacts are resolved
bounce_threshold_velocity: 0.2
max_depenetration_velocity: 100.0
default_buffer_size_multiplier: 2.0
flex:
num_outer_iterations: 4
num_inner_iterations: 10
warm_start: 0.25
relaxation: 0.75
Cartpole Task Config Reference
File: cfg/task/Cartpole.yaml
# Reference: actual Cartpole task configuration
name: Cartpole
physics_engine: ${..physics_engine}
env:
numEnvs: ${resolve_default:512,${...num_envs}}
numObservations: 4
numActions: 1
envSpacing: 4.0
episodeLength: 500
enableDebugVis: False
resetDist: 3.0
maxEffort: 400.0
clipObservations: 5.0
clipActions: 1.0
sim:
dt: 0.0166
substeps: 2
up_axis: "z"
use_gpu_pipeline: ${eq:${...pipeline},"gpu"}
gravity:
- 0.0
- 0.0
- -9.81
physx:
num_threads: ${....num_threads}
solver_type: 1
num_position_iterations: 4
num_velocity_iterations: 0
contact_offset: 0.02
rest_offset: 0.001
bounce_threshold_velocity: 0.2
max_depenetration_velocity: 100.0
default_buffer_size_multiplier: 2.0
Train Config Template
File: cfg/train/MyTaskPPO.yaml
# Training configuration for MyTask using PPO via rl_games
# See IsaacGymEnvs cfg/train/CartpolePPO.yaml for reference
params:
seed: ${...seed}
algo:
name: a2c_continuous # rl_games algorithm name for continuous PPO
model:
name: continuous_a2c_logstd # Policy model with learned log-std
network:
name: actor_critic # Separate actor and critic networks
separate: False # False = shared backbone, True = separate networks
space:
continuous:
mu_activation: None # Output activation for mean (None = linear)
sigma_activation: None
mu_init:
name: default
sigma_init:
name: const_initializer
val: 0
fixed_sigma: True
mlp:
units: [32, 32] # Hidden layer sizes (small for Cartpole)
activation: elu # Activation function
initializer:
name: default
regularizer:
name: None
config:
name: ${resolve_default:MyTask,${....experiment}}
full_experiment_name: ${.name}
env_name: rlgpu # Must be "rlgpu" for IsaacGymEnvs
multi_gpu: ${....multi_gpu}
ppo: True
mixed_precision: False
normalize_input: True # Normalize observations
normalize_value: True # Normalize value function targets
value_bootstrap: True
num_actors: ${....task.env.numEnvs}
reward_shaper:
scale_value: 0.01 # Reward scaling factor
# PPO hyperparameters
gamma: 0.99 # Discount factor
tau: 0.95 # GAE lambda
learning_rate: 3e-4 # Adam learning rate
lr_schedule: adaptive # adaptive or linear
kl_threshold: 0.008 # KL threshold for adaptive LR
score_to_win: 20000 # Target score for early stopping
max_epochs: ${resolve_default:500,${....max_iterations}}
# Batch sizes
horizon_length: 16 # Steps per environment per update
minibatch_size: 8192 # Minibatch size for PPO updates
mini_epochs: 8 # PPO epochs per update
# PPO clip and regularization
clip_param: 0.2 # PPO clip range
entropy_coef: 0.0 # Entropy bonus coefficient
e_clip: 0.2 # Value function clip range
truncate_grads: True
grad_norm: 1.0 # Gradient norm clipping
Cartpole Train Config Reference
File: cfg/train/CartpolePPO.yaml
params:
seed: ${...seed}
algo:
name: a2c_continuous
model:
name: continuous_a2c_logstd
network:
name: actor_critic
separate: False
space:
continuous:
mu_activation: None
sigma_activation: None
mu_init:
name: default
sigma_init:
name: const_initializer
val: 0
fixed_sigma: True
mlp:
units: [32, 32]
activation: elu
initializer:
name: default
regularizer:
name: None
config:
name: ${resolve_default:Cartpole,${....experiment}}
full_experiment_name: ${.name}
env_name: rlgpu
ppo: True
mixed_precision: False
normalize_input: True
normalize_value: True
value_bootstrap: True
num_actors: ${....task.env.numEnvs}
reward_shaper:
scale_value: 0.01
gamma: 0.99
tau: 0.95
learning_rate: 3e-4
lr_schedule: adaptive
kl_threshold: 0.008
score_to_win: 20000
max_epochs: ${resolve_default:500,${....max_iterations}}
horizon_length: 16
minibatch_size: 8192
mini_epochs: 8
clip_param: 0.2
entropy_coef: 0.0
e_clip: 0.2
truncate_grads: True
grad_norm: 1.0
I/O Contract
Inputs
| Name |
Type |
Required |
Description
|
| Task design spec |
Document |
Yes |
Observation/action dimensions, episode length, reward parameters from design phase
|
| Training hyperparameters |
Values |
Yes |
Learning rate, network size, batch sizes, PPO settings
|
Outputs
| Name |
Type |
Description
|
| Task YAML |
cfg/task/MyTask.yaml |
Environment parameters composed into full config by Hydra
|
| Train YAML |
cfg/train/MyTaskPPO.yaml |
Training hyperparameters composed into full config by Hydra
|
Naming Convention
| File |
Naming Pattern |
Example
|
| Task config |
cfg/task/{TaskName}.yaml |
cfg/task/Cartpole.yaml
|
| Train config |
cfg/train/{TaskName}PPO.yaml |
cfg/train/CartpolePPO.yaml
|
| Top-level default |
train: ${task}PPO |
Automatically resolves CartpolePPO from task=Cartpole
|
Related Pages
Principle:Isaac_sim_IsaacGymEnvs_Task_Configuration_Files
Page Connections
Double-click a node to navigate. Hold to expand connections.