fc5ee4f2c6
Add declarative robot packages, shared simulation lifecycle and Microban ONNX/PD walking with independent head control. Unify comic UI and chase camera; default robot packages to a 4.5m arena with real collision walls. Include regression tests, asset provenance/licenses and verification evidence.
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
import { test, expect } from "@playwright/test";
|
|
test("mounted IMU gyro stays in site frame while projected gravity uses trunk frame", async ({
|
|
page,
|
|
}) => {
|
|
await page.goto("/");
|
|
await expect(
|
|
page.getByRole("button", { name: "Pause", exact: true }),
|
|
).toBeEnabled();
|
|
await page.getByLabel("Robot", { exact: true }).selectOption("microban");
|
|
await expect
|
|
.poll(() => page.evaluate(() => window.__store.getState().robotId))
|
|
.toBe("microban");
|
|
await expect(
|
|
page.getByRole("button", { name: "Pause", exact: true }),
|
|
).toBeEnabled();
|
|
const obs = await page.evaluate(async () => {
|
|
const r = window.rl;
|
|
await r.pause();
|
|
r.data.qpos.set([Math.cos(Math.PI / 8), 0, Math.sin(Math.PI / 8), 0], 3);
|
|
r.data.qvel.set([1, 2, 3], 3);
|
|
r.mujoco.mj_forward(r.model, r.data);
|
|
return Array.from(r.buildObs());
|
|
});
|
|
expect(obs.length).toBe(63);
|
|
for (const [i, value] of [2, -3, -1].entries())
|
|
expect(obs[i]).toBeCloseTo(value, 5);
|
|
expect(obs[3]).toBeCloseTo(Math.SQRT1_2, 5);
|
|
expect(obs[4]).toBeCloseTo(0, 5);
|
|
expect(obs[5]).toBeCloseTo(-Math.SQRT1_2, 5);
|
|
});
|