Files
appRobotHoming/public/calculateAnglesBrowser.js
chk ba2cc8f6ec calculateAngles
Versuch, es vom Browser aus zugänglich zu machen
2026-05-11 16:46:26 +02:00

21 lines
547 B
JavaScript

import cjs from './calculateAngles.js';
export const calculate = cjs.calculate;
export const optimizeRobot = cjs.optimizeRobot;
export async function fetchAndCalculate() {
const res = await fetch("/api/latest-snapshot");
console.log(res);
}
if (typeof window !== 'undefined') {
window.calculateAngles = window.calculateAngles || {};
window.calculateAngles.calculate = calculate;
window.calculateAngles.fetchAndCalculate = fetchAndCalculate;
// automatisch starten
fetchAndCalculate();
}
export { calculate, fetchAndCalculate };