G1 Patrol

Unitree B2-W: Learned Navigation among People for a Wheeled Quadruped

Mehmet Kerem Turkcan

Figure 1. Rollouts of the released policy (lidar and two depth cameras) with the safety shield in the loop, as on the robot, at a speed cap of 1.0 m/s: the digital twin of the deployment lab, indoor tiles and New York street tiles. Indoor tiles are drawn without ceilings and lit from above. The robot is drawn with Unitree's B2-W model on the simulated body's pose (legs posed for its height, wheels turning with its motion); pedestrians are rendered with animated character models; their motion and the policy's inputs are those of the simulation.

Abstract

We train a navigation policy for Unitree's B2-W wheeled quadruped that drives the robot through its built-in sport-mode controller, for deployment in an indoor lab. The robot is simulated as a kinematic body that follows velocity commands through a model of the controller whose latency, response, gain, deadband and drift are drawn per episode. Training uses the New York street tiles and pedestrians of G1 Patrol, six procedural indoor tile types and sections of the deployment lab modeled on photographs. The policy follows a planned route: it observes the points of the route 1 m and 2.5 m ahead, odometry, gravity, its previous command, the speed cap and a height map built from a RoboSense RS-Helios-5515 lidar and two Intel RealSense D435i depth cameras; a privileged teacher is trained with PPO and distilled into this onboard student. On the robot, a safety shield that is independent of the policy scales each command down until the robot could stop before anything its sensors see comes within a margin, and makes it crawl near anything that moves. On a mixture in which half the tiles are sections of the lab, the student reaches 72.5% of its goals (81.0% in the lab hall); with the shield, 57.3% (72.6%), with structure contacts in 1.9% of the episodes and contacts in which the robot moved towards a pedestrian in 0.6%. With its sensors seeing posed human characters instead of the capsules of training, the student moves into pedestrians in 9.6% of the episodes without the shield (6.9% with capsules); fine-tuned with such characters, in 6.5%, and with the shield below 0.5% in either case. The software that runs on the robot (SLAM, a route planner, the policy and the shield, started by one ROS 2 launch file) has been run against a simulated B2-W over ROS 2; it has not yet run on the robot.

Method

Robot model. The B2-W is driven through Unitree's sport-mode controller, which takes body velocity commands (forward −0.8 to 1.5 m/s, lateral ±0.3 m/s, yaw rate ±1.2 rad/s) and moves the legs and wheels. It is simulated as a kinematic body with a 1.12 × 0.58 m footprint that follows the commands through a model of the controller drawn per episode: latency of 40–160 ms, a first-order response, acceleration bounds, gain errors, a deadband, yaw drift and velocity noise. The same model can be fitted to logs of the robot (scripts/b2w/sysid.py) and evaluated in simulation. Each episode caps the planar speed at a value between 0.4 and 1.5 m/s that the policy observes; on the robot it is the operator's speed setting. The body stands 0.55–0.72 m above the ground, drawn per episode, and the height maps take their heights from the floor as the robot measures it in each scan, so that nothing has to be measured on the robot.

Tiles and routes. Besides the six New York street scenario types of G1 Patrol, the robot trains on six procedural indoor tile types (labs, corridors, doorways between rooms, offices, warehouses with a loading dock, lobbies with a stairwell) and on sections of the lab hall it is deployed in, modeled on photographs: the painted main aisle, drawer-cabinet benches, test machines, open racks, bins, carts, pallets and a workstation area with office chairs and camera tripods. A second lab serves for evaluation: a civil engineering laboratory furnished with 64 NVIDIA SimReady props (CC BY 4.0), with a test row of load frames, environmental chambers, actuator columns and workbenches along the aisle, a strong floor with beams on supports, loaded pallets, carts, hand trucks, scaffolds, ladders and tripods, and shelving along the walls; a prop is kept out of as its bounding box, while the lidar and the depth cameras see its mesh (decimated to at most 3,000 triangles). Every route is planned on the tile's clearance map for the robot's width, keeping up to 0.6 m from structures where this costs little detour; in 30% of the episodes the plan ignores small structures (chairs, carts, bins), which the robot then avoids by itself, as with a map that is out of date. The policy observes the points of the route 1.0 m and 2.5 m ahead of its position on the route and is rewarded for progress along it. With the goal as its only target, the teacher reached 59% of the goals and failed where routes detour through doors; with route waypoints it reached 63%, with gains on every indoor tile type.

