Umbau 12: Robot-Kinematics als extends RobotBase

This commit is contained in:
chk
2026-06-10 23:18:29 +02:00
parent 9274b2c52a
commit d906b094b1
11 changed files with 837 additions and 385 deletions

View File

@@ -1,6 +1,6 @@
const fs = require('fs');
const https = require('https');
const Robot = require('./robot/Robot');
const { createRobotFromEnv } = require('./robot/KinematicsFactory');
const GCode = require('./robot/GCode');
const TelnetSender = require('./robot/TelnetSenderGRBL');
@@ -43,7 +43,7 @@ function createApp(options = {}) {
fsModule = fs,
httpsModule = https,
processEnv = process.env,
RobotClass = Robot,
RobotClass = null,
GCodeModule = GCode,
TelnetSenderClass = TelnetSender,
initInputWSFn = initInputWS,
@@ -69,7 +69,13 @@ function createApp(options = {}) {
const httpsServer = httpsModule.createServer(httpsOptions);
const robot = new RobotClass(250, 264, 100);
// Kinematik wählen: explizit injizierte RobotClass (Tests) hat Vorrang,
// sonst per Umgebungsvariable (ROBOT_KINEMATICS / ROBOT_KINEMATICS_PARAMS).
// Die Armlängen der Standard-Hardware dienen als Default, wenn keine Params
// gesetzt sind — siehe doc/ToDo_12_InverseKinematikConfig_ROADMAP.md.
const robot = RobotClass
? new RobotClass(250, 264, 100)
: createRobotFromEnv(processEnv, { l1: 250, l2: 264, l3: 100 });
const sharedState = {
connectedClients: [],