E1 · The maximum step
5 minRun the five steps and note the highest one the policy clears.
Done when: python3 kit/terreno.py --degraus 0.02 0.03 0.04 0.06 0.10; echo "saída: $?" → degraus vencidos: 2/5 and saída: 0.
Lesson 8 · 16 min
Nobody trains stair walking on day one: the terrain and the requested speed grow as the policy succeeds. In this lesson you measure how far up the ladder the ready-made policy goes, read how mjlab and unitree_rl_lab level up, and write your own training plan in a file that a script checks.
Start the lesson
Goal: measure the ready-made policy's maximum step, read the curriculum rules, and write a training plan with 5 fields that conferir_plano.py approves.
Click each level. Each robot moves up or down a level on its own, based on how far it walked.
Rules read from the code: mjlab mdp/curriculums.py (commit 8bb2bc9) and unitree_rl_lab velocity_env_cfg.py (commit 4960b84).
terreno.py uses MjSpec to build a platform of height h 1.5 m from the robot and tells it to walk for 8 s at 0.5 m/s. Passed = it did not fall and the pelvis ended up on top (x > 2.5 m).
F=${FTH:-$HOME/fth}; cd $F/locomocao && . $F/.venv/bin/activate
python3 kit/terreno.py --degraus 0.02 0.03 0.04 0.06 0.10; echo "saída: $?"política: unitree_rl_lab velocity v0 (ONNX) · comando vx = 0.5 m/s · 8 s · degrau a 1.5 m degrau 2 cm: passou (pelve em x = 3.4 m) degrau 3 cm: passou (pelve em x = 4.1 m) degrau 4 cm: caiu (pelve em x = 2.0 m) degrau 6 cm: caiu (pelve em x = 2.0 m) degrau 10 cm: caiu (pelve em x = 2.2 m) degraus vencidos: 2/5 saída: 0
2 and 3 cm pass; from 4 cm up, the robot falls at x ≈ 2 m, before getting onto the platform. The steps that fail are the next levels of a curriculum: that is what you retrain for.
Two curricula run together in real training. Click each one.
In mjlab, at the end of each episode, a robot that walked more than 80% of the requested distance moves up one terrain level; one that walked less than 50% moves down. Each robot has its own level: in the same training run, some are on flat ground and others on pebbles.
In unitree_rl_lab, the requested velocity starts at ±0.1 m/s. When velocity tracking passes 80% of the maximum, the range opens 0.1 m/s on each side, up to the limit of −0.5 to 1.0 m/s.
The push is not part of the curriculum in these two repositories: ±0.5 m/s in x and y, every 5 s in unitree_rl_lab; in mjlab, every 1 to 3 s, with ±0.4 m/s in z as well and roll, pitch, and yaw rotations.
Before spending GPU: which robot, what command range, which terms and weights, what terrain levels, and which test approves. It is the file you write now.
Copy the template to ~/fth/treino, replace each [bracket] with your value, and check it. The kit example shows a plan that passes.
# Plano de treino de locomoção Robô: [qual humanoide e qual arquivo, ex.: Unitree G1 29 GDL, unitree_g1/scene.xml do Menagerie 62ab00f] Comando: [faixa de velocidade, ex.: vx de -0.5 a 1.0 m/s, vy de -0.3 a 0.3 m/s, giro de -0.2 a 0.2 rad/s] Recompensa: [termos e pesos, ex.: track_linear_velocity 2.0, upright 1.0, action_rate_l2 -0.1] Currículo: [níveis em ordem, separados por →, ex.: plano → degrau de 5 cm → rampa → pedriscos] Avaliação: [critério de aprovação com número, ex.: 18/20 episódios de pé com empurrão de 1.0 m/s]
F=${FTH:-$HOME/fth}; cd $F/locomocao && . $F/.venv/bin/activate
[ -f $F/treino/plano-treino.md ] || cp kit/plano-treino-modelo.md $F/treino/plano-treino.md
python3 kit/conferir_plano.py $F/treino/plano-treino.md; echo "saída: $?"F=${FTH:-$HOME/fth}; cd $F/locomocao && . $F/.venv/bin/activate
python3 kit/conferir_plano.py kit/exemplos/plano-treino.md; echo "saída: $?"FALTA Robô: não preenchido FALTA Comando: não preenchido FALTA Recompensa: não preenchido FALTA Currículo: não preenchido FALTA Avaliação: não preenchido campos ok: 0/5 incompleto saída: 1
With the template still full of [brackets], all five fields are missing and the script exits with 1. Rules: command with a number and m/s, reward with 2 or more kit terms, curriculum with 3 or more levels separated by →, evaluation with a numeric criterion (X/N or %).
campos ok: 5/5 ok saída: 0
The kit example (kit/exemplos/plano-treino.md) uses the command ranges from unitree_rl_lab and the 18/20 criterion from lesson 7.
Four deliverables. Click each one to see the "done when".
The ready-made policy walking in MuJoCo and the joint PD measured, with the policy's gains understood.
The four pieces of the environment and the reward measured term by term, with the weight that turns the game around.
A PPO training run on CPU with a checkpoint and the curves read, with the reward hacking recognized.
The policy evaluated with a push and a step, and your training plan checked.
Four deliverables in sequence. Course 2 takes this course's policy from the simulator to the floor.
Order matters: the lesson 8 plan uses the reward from lesson 4 and the test from lesson 7.
Pick a start date and how much time you have per week. The plan lists the practices for each lesson.
Measure the limit and plan the next training run.
Run the five steps and note the highest one the policy clears.
Done when: python3 kit/terreno.py --degraus 0.02 0.03 0.04 0.06 0.10; echo "saída: $?" → degraus vencidos: 2/5 and saída: 0.
Copy the template and check it before filling it in, so you see the script fail it.
Done when: the output shows campos ok: 0/5, incompleto and saída: 1.
Fill in ~/fth/treino/plano-treino.md with your choices: a curriculum that starts on flat ground and goes through the steps that failed in E1, and an evaluation with a number.
Done when: python3 kit/conferir_plano.py $F/treino/plano-treino.md; echo "saída: $?" → campos ok: 5/5, ok and saída: 0.
The explanation appears after your answer.
Question 1 of 3
In mjlab's terrain curriculum, when does a robot move up a level?skill
Question 2 of 3
The finished policy clears 3 cm steps and falls at 4 cm. In a training plan, what do you do with that?
Question 3 of 3
Why does unitree_rl_lab start by asking for only ±0.1 m/s?
Choose an option. The explanation appears after you try.