TwoFootBot-isaaclab/tests/test_registration.py

42 lines
1.5 KiB
Python
Raw Permalink Normal View History

2026-10-28 04:04:05 +00:00
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for the project's task registrations."""
2026-11-09 08:34:58 +00:00
import importlib
2026-10-28 04:04:05 +00:00
import gymnasium as gym
import TwoFootBot_isaaclab.tasks # noqa: F401
def test_task_registrations():
2026-11-02 05:56:55 +00:00
"""The migrated MLP tasks must expose their environment and agent configurations."""
for task_id, env_cfg, agent_cfg in (
(
"Template-Twofootbot-mlp-v0",
"TwoFootBot_isaaclab.tasks.manager_based.twofootbot.Lv0:TwofootbotdemoEnvCfg",
"TwoFootBot_isaaclab.tasks.manager_based.twofootbot.agents.rsl_rl_ppo_cfg:PPORunnerCfg",
),
(
"Template-Twofootbot-mlp-v1",
"TwoFootBot_isaaclab.tasks.manager_based.twofootbot.Lv1:Lv1Cfg",
"TwoFootBot_isaaclab.tasks.manager_based.twofootbot.agents.rsl_rl_ppo_cfg:PPORunnerCfg",
),
2026-11-09 08:34:58 +00:00
(
"Template-Twofootbot-mlp-v2",
"TwoFootBot_isaaclab.tasks.manager_based.twofootbot.Lv2:Lv2Cfg",
"TwoFootBot_isaaclab.tasks.manager_based.twofootbot.agents.rsl_rl_ppo_cfg:PPORunnerCfg",
),
2026-11-02 05:56:55 +00:00
):
spec = gym.spec(task_id)
assert spec.kwargs["env_cfg_entry_point"] == env_cfg
assert spec.kwargs["rsl_rl_cfg_entry_point"] == agent_cfg
2026-11-09 08:34:58 +00:00
lv2_module = importlib.import_module(
"TwoFootBot_isaaclab.tasks.manager_based.twofootbot.Lv2"
)
assert hasattr(lv2_module, "Lv2Cfg")