Files
2026-07-26 00:40:06 +08:00

64 lines
2.0 KiB
Markdown

# Go1 Adaptation
The `go1` branch adds the `RobotLab-Go1-v0` IsaacLab task and a matching
MuJoCo deployment. It uses the complete Unitree Go1 URDF/MuJoCo model.
## Interface
- Policy joint order: `FR, FL, RR, RL`, with hip, thigh, calf for each leg.
- Single-frame observation: 45 values in this order:
body angular velocity (3), projected gravity (3), velocity command (3),
relative joint position (12), joint velocity (12), previous action (12).
- Actor history: 10 frames, or 450 values.
- Action: 12 normalized joint-position offsets, scaled by `0.25 rad` and added
to the default joint angles.
- Policy frequency: 50 Hz (`0.005 s` physics step and decimation 4).
- PD gains: `Kp=28`, `Kd=0.7`; torque is limited to `33.5 Nm`.
- Training randomizes actuator delay over 0-4 physics steps (0-20 ms). The
MuJoCo config defaults to zero extra delay because its delay setting is in
20 ms policy steps.
## Train
Install the editable packages as described in the main README, then run:
```bash
cd go2_rl_robotlab
python scripts/rsl_rl/train.py \
--task=RobotLab-Go1-v0 \
--num_envs=4096 \
--max_iterations=5000 \
--headless
```
## Play And Export
`play.py` exports both `policy.pt` and `policy.onnx` into the checkpoint run's
`exported/` directory before starting the rollout.
```bash
python scripts/rsl_rl/play.py \
--task=RobotLab-Go1-v0 \
--num_envs=64 \
--checkpoint=/absolute/path/to/model_5000.pt
```
## MuJoCo
Place the exported TorchScript file at
`deploy/pre_train/go1/policy.pt`, or edit `policy_path` in
`deploy/deploy_mujoco/configs/go1.yaml`. Then run:
```bash
MUJOCO_GL=glfw python deploy/deploy_mujoco/deploy_go1.py
```
Set `xml_path` in `go1.yaml` to select `flat.xml`, `stairs.xml`, `boxes.xml`,
or `stairs_and_slope.xml`.
## Actuator Assumption
The Go1 asset publishes a `33.5 Nm` effort limit but does not include measured
torque-speed knee points. The training actuator therefore uses the known effort
limit with delayed PD control instead of reusing the Go2-HV torque-speed curve.