Policies. A privileged teacher (pedestrian states, distances to structures in 72 directions, a terrain scan) is trained with PPO for 3,000 iterations on the street and indoor tiles and fine-tuned for 1,000 iterations on a mixture in which half the tiles are sections of the lab hall. Two students are distilled from it with DAgger for 1,500 iterations: the released student observes a height map built from the lidar and the front and rear depth cameras, a fallback student the lidar alone. Rewards slow the robot near structures (the fastest point of the footprint, which turning swings, at most 0.3 m/s within 0.1 m of a structure and 1.5 m/s from 1 m), keep it within 0.2 m of its route and penalize contacts.

Table 1. Inputs of the released policy (10 Hz). The height map has 3 × 80 × 80 cells of 0.1 m (8 × 8 m around the robot, aligned with its heading).
InputSizeSource on the robotNoise in training
Route waypoints4the planned route 1 m and 2.5 m ahead, heading frame±0.05 m; bias ±0.1 m per episode
Velocity3odometry of the sport-mode state±0.05; bias ±0.03 per episode
Projected gravity3IMU±0.03
Previous command3the policy's last output–
Speed cap1the operator's max_speed–
Height map3 × 80 × 80RS-Helios-5515 lidar and two D435i depth cameras: accumulated over 8 s, current scan, previous scanodometry drift, dropout, a camera failing in 5% of the episodes, floor height error ±3 cm

Environments

Figure 2. Scenes of the training mixture and the civil engineering lab (evaluation only), one episode each in real time, with the shield in the loop; the camera can be switched and the clip enlarged.

Safety shield

On the robot every command passes a shield that is independent of the policy (g1_patrol.shield). A command is admissible if the robot, executing it for 0.35 s (sensing, policy and controller latency) and then braking at 0.8 m/s², with 12% more speed than commanded and 8 cm of drift per meter, can stop before any sensor return comes within a margin of its footprint: 0.10 m to obstacles, 0.25 m to drops, and to tall things (people, but also machines and walls) from 0.10 m below 0.25 m/s to 0.45 m above 0.75 m/s, so that doors are passed slowly and people with room. Commands are scaled down by bisection until they are admissible. Returns where the current scan sees something tall and the previous one saw floor are assumed to be people walking at the robot at 1.4 m/s while it closes in on them, and the closing speed towards tall things is held to 0.25 m/s within 0.8 m. Moving away is never limited. A guard around the shield replaces a command that is nearly blocked by a safe one near it (the translation or the turn alone, a nudge sideways, a step back) when the robot is at rest, and backs the robot off after 1.5 s of being blocked.

The shield alone lowers structure contacts from 10.3% to 3.2% of the episodes and contacts in which the robot moves into a pedestrian from 6.9% to 0.7%; the guard raises the goal rate from 73.5% to 76.0% and lowers structure contacts to 2.2% (Table 2). The alternatives must be checked against the same returns as the command, those closest to the footprint: checked against the returns closest to the robot's center, a wall alongside crowded out what lay ahead, and structure contacts rose to 9%. Crawling lowers contacts in which the robot moves into a pedestrian to 0.6% and costs 19 points of goal rate: the returns that appear where the previous scan saw floor come also from static things coming into view as the robot moves. The robot crawls by default and drives without crawling where nobody walks (crawl:=false). Most remaining pedestrian contacts are pedestrians walking into a robot that stands or crawls (22.6% of the episodes); a quarter of the simulated pedestrians are distracted and give way only at the last moment.

Table 2. What the shield and the guard around it do (fused student, setup of Table 5).
Fused studentEpisodesGoal (%)Goal, lab hall (%)Structure contact (%)Pedestrian contact, robot moving (%)Pedestrian walked into stopped robot (%)Time-out (%)Speed (m/s)Shield stops (% of steps)
No shield18,83172.581.010.36.98.21.80.52–
Shield alone: commands scaled down13,01773.584.33.20.714.87.70.3711.0
+ alternatives from rest, backing off (crawl:=false)13,05676.086.72.20.814.36.70.3814.1
+ crawling near what moved (released default)9,33957.372.61.90.622.617.60.2412.4

