SuperHQ Motion experiment: locomotion and action checkpoints, runtime, clips, evaluation
6adbbb1 verified Download src/ground-pose.js from superhq-ai/motion: direct link, hf CLI and curl.
- Browser
- Download file 846 Bytes
-
https://huggingface.co/superhq-ai/motion/resolve/main/src/ground-pose.js
- Command line
-
hf download hf://superhq-ai/motion/src/ground-pose.js
-
curl -L -o ground-pose.js https://huggingface.co/superhq-ai/motion/resolve/main/src/ground-pose.js
846 Bytes
| /** Bounded display-side floor guard. Does not change the model or host root. */ | |
| export function groundPose(positions,{feet=[21,22,26,27],maxLift=.05,clearance=0}={}) { | |
| if(!Array.isArray(positions)||!positions.length||positions.some(p=>!Array.isArray(p)||p.length!==3||!p.every(Number.isFinite))|| | |
| !Array.isArray(feet)||!feet.length||feet.some(j=>!Number.isInteger(j)||j<0||j>=positions.length)|| | |
| !Number.isFinite(maxLift)||maxLift<0||maxLift>.1||!Number.isFinite(clearance)||clearance<0||clearance>.02)throw Error('Invalid bounded floor guard input.'); | |
| const rawMinimum=Math.min(...feet.map(j=>positions[j][1])),requested=Math.max(0,clearance-rawMinimum),lift=Math.min(maxLift,requested); | |
| return {positions:positions.map(p=>[p[0],p[1]+lift,p[2]]),lift,rawMinimum, | |
| minimum:rawMinimum+lift,saturated:requested>maxLift+1e-8}; | |
| } | |