X-Position
X-Position from Fotos. Kallibrierung
This commit is contained in:
34
test/optimizeRobot.test.js
Normal file
34
test/optimizeRobot.test.js
Normal file
@@ -0,0 +1,34 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user