On the robot

One ROS 2 launch file starts everything on the robot's Jetson Orin NX: the lidar driver and the depth cameras, odometry from the sport-mode state, SLAM (slam_toolbox) on a slice of the scan, a route planner on the map being built (unknown space counts as free, so the robot can be sent into unmapped rooms), the policy (ONNX) with its height map and the shield, and the output to the sport-mode controller as Move(vx, vy, wz). The policy drives only while a dead-man button on the remote is held; moving a stick takes over, and missing scans, odometry or remote messages stop the robot. An install script sets up ROS 2 Foxy or Humble, Unitree's messages and the lidar driver; the deployment guide goes from the network to a shadow run (the policy drives nothing while the robot is steered by hand and the map is built) to the first drive.

Table 3. The stack on the robot.
StageRateInputOutput
SLAM (slam_toolbox)per scanlidar slice 0.15–1.0 m above the floor, odometrymap, map → odom
Route plannerper goal, then 1 Hzmap, robot pose, goalroute (nav_msgs/Path)
Height map10 Hzlidar scan, latest depth frames, odometry, floor measured in the scan3 × 80 × 80 map
Policy10 Hzroute waypoints, velocity, gravity, previous command, speed cap, height map(vx, vy, wz), capped at the speed setting
Shield and guard10 Hzreturns, map cells, measured velocitythe admissible command
Sport-mode controllerUnitreeMove(vx, vy, wz) while the dead-man button is heldlegs and wheels

Before the robot, the whole stack was run against a simulated B2-W on ROS 2 (deploy/b2w/sim) that speaks like the robot, ray-casts the lidar's point cloud in a section of the lab hall with walking people and moves with the controller model of the training (Table 4).

Table 4. The whole stack (the launch file with SLAM, planner, policy, shield and dead-man button) against a simulated B2-W on ROS 2 that speaks like the robot and moves with the controller model of the training: a section of the lab hall, the map unknown at the start, speed cap 0.6 m/s. Contacts are simulated people walking into the robot; in none of them did the robot move towards the person.
ScenarioResultTimeContacts (robot moving)
12 m along the aisle, around a pallet, chairs and a tripodreached42.5 s0 (0)
through a 1.0 m door into unmapped spacereached52.5 s0 (0)
starting facing away from the goalreached35.5 s0 (0)
a person walking the aisle at the robot (ignoring it)reached44.0 s0 (0)
two people crossing back and forth (ignoring it)reached97.5 s5 (0)
dead-man button not helddid not move–0 (0)

Results

All evaluations are on the lab mixture (half the tiles sections of the lab hall, half street and indoor tiles), with robots spread over all ten difficulty levels and up to 20 pedestrians, a quarter of whom are distracted and give way only at the last moment; 1,024 robots for 300 s. With the shield, the speed cap is applied before the shield, as on the robot.

Table 5. Policies on the lab mixture (half lab-hall tiles), all difficulty levels, 1,024 robots for 300 s. Speed caps are drawn per episode from 0.4–1.5 m/s unless fixed. A pedestrian contact counts as the robot's if it was moving towards the person at more than 0.1 m/s. Shield stops: steps at which the shield set the command to zero because the robot's own momentum already breached.
PolicyEpisodesGoal (%)Goal, lab hall (%)Structure contact (%)Pedestrian contact, robot moving (%)Pedestrian walked into stopped robot (%)Time-out (%)Speed (m/s)Shield stops (% of steps)
Lab teacher (privileged)18,23969.479.416.68.53.21.80.53–
Fused student (lidar + 2 depth cameras)18,83172.581.010.36.98.21.80.52–
Lidar-only student18,59173.182.410.57.07.41.80.52–
Fused, shield9,33957.372.61.90.622.617.60.2412.4
Fused, shield, cap 0.5 m/s8,61053.969.81.80.723.919.70.2111.3
Fused, shield, cap 1.0 m/s9,60958.773.61.80.422.216.80.2412.9

The fused student reaches 72.5% of its goals and the lidar-only student 73.1%, against 69.4% for the privileged teacher, which touches structures and pedestrians more often. A built-in controller with more latency, a slower response, weaker tracking or more drift, failed depth cameras and a degraded lidar map each change the goal rate by at most 1.3 points (Table 6). With the shield at the speed caps of the first trials (0.5 and 1.0 m/s) the goal rate is 53.9% and 58.7%, and with a laggy controller 57.1%.

