Files
appRobotHoming/test/optimizeRobot.test.js
chk 92b2a7b97b X-Position
X-Position from Fotos. Kallibrierung
2026-05-10 13:31:39 +02:00

35 lines
1.6 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const { calculate, optimizeRobot } = require('../public/calculateAngles.cjs');
/* -------------------------
Tests
------------------------- */
describe('optimizeRobot.', () => {
test('berechnet X-Durchschnitt für Base / Arm1 / Joint1', async () => {
//const markersPath1 = path.resolve('./test/snapshots/snapshot_video0_1777958128576_two_cam.json');
const markersPath1 = path.resolve('./test/snapshots/snapshot_video0_1778406635059_two_cam.json');
//const markersPath2 = path.resolve('./test/snapshots/snapshot_video0_1777957783463_two_cam.json');
const markersPath2 = path.resolve('./test/snapshots/snapshot_video0_1778406621349_two_cam.json');
const markersPath3 = path.resolve('./test/snapshots/snapshot_video0_1778407153025_two_cam.json');
const markersPath4 = path.resolve('./test/snapshots/snapshot_video0_1778407171886_two_cam.json');
const robotPath = path.resolve('./public/robot.json');
const foundMarkers1 = JSON.parse(fs.readFileSync(markersPath1, 'utf8'));
const foundMarkers2 = JSON.parse(fs.readFileSync(markersPath2, 'utf8'));
const foundMarkers3 = JSON.parse(fs.readFileSync(markersPath3, 'utf8'));
const foundMarkers4 = JSON.parse(fs.readFileSync(markersPath4, 'utf8'));
const list=[foundMarkers1, foundMarkers2, foundMarkers3, foundMarkers4];
const jsonRobot = JSON.parse(fs.readFileSync(robotPath, 'utf8'));
const result = await optimizeRobot(list, jsonRobot);
//expect(result.status).toBe('ok');
//expect(result.result).toBeDefined();
});
});