Next Gen Dynamics

Spider bot reinforcement learning project

Scroll to explore
AI · Reinforcement Learning

Teaching a six-legged robot to walk, navigate and chase — learned in simulation.

Spider Bot AI trains a 24-DoF hexapod on NVIDIA's GPU physics simulator to cross procedurally generated rough terrain and carry out three behaviours — waypoint, patrol and chase — from one reinforcement-learning policy, then exports it to ONNX for sim-to-real deployment.

Role
Solo redesign & reimplementation from a teammate's initial code
Focus
Deep RL — recurrent multi-modal PPO
Stack
Isaac Lab · skrl PPO_RNN · PyTorch · Docker
Overview

Learning to walk where rules can't be hand-coded

A many-legged robot has to decide which foot to place where, and when, every single moment — and the rougher the ground, the faster that problem explodes. Locomotion like this is hard to script by hand, so letting the robot learn to walk through reinforcement learning has become the standard approach.

Spider Bot AI drops many hexapods at once onto procedurally generated terrain inside NVIDIA Isaac Lab (PhysX) and trains a walking policy with PPO. The result doesn't just walk: the same network routes to a destination, patrols unexplored ground, and chases an evading target, switching between modes on a signal.

Parallel hexapods training on procedural terrain
Core — RL Engineering

One recurrent policy that perceives, walks and plans

01

Recurrent multi-modal policy

A GRU-based PPO_RNN built on skrl. Four independent encoders — proprioception (MLP), a 64×64 heightmap, a 3-channel BEV, and a 33×33 nav grid (ResBlock CNNs) — fuse to 320-D, pass through a GRU (hidden 512) over 32-step sequences, then a shared trunk branches into a Gaussian policy head and a value head.

02

One policy, three modes

Waypoint, patrol and chase are handled by a single network rather than three. A one-hot mode input scales 18+ reward terms — task rewards (progress, reach, exploration, pursuit) and motion-quality rewards (torque, smoothness, foot air-time, fall penalties) — so the same weights produce different behaviour.

03

Geodesic progress reward

Progress is measured by wall-aware geodesic distance (BFS over the nav grid), not straight-line distance, so the robot routes around obstacles instead of pushing into walls. Asymmetric log shaping around a ~1.5 m/s target speed suppresses overspeeding and reversing.

04

Procedural terrain & exploration

Perlin-noise hills, random cube/sphere obstacles and terraced zones are generated procedurally, sampled for flat spawn points, and converted to USD meshes — with SHA-256 config hashing for deterministic, reproducible caching. In patrol, a decaying staleness map drives the robot toward long-unvisited ground.

05

Sim-to-real via ONNX

On export, the running-standardisation statistics are baked into the model and the GRU hidden state is exposed as explicit I/O, so raw sensor input drives single-step recurrent inference with no external normalisation — built for edge deployment.

SharedRecurrentModel — four multi-modal encoders fuse to 320-D, run through a GRU for temporal context, then a shared trunk branches into policy and value heads.
Proprioception~100DMLP
Heightmap1×64×64ResBlock CNN
BEV3×64×64ResBlock CNN
Nav grid1×33×33ResBlock CNN
Concat
320D fusion
GRU
in 320 · hidden 512
h(t-1) ↻ h(t) · 32-step sequences
Shared trunk
512 → 256 → 128
Policy head
24 joint targets · tanh
Value head
V(s)
Simulation & Environment

A robot, its senses and its world — built from scratch

Manager-based RL environment

Built on Isaac Lab's ManagerBased architecture, with action, command, observation, reward, termination and event logic split into modules — so new reward terms, sensors or behaviour modes drop in without breaking the rest.

Custom 24-DoF hexapod

A self-built URDF: 6 legs × 4 joints, each modelled as an implicit PD actuator with its own range and torque limits. The network outputs target joint positions (offset from a default pose, scale 0.75) rather than raw torque, at 60 Hz control over 120 Hz physics.

Multi-modal sensing

Overlapping contact sensors on all 8 feet, a 64×64 raycast height scanner, a 32-channel 360° LiDAR and a frame transformer combine proprioception with a read on the surrounding terrain.

Reproducibility & containerisation

TensorBoard logging, timestamped run outputs, Omniverse debug markers and debug plots track training, all packaged in Docker Compose for both single-GPU and multi-GPU runs.

Training

From parallel rollouts to a deployable policy

PPO_RNN training loop

Many environments roll out in parallel on PhysX, GAE estimates advantages, and a clipped PPO objective updates the recurrent policy. KL-adaptive learning rate and running standardisation keep it stable, torch.distributed (DDP/NCCL) scales it across GPUs, and the trained policy exports to ONNX for sim-to-real.

  1. Rollout · 32 steps
  2. Standardize obs & reward
  3. GAE λ=0.95
  4. PPO update · clip 0.2
  5. KL-adaptive LR
  6. ONNX export → deploy
Stack

What it's built on

Simulation
Isaac Lab 3.0Isaac Sim 6.0PhysX (GPU)Omniverse Kit
Reinforcement learning
skrl (custom PPO_RNN)PyTorchGRU policyGAEKL-adaptive LRRunningStandardScaler
Perception & environment
Multi-modal obsContact · raycast · LiDARBFS geodesic navProcedural terrain
Robot
24-DoF hexapod URDFImplicit PD actuatorsJoint-position control
Deploy & infra
ONNX (sim-to-real)torch.distributed DDPDocker ComposeTensorBoardPython 3.12

Redesigned and rebuilt end to end — robot model, simulation, reward design, recurrent policy and the training-to-deployment pipeline.