Table 6. The fused student with a built-in controller worse than in training and with degraded sensing (setup of Table 5).
Fused studentEpisodesGoal (%)Goal, lab hall (%)Structure contact (%)Pedestrian contact, robot moving (%)Pedestrian walked into stopped robot (%)Time-out (%)Speed (m/s)Shield stops (% of steps)
Nominal controller18,83172.581.010.36.98.21.80.52–
Laggy controller (0.16-0.25 s latency)18,56972.881.59.87.37.91.90.53–
Sluggish controller (2x response time, 1/2 acceleration)18,70171.581.010.18.38.11.70.51–
Weak controller (70-80 % of the command)15,57971.381.79.16.210.42.70.42–
Drifting controller (2x yaw drift)18,68672.981.510.16.98.11.80.52–
Depth cameras failed19,20871.380.610.67.58.91.60.53–
Degraded lidar map (20 % dropout, odometry drift)18,75872.881.89.77.48.01.80.52–
Laggy controller, shield9,30257.172.41.70.822.717.70.2313.1

Civil engineering lab

On a mixture in which the civil engineering lab takes half of the lab tiles, the released policy reaches 71.9% of its goals there without the shield and 57.0% with it, against 80.7% and 71.4% in the lab hall (Table 7). The lab leaves passages of at least 0.9 m between the things on its strong floor, so that no route passes within 0.5 m of a structure, but it is denser: the privileged teacher, which observes the distances to structures, touched structures in 15% of the easiest civil-lab episodes (10% in the lab hall). Fine-tuning the lab teacher and distilling the students on that mixture did not improve on it: 72.2% of the goals in the civil engineering lab against 71.9% without the shield and 58.7% against 57.0% with it, while the goals in the lab hall fell to 66.9% with the shield (from 71.4%) and contacts in which the robot moved towards a pedestrian rose to 10.2% of the episodes without it (from 8.8%). The released policy is the one trained without the civil engineering lab.

Table 7. The civil engineering lab: policies on a mixture in which it takes half the lab tiles (setup of Table 5 otherwise); the released policy was trained without it.
PolicyEpisodesGoal (%)Goal, lab hall (%)Goal, civil eng. lab (%)Structure contact, civil eng. lab (%)Pedestrian contact, robot moving (%)Time-out (%)
Released fused student18,86468.380.771.913.78.81.9
Released fused student, shield8,96651.471.457.05.70.619.3
Lab teacher trained with the civil lab (privileged)19,00764.476.669.220.311.31.4
Fused student trained with the civil lab19,28767.679.872.214.110.21.6
Fused student trained with the civil lab, shield8,94050.266.958.75.70.720.2

Camera student

A third student also sees the image of the B2-W's front color camera: the class token and 2 × 3 average-pooled patch tokens of a frozen DINOv2-small (2,688 features) of a 336 × 196 image, besides the fused student's inputs. During training the camera sees the environment drawn as in the demo: textured tiles, indoor rooms under ceilings with light fixtures, furniture drawn as NVIDIA SimReady props with tools, monitors and boxes on the work surfaces and boards and signs on the walls, and every pedestrian as an animated character that only its own robot's camera sees; the geometry the robot and its sensors interact with is unchanged. Started from the released fused student with the camera's weights at zero and distilled for 300 iterations with 256 robots, it reaches 70.5% of its goals in simulation (57.1% with the shield), against 73.5% (60.3%) for the fused student (Table 8): the camera does not improve the policy in simulation.

Its encoder is aligned to realistic images after training rather than trained on them. The 61 indoor replays of the camera environment (of 126) are transferred to realistic video by NVIDIA Cosmos 3 Nano, the render's edges and depth keeping the layout and a text prompt per replay drawing wall paint, floor, ceiling, light, equipment colors and clothing at random (Figure 3). The last 8 of the encoder's 12 blocks are fine-tuned so that a transferred frame gives the patch tokens the original encoder gives its render; the policy is unchanged. On held-out replays, realistic images change the policy's actions by 0.110 with the original encoder and by 0.058 with the aligned one, against 0.141 without the camera's information; the cosine similarity of the camera features to the renders' rises from 0.77 to 0.93. The camera student is not part of the robot stack yet.

