Phase 1 abgeschlossen: Positionen werden erkannt.
Positionen aus den Merkern heraus erkennbar. Viele Bilder gleichzeitig verarbeitbar.
This commit is contained in:
@@ -11,7 +11,7 @@ const TEST_SETUP_FILE = path.join(TEST_PATH, 'data', '0_testSetup.json');
|
||||
const SCRIPT_FILE = path.join(PROJECT_PATH, 'programs', '1_detect_aruco_observations.py');
|
||||
const ROBOT_PATH = path.join(__dirname, 'data', 'robot', 'robot.json');
|
||||
const SCRIPT_FILE_2 = path.join(PROJECT_PATH, 'programs', '2_estimate_camera_pose_from_aruco_json.py');
|
||||
|
||||
const SCRIPT_FILE_3 = path.join(PROJECT_PATH, 'programs', '3_fuse_markers_world.py');
|
||||
|
||||
const cam = {
|
||||
id : 'cam1',
|
||||
@@ -19,7 +19,11 @@ const cam = {
|
||||
intrinsics: path.join(PROJECT_PATH, 'data', 'settings','callibration_cam0.npz')
|
||||
};
|
||||
|
||||
|
||||
const cam2 = {
|
||||
id : 'cam1',
|
||||
image: 'snapshot_video0_1779690911822.jpg',
|
||||
intrinsics: path.join(PROJECT_PATH, 'data', 'settings','callibration_cam0.npz')
|
||||
};
|
||||
|
||||
describe('Check if Python 2 runs', () => {
|
||||
|
||||
@@ -61,6 +65,61 @@ describe('Check if Python 2 runs', () => {
|
||||
|
||||
});
|
||||
|
||||
test('Second File Run of Python second script', () => {
|
||||
|
||||
|
||||
console.log('Intrinsics : ', cam.intrinsics);
|
||||
execFileSync(PYTHON_CMD, [
|
||||
SCRIPT_FILE,
|
||||
'-i', path.join(SOURCE_DIR, cam2.image),
|
||||
'-npz', cam.intrinsics,
|
||||
'-robot', ROBOT_PATH,
|
||||
'-cameraId', cam2.id
|
||||
|
||||
,
|
||||
'-outDir', TARGET_DIR
|
||||
], {
|
||||
stdio: 'inherit',
|
||||
cwd: SOURCE_DIR // <- wichtig
|
||||
});
|
||||
|
||||
|
||||
const resultFile = path.join(TARGET_DIR, 'snapshot_video0_1779690911822_aruco_detection.json');
|
||||
|
||||
if (!fs.existsSync(resultFile)) {
|
||||
throw new Error(`Erwartete Datei fehlt: ${resultFile}`);
|
||||
}
|
||||
|
||||
|
||||
console.log('Intrinsics : ', cam.intrinsics);
|
||||
execFileSync(PYTHON_CMD, [
|
||||
SCRIPT_FILE_2,
|
||||
'--detections' , resultFile,
|
||||
'--robots', ROBOT_PATH
|
||||
], {
|
||||
stdio: 'inherit',
|
||||
cwd: SOURCE_DIR // <- wichtig
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
test('Second File Run of Python second script', () => {
|
||||
|
||||
|
||||
console.log('Intrinsics : ', cam.intrinsics);
|
||||
execFileSync(PYTHON_CMD, [
|
||||
SCRIPT_FILE_3,
|
||||
'--json', path.join(TARGET_DIR, 'snapshot_video0_1779690911822_aruco_detection.camera_pose.json'),
|
||||
'--json', path.join(TARGET_DIR, 'snapshot_video1_1779690911822_aruco_detection.camera_pose.json'),
|
||||
'--robots', ROBOT_PATH
|
||||
], {
|
||||
stdio: 'inherit',
|
||||
cwd: SOURCE_DIR // <- wichtig
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
// ✅ Cleanup läuft IMMER nach jedem Test
|
||||
afterEach(() => {
|
||||
|
||||
20
test/data/screenShots/fused_markers.csv
Normal file
20
test/data/screenShots/fused_markers.csv
Normal file
@@ -0,0 +1,20 @@
|
||||
marker_id,x,y,z,num_cameras,spread_m,known_marker,mean_confidence,mean_weight
|
||||
219,0.43451087900435764,-0.2430617527365844,0.24864745186629233,2,0.049300733586341176,False,0.5277170316988301,0.009300142928461588
|
||||
200,0.2883150365803509,0.0027948039097262806,0.09467189774796789,2,0.033606991516837784,False,0.7555202975260764,0.06883103535083403
|
||||
210,0.002038147844813181,0.018380350725407422,-0.018394701031480637,2,0.006772066645204387,True,0.6723693051501728,0.0204532377982721
|
||||
215,0.21054334774487873,-0.0718736597935183,-0.02391368422209966,2,0.013509208968825837,True,0.7724894180619204,0.08402370302052731
|
||||
197,0.30386845803628715,-0.12692615651017353,0.06409248498248943,1,0.0,False,0.6986174216600093,0.14966530971529068
|
||||
218,0.43184321660132874,-0.1704819414678139,0.16367009746963013,2,0.03802223210213124,False,0.3413914136453039,0.010365470204791368
|
||||
229,0.3602436104705841,-0.11844379401765685,0.08440112143347289,2,0.032107134962667656,False,0.8405383706616931,0.06951698019008724
|
||||
243,0.3687471932606844,-0.14650136025597116,0.042188479232535214,1,0.0,False,0.65908988611209,0.10324035134123742
|
||||
211,0.2137591400767156,0.026959799238792163,-0.028605385312781718,2,0.010891850650024732,True,0.6444060145125223,0.050073587946979366
|
||||
198,0.35259204770580493,-0.030524117439818314,0.08694698191739618,2,0.02706837734419262,False,0.7253533793498493,0.058021822336083224
|
||||
201,0.24149429994177674,0.06896595765348834,0.09401141969091542,1,0.0,False,0.4573781640909966,0.04398530324515346
|
||||
204,0.27355941290220315,0.13289470613188933,0.1235983427523017,2,0.02985425204964259,False,0.5691140927436947,0.023331477027783525
|
||||
217,0.6516780631570386,0.043108222213155606,-0.050180784675989236,2,0.049194700206082534,True,0.5355335672966184,0.014438151705364624
|
||||
196,0.3889281825540628,-0.37463423301617327,0.2628466843421774,1,0.0,False,0.9637599331074872,0.012495067650793962
|
||||
180,0.42148181203795254,-0.3888496207938902,0.3076404324887513,1,0.0,False,0.6855326216817852,0.003758399623359111
|
||||
189,0.39699505778356714,-0.414056777239273,0.2548045860642588,1,0.0,False,0.5680798096818698,0.005206949324425661
|
||||
208,0.5002433623385828,-0.10538715198248683,-0.04743817619792867,1,0.0,True,0.7535707616050168,0.006307514070673037
|
||||
214,0.41191377730374135,-0.0008334112347655465,-0.03314121580279006,1,0.0,True,0.6847250665842876,0.005021652275542729
|
||||
226,0.4275023262853984,-0.13129556163502792,0.04582380048078871,1,0.0,False,0.10322993259729876,0.0003523077820839931
|
||||
|
Reference in New Issue
Block a user