Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/MIUAV/vibe-coding-ros2 --skill rl-training명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | rl-training |
| description | Isaac Lab 强化学习训练技能 - RL 策略训练、奖励函数设计、环境配置 |
| argument-hint | Isaac Lab RL OR 强化学习训练 OR 策略训练 |
| user-invocable | true |
用于 Isaac Lab 中的强化学习训练
当需要以下帮助时使用此技能:
# 克隆仓库
git clone https://github.com/isaac-sim/IsaacLab.git
cd IsaacLab
# 创建符号链接到 Omniverse
./setup.sh
# 安装依赖
pip install -r requirements.txt
# 运行示例
python scripts/reinforcement_learning/rl_games/train.py --task=Cartpole
# tasks/my_task.py
from isaaclab.envs import ManagerBasedRLEnv
class MyTask(ManagerBasedRLEnv):
def __init__(self, cfg, sim_params, physics_engine, device, headless):
super().__init__(cfg, sim_params, physics_engine, device, headless)
def _reset_idx(self, env_ids):
# 重置环境
pass
def _compute_obs(self):
# 计算观察
pass
def _compute_reward(self):
# 计算奖励
pass
# 跟踪目标奖励
def tracking_reward():
return -torch.norm(robot_pos - target_pos)
# 关节限流奖励
def joint_limit_penalty():
return -torch.sum(torch.clamp(joint_pos - joint_limits, min=0))
# 能量惩罚
def energy_penalty():
return -torch.sum(torch.abs(joint_vel * joint_effort))
# 训练配置
agent:
name: rsl_rl
policy:
actor_hidden_dims: [256, 256, 256]
critic_hidden_dims: [256, 256, 256]
algorithm:
name: PPO
num_steps_per_env: 24
learning_rate: 0.0003
num_learning_epochs: 5
num_mini_batches: 4
clip_param: 0.2
gamma: 0.99
lam: 0.95
runner:
policy_class: ActorCritic
algorithm_class: RSL_RL
num_steps_per_env: 24
max_iterations: 1500
save_interval: 50
python scripts/reinforcement_learning/rl_games/train.py \
--task=MyRobotTask \
--headless \
--num_envs=2048
python scripts/reinforcement_learning/rl_games/play.py \
--task=MyRobotTask \
--num_envs=10 \
--checkpoint=outputs/model.pt
解决方案:调整学习率,降低批大小