Renders of the camera environment and their realistic transfers
Figure 3. Left: the camera student's view of its training environment (replays). Right: their transfers by Cosmos 3 Nano, one look per replay; used only after training, to align the encoder.
Table 8. The camera student and the fused student it started from, on the lab mixture (the camera student with its camera seeing the environment drawn as in the demo), 256 robots for 150 s.
PolicyEpisodesGoal (%)Goal, lab hall (%)Structure contact (%)Pedestrian contact, robot moving (%)Pedestrian walked into stopped robot (%)Time-out (%)Speed (m/s)Shield stops (% of steps)
Fused student (released)2,32273.582.09.66.68.61.70.53–
Camera student (+ front color camera)2,18370.581.612.17.07.72.20.48–
Fused student, shield1,10860.375.63.00.522.114.20.2411.8
Camera student, shield1,11257.174.12.21.224.415.10.2312.6

Pedestrians as people

In training, the lidar and the depth cameras see every pedestrian as a capsule 0.5 m wide and 1.7 m tall. To measure what this costs, they can see Isaac Sim characters in walking poses instead: the 10 characters of the demo, each skinned at 8 phases of its gait cycle and decimated to 4,000 triangles, facing the way the pedestrian walks; contacts remain those of the capsule. A person gives the lidar about two thirds of a capsule's returns at every distance (Figure 4). Seeing people, the released fused student moves into pedestrians in 9.6% of the episodes instead of 6.9% and the lidar-only student in 9.9% instead of 7.0%, at goal rates 0.8 and 2.2 points lower (Table 9); the shield, which acts on the sensor returns themselves, keeps these contacts at 0.4% (0.6% with capsules).

Fine-tuning the students for 500 iterations with their sensors seeing people (DAgger with the same teacher, from the released students) closes the gap: with people, the fused student moves into pedestrians in 6.5% of the episodes and reaches 73.4% of its goals, and 6.3% and 73.7% with 20 poses not used in the fine-tuning, while with capsules it does as before (7.0%, 72.5%). The lidar-only student improves alike with people (7.7%, 72.7%), at a small cost with capsules (7.4%, 72.3%). Structure contacts rise with fewer pedestrian contacts (10.1% against 9.3% for the fused student with people), since an episode ends at its first contact. With the shield, the fine-tuned and the released fused students do equally well (0.3% and 0.4% with people). With the characters walking, each pedestrian's pose following its own gait, the results hold: 9.1% for the released fused student and 6.4% for the fine-tuned one (6.5% with two characters held out of the draw), 9.5% and 7.7% for the lidar-only students. Evaluations with people are not bitwise reproducible, unlike those with capsules: over four runs, contacts in which the robot moved varied by at most 0.6 points and goal rates by at most 0.8.

Lidar returns from a capsule and from posed characters, by distance and at 3 m
Figure 4. A pedestrian as the simulated lidar (RS-Helios-5515) sees it. Left: returns per scan from a capsule, as in training, and from the posed characters (mean and 10–90% range over 80 posed meshes and 8 headings), by distance. Right: returns at 3 m on a capsule and on three characters seen from the side.
Table 9. Pedestrians as the lidar and the depth cameras see them: capsules, as in training, or Isaac Sim characters in walking poses (people: the 20 of 80 posed meshes used in the fine-tuning; other poses: 20 others). Released students and students fine-tuned with people for 500 iterations; pedestrian contacts with the robot moving towards the person, all contacts with the capsules (setup of Table 5).
PolicyGoal, capsules (%)Goal, people (%)Goal, other poses (%)Pedestrian contact, capsules (%)Pedestrian contact, people (%)Pedestrian contact, other poses (%)Structure contact, people (%)
Fused, released72.571.771.56.99.69.29.3
Fused, fine-tuned72.573.473.77.06.56.310.1
Lidar-only, released73.170.971.27.09.99.710.0
Lidar-only, fine-tuned72.372.772.57.47.77.611.0
Fused + shield, released57.356.2–0.60.4–1.8
Fused + shield, fine-tuned57.055.7–0.40.3–1.7

Limitations