Skip to content

Custom Environments

Canard trains any Isaac Lab gym environment. You provide a GitHub repo — Canard clones it onto the GPU worker at runtime.

Repository Structure

Your repo needs a standard Isaac Lab environment with gym.register():

my-robot-env/
├── my_robot/
│   ├── __init__.py          # gym.register() call
│   ├── my_robot_env.py      # Environment class
│   └── my_robot_env_cfg.py  # Environment config
├── scripts/
│   └── rsl_rl/
│       └── train.py         # Training entry point
└── setup.py or pyproject.toml

Environment Discovery

Canard scans your repo for gym.register() calls to find available environments:

# The API endpoint that discovers environments
POST /api/v1/environments/discover
{
  "code_url": "https://github.com/your-org/your-env",
  "code_ref": "main"
}

Example: Go2 Standing

The built-in Go2 standing environment:

# In __init__.py
import gymnasium as gym

gym.register(
    id="Template-Go2-Standing-Direct-v0",
    entry_point="go2_standing.go2_standing_env:Go2StandingEnv",
    kwargs={"cfg": "go2_standing.go2_standing_env_cfg:Go2StandingEnvCfg"},
)

Submitting with Custom Code

run = client.submit_training_run(
    name="custom-env-test",
    task_name="My-Custom-Robot-Direct-v0",  # Must match gym.register() id
    code_url="https://github.com/your-org/your-env",
    code_ref="main",  # Branch, tag, or commit hash
    num_envs=4096,
    max_iterations=5000,
)

Requirements

  • Your repo must be accessible to the worker (public, or with auth configured)
  • The task_name must exactly match a gym.register() id in your code
  • The environment must be compatible with Isaac Lab / Isaac Sim 4.2
  • Training uses RSL-RL by default

Reward Weights

Override reward function weights without modifying code:

run = client.submit_training_run(
    name="custom-rewards",
    task_name="Template-Go2-Standing-Direct-v0",
    code_url="https://github.com/canard-cloud/go2-standing-env",
    reward_weights={
        "joint_pos": 4.0,
        "foot_contact": 2.0,
        "orientation": 1.0,
        "height": 1.0,
    },
    num_envs=4096,
    max_iterations=5000,
)