# Copyright (c) 2024, MindRobot Project
# SPDX-License-Identifier: BSD-3-Clause
#
# Demo: Unitree H1 Humanoid Locomotion (Flat terrain)
# 直接复用 IsaacLab 官方的 H1 运动控制任务，注册为 Mindbot-Demo 前缀。
# 参考原始注册: Isaac-Velocity-Flat-H1-v0
#
# 运行指令 (查看):
#   python scripts/environments/random_agent.py \
#       --task Mindbot-Demo-Velocity-Flat-H1-v0 \
#       --num_envs 32
#
# 训练指令 (RSL-RL):
#   python scripts/reinforcement_learning/rsl_rl/train.py \
#       --task Mindbot-Demo-Velocity-Flat-H1-v0 \
#       --num_envs 4096 --headless

import gymnasium as gym

##
# Register Gym environments.
##

gym.register(
    id="Mindbot-Demo-Velocity-Flat-H1-v0",
    entry_point="isaaclab.envs:ManagerBasedRLEnv",
    disable_env_checker=True,
    kwargs={
        # 直接引用 isaaclab_tasks 中的原始 cfg
        "env_cfg_entry_point": (
            "isaaclab_tasks.manager_based.locomotion.velocity.config.h1"
            ".flat_env_cfg:H1FlatEnvCfg"
        ),
        "rsl_rl_cfg_entry_point": (
            "isaaclab_tasks.manager_based.locomotion.velocity.config.h1"
            ".agents.rsl_rl_ppo_cfg:H1FlatPPORunnerCfg"
        ),
    },
)

gym.register(
    id="Mindbot-Demo-Velocity-Rough-H1-v0",
    entry_point="isaaclab.envs:ManagerBasedRLEnv",
    disable_env_checker=True,
    kwargs={
        "env_cfg_entry_point": (
            "isaaclab_tasks.manager_based.locomotion.velocity.config.h1"
            ".rough_env_cfg:H1RoughEnvCfg"
        ),
        "rsl_rl_cfg_entry_point": (
            "isaaclab_tasks.manager_based.locomotion.velocity.config.h1"
            ".agents.rsl_rl_ppo_cfg:H1RoughPPORunnerCfg"
        ),
    },
)
