Skip to main content

T-Rex Model

The Tyrannosaurus Rex is a large bipedal predator with a massive skull, powerful jaws, and vestigial forelimbs. It hunts by sprinting toward prey and delivering a bite.

Specifications

PropertyValue
Hip height~1.1m (simulated)
Total mass~80 kg (simulated, scaled)
Hinge joints25
Ball joints2 (shoulders, passive)
Actuators21
Observation dim83
Action dim21

Anatomy

The T-Rex model includes:

  • Torso - Forward-leaning body (~30 deg from horizontal) with ribcage and belly
  • Neck + Skull - Short muscular neck with massive elongated skull and brow ridges
  • Head - Bite contact geom for prey interaction
  • Legs - Powerful digitigrade hind limbs (hip pitch/roll, knee, ankle, 3 toe digits per leg)
  • Arms - Tiny vestigial forelimbs with 2-fingered hands (passive, not actuated)
  • Tail - 5-segment heavy counterbalance to skull (4 actuated segments)

Action Space (21 dims)

IndexActuatorType
0-2Neck pitch, neck yaw, head pitchPosition
3-9Right leg (hip pitch/roll, knee, ankle, toe d2/d3/d4)Position
10-16Left leg (hip pitch/roll, knee, ankle, toe d2/d3/d4)Position
17-20Tail (pitch 1, yaw 1, pitch 2, pitch 3)Position

Training Stages

  1. Balance - Stable bipedal stance
  2. Locomotion - Walk and run toward prey
  3. Hunting - Sprint and bite prey with jaws

Diagnostic Metrics (Stage 3)

After each training stage the eval command reports:

MetricDescription
mean_forward_velocityAverage forward speed (m/s)
gait_symmetryLeft/right stride symmetry ∈ [0, 1]
stride_frequencyStep frequency (Hz)
cost_of_transportEnergy efficiency (lower is better)
mean_pelvis_heightUpright stability (m)
mean_heading_alignmentcos θ toward prey ∈ [-1, 1]
success_rateFraction of steps with jaw-bite event
min_prey_distanceClosest approach to prey (m)

Training Results (PPO, 2026-03-18)

Full 3-stage curriculum training with seed 42, 4 parallel environments. Total training time: 13h 2m 32s.

StageDescriptionTimestepsBest Eval RewardFinal Eval RewardAvg Fwd VelAvg Ep LengthDuration
1 — BalanceStand and balance without falling6,000,0003008.66 +/- 7.622998.07 +/- 34.520.02 +/- 0.06 m/s999.5 steps (9.99s)3h 35m
2 — LocomotionForward walking/running8,000,0001936.01 +/- 13.121905.66 +/- 182.703.47 +/- 0.11 m/s984.6 steps (9.85s)5h 17m
3 — BiteSprint and bite prey with jaws8,000,0001294.28 +/- 67.191234.49 +/- 189.971.68 +/- 0.24 m/s175.9 steps (1.76s)4h 10m

Key observations:

  • Stage 1 achieves near-perfect episode length (999.5/1000 steps), indicating excellent balance stability
  • Stage 2 reaches 3.47 m/s forward velocity — strong locomotion performance
  • Stage 3 has short episodes (175.9 steps) because the T-Rex quickly sprints to prey and delivers a bite, ending the episode on success (96.7% success rate)

Training Videos

T-Rex PPO training progression across each curriculum stage.

STAGE 1

Balance

Stable bipedal stance

STAGE 2

Locomotion

Walk and run toward prey

STAGE 3

Hunting

Sprint and bite prey with jaws

Usage

cd environments/trex

# View the model
python scripts/view_model.py

# Train stage 1
python scripts/train_sb3.py train --stage 1 --timesteps 1000000