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)

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