Callibration
This commit is contained in:
123
doc/Callibration_ROADMAP.md
Normal file
123
doc/Callibration_ROADMAP.md
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
# Calibration Roadmap – appRobotHoming
|
||||||
|
|
||||||
|
> Stand: 2026-06-10
|
||||||
|
> Ziel: Vor dem Homing muss das System einmalig (oder nach mechanischen Änderungen) kalibriert werden.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Übersicht der Kalibrierungsschritte
|
||||||
|
|
||||||
|
```
|
||||||
|
[1] Camera NPZ → [2] Board → [3] Robot X-Axis → [4] Arm1 / Arm2
|
||||||
|
```
|
||||||
|
|
||||||
|
Jede Stufe baut auf der vorherigen auf. Die Ergebnisse werden als Dateien gespeichert und vom Homing-Prozess geladen.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [1] Camera NPZ – Kamerakalibrierung
|
||||||
|
|
||||||
|
**Ziel:** Intrinsische Kameraparameter (Brennweite, Verzerrungskoeffizienten, Kameramatrix) für jede Kamera ermitteln und als `.npz`-Datei speichern.
|
||||||
|
|
||||||
|
**Vorgehen (noch offen):**
|
||||||
|
- Schachbrettmuster / ChArUco-Board aus verschiedenen Winkeln fotografieren
|
||||||
|
- OpenCV `calibrateCamera()` ausführen
|
||||||
|
- Ergebnis speichern: `cam0_calib.npz`, `cam1_calib.npz`, `cam2_calib.npz`
|
||||||
|
|
||||||
|
**Aktionen auf der Seite (geplant):**
|
||||||
|
- Fotos aufnehmen (mehrere Posen)
|
||||||
|
- Kalibrierung berechnen
|
||||||
|
- `.npz`-Datei herunterladen / auf Server speichern
|
||||||
|
- Reprojektionsfehler anzeigen
|
||||||
|
|
||||||
|
**Offene Fragen:**
|
||||||
|
- Welches Muster wird verwendet (Schachbrett vs. ChArUco)?
|
||||||
|
- Automatische Erfassung oder manueller Upload der Bilder?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [2] Board – Referenz-Board-Kalibrierung
|
||||||
|
|
||||||
|
**Ziel:** Die extrinsische Position des Marker-Boards im Kamera-Koordinatensystem bestimmen.
|
||||||
|
|
||||||
|
**Vorgehen (noch offen):**
|
||||||
|
- Board in definierter Position aufstellen
|
||||||
|
- Foto aufnehmen, Marker erkennen (`aruco.detectMarkers`)
|
||||||
|
- `solvePnP` → Rotations- und Translationsvektor berechnen
|
||||||
|
- Transformation Board → Kamera speichern
|
||||||
|
|
||||||
|
**Aktionen auf der Seite (geplant):**
|
||||||
|
- Kamerabild anzeigen mit erkannten Markern
|
||||||
|
- Pose berechnen und anzeigen
|
||||||
|
- Kalibrierungsdatei speichern
|
||||||
|
|
||||||
|
**Offene Fragen:**
|
||||||
|
- Feste Board-Position oder Referenzpunkte einmessen?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [3] Robot X-Axis – Achsenrichtung kalibrieren
|
||||||
|
|
||||||
|
**Ziel:** Die X-Achse des Roboters im Weltkoordinatensystem verorten (Ausrichtung und Nullpunkt).
|
||||||
|
|
||||||
|
**Vorgehen (noch offen):**
|
||||||
|
- Roboter an bekannte X-Positionen fahren (z. B. X=0 und X=max)
|
||||||
|
- Kamera beobachtet den Endeffektor / Marker am Roboter
|
||||||
|
- Achsvektor aus zwei Messpunkten berechnen
|
||||||
|
- Ergebnis speichern
|
||||||
|
|
||||||
|
**Aktionen auf der Seite (geplant):**
|
||||||
|
- Roboter zu Referenzposition 1 fahren → Foto → Marker-Position merken
|
||||||
|
- Roboter zu Referenzposition 2 fahren → Foto → Marker-Position merken
|
||||||
|
- Achsvektor berechnen und anzeigen
|
||||||
|
- Speichern
|
||||||
|
|
||||||
|
**Offene Fragen:**
|
||||||
|
- Wie viele Referenzpunkte werden benötigt?
|
||||||
|
- Wird die Z-Achse separat kalibriert?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## [4] Arm1 / Arm2 – Gelenk-Kalibrierung
|
||||||
|
|
||||||
|
**Ziel:** Nullposition und Kinematikparameter von Arm1 und Arm2 einmessen.
|
||||||
|
|
||||||
|
**Vorgehen (noch offen):**
|
||||||
|
- Arm in mechanische Nullposition fahren (physischer Anschlag oder Markierung)
|
||||||
|
- Kamera prüft die tatsächliche Arm-Pose
|
||||||
|
- Offset zwischen Soll und Ist berechnen und speichern
|
||||||
|
|
||||||
|
**Aktionen auf der Seite (geplant):**
|
||||||
|
- Arm1 auf Nullposition → Foto → Winkel ablesen
|
||||||
|
- Arm2 auf Nullposition → Foto → Winkel ablesen
|
||||||
|
- Offset-Korrektur berechnen und speichern
|
||||||
|
|
||||||
|
**Offene Fragen:**
|
||||||
|
- Separater Marker pro Armgelenk?
|
||||||
|
- Kalibrierung bei jedem Start oder nur nach Umbau?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Dateistruktur (geplant)
|
||||||
|
|
||||||
|
```
|
||||||
|
calibration/
|
||||||
|
cam0_calib.npz
|
||||||
|
cam1_calib.npz
|
||||||
|
cam2_calib.npz
|
||||||
|
board_pose.json
|
||||||
|
robot_xaxis.json
|
||||||
|
arm_offsets.json
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
| Schritt | Status | Anmerkung |
|
||||||
|
|------------------|--------------|----------------------------------|
|
||||||
|
| Camera NPZ | offen | Konzept unklar |
|
||||||
|
| Board | offen | Konzept unklar |
|
||||||
|
| Robot X-Axis | offen | Konzept unklar |
|
||||||
|
| Arm1 / Arm2 | offen | Konzept unklar |
|
||||||
|
| Calibration-UI | in Arbeit | HTML-Seite angelegt |
|
||||||
@@ -6,18 +6,15 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /home/chk/Documents/appRobotHoming:/app
|
- /home/chk/Documents/appRobotHoming:/app
|
||||||
environment:
|
environment:
|
||||||
- WSS_VIDEO_DRIVER=wss://localhost:8448
|
|
||||||
- WSS_URL=wss://appRobot_Driver:2095
|
|
||||||
- HTTPS_PORT=2093
|
- HTTPS_PORT=2093
|
||||||
- WEBCAM_URL=http://appRobotWebcam:8444
|
# host.docker.internal zeigt auf den Docker-Host → erreicht andere Stacks per Port
|
||||||
- BODYTRACKER_URL=http://appRobotBodyTracker:8446
|
- WEBCAM_URL=http://host.docker.internal:8444
|
||||||
|
- BODYTRACKER_URL=http://host.docker.internal:8446
|
||||||
|
extra_hosts:
|
||||||
|
# Macht host.docker.internal auf Linux verfügbar (Standard auf macOS/Windows)
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
ports:
|
ports:
|
||||||
- "2093:2093"
|
- "2093:2093"
|
||||||
depends_on:
|
|
||||||
- appRobotDriver
|
|
||||||
command: >
|
command: >
|
||||||
/bin/bash -lc "npm ci || npm install && node server/server.js"
|
/bin/bash -lc "npm ci || npm install && node server/server.js"
|
||||||
networks:
|
|
||||||
- default
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
273
public/calibration.html
Normal file
273
public/calibration.html
Normal file
@@ -0,0 +1,273 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Kalibrierung – appRobotHoming</title>
|
||||||
|
<link rel="stylesheet" href="/styles.css">
|
||||||
|
<style>
|
||||||
|
/* ===== CALIBRATION PAGE EXTRAS ===== */
|
||||||
|
|
||||||
|
.calib-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calib-header a {
|
||||||
|
color: var(--muted);
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 13px;
|
||||||
|
border: 1px solid #334155;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 6px 12px;
|
||||||
|
transition: border-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calib-header a:hover {
|
||||||
|
border-color: var(--accent);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.calib-header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== TABS ===== */
|
||||||
|
|
||||||
|
.tab-bar {
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
border-bottom: 2px solid #1f2937;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-btn {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
border-bottom: 3px solid transparent;
|
||||||
|
padding: 10px 18px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-bottom: -2px;
|
||||||
|
border-radius: 6px 6px 0 0;
|
||||||
|
transition: color 0.15s, border-color 0.15s, background 0.15s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-btn:hover {
|
||||||
|
color: var(--text);
|
||||||
|
background: #1e293b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-btn.active {
|
||||||
|
color: var(--accent);
|
||||||
|
border-bottom-color: var(--accent);
|
||||||
|
background: #1e293b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===== TAB PANELS ===== */
|
||||||
|
|
||||||
|
.tab-panel {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-panel.active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.placeholder-note {
|
||||||
|
margin-top: 16px;
|
||||||
|
padding: 16px 20px;
|
||||||
|
background: #0b1220;
|
||||||
|
border: 1px dashed #334155;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 11px;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #1e293b;
|
||||||
|
color: var(--muted);
|
||||||
|
margin-left: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-badge.open { color: #f59e0b; }
|
||||||
|
.status-badge.done { color: #34d399; background: #064e3b; }
|
||||||
|
.status-badge.wip { color: #60a5fa; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="calib-header">
|
||||||
|
<a href="/">← Zurück</a>
|
||||||
|
<h1>Kalibrierung</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- TAB BAR -->
|
||||||
|
<div class="tab-bar" id="tabBar">
|
||||||
|
<button class="tab-btn active" data-tab="camera-npz">Camera NPZ</button>
|
||||||
|
<button class="tab-btn" data-tab="board">Board</button>
|
||||||
|
<button class="tab-btn" data-tab="robot-x-axis">Robot X Axis</button>
|
||||||
|
<button class="tab-btn" data-tab="arm">Arm1 / Arm2</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- PANEL: Camera NPZ -->
|
||||||
|
<div class="tab-panel active" id="tab-camera-npz">
|
||||||
|
<div class="sections">
|
||||||
|
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Camera NPZ <span class="status-badge open">offen</span></h2>
|
||||||
|
<div class="placeholder-note">
|
||||||
|
Ziel: Intrinsische Kameraparameter (Kameramatrix, Verzerrungskoeffizienten) für jede
|
||||||
|
Kamera ermitteln und als <code>.npz</code>-Datei speichern.<br><br>
|
||||||
|
Geplante Aktionen: Fotos aufnehmen (verschiedene Posen) · Kalibrierung berechnen ·
|
||||||
|
Reprojektionsfehler anzeigen · Datei speichern.<br><br>
|
||||||
|
<em>Aktionen werden ergänzt sobald das Konzept feststeht.</em>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="controls" style="margin-top: 16px;">
|
||||||
|
<!-- Platzhalter für zukünftige Buttons -->
|
||||||
|
<button disabled title="Noch nicht implementiert">Fotos aufnehmen</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Kalibrierung berechnen</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">NPZ speichern</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Ausgabe / Log</h2>
|
||||||
|
<textarea id="log-camera" readonly placeholder="(Ausgabe erscheint hier)"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- PANEL: Board -->
|
||||||
|
<div class="tab-panel" id="tab-board">
|
||||||
|
<div class="sections">
|
||||||
|
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Board – Referenz-Board-Kalibrierung <span class="status-badge open">offen</span></h2>
|
||||||
|
<div class="placeholder-note">
|
||||||
|
Ziel: Extrinsische Position des Marker-Boards im Kamera-Koordinatensystem bestimmen
|
||||||
|
(Rotations- und Translationsvektor via <code>solvePnP</code>).<br><br>
|
||||||
|
Geplante Aktionen: Kamerabild mit erkannten Markern anzeigen · Pose berechnen ·
|
||||||
|
Kalibrierungsdatei speichern.<br><br>
|
||||||
|
<em>Aktionen werden ergänzt sobald das Konzept feststeht.</em>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="controls" style="margin-top: 16px;">
|
||||||
|
<button disabled title="Noch nicht implementiert">Foto aufnehmen</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Marker erkennen</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Pose berechnen</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Board-Pose speichern</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Ausgabe / Log</h2>
|
||||||
|
<textarea id="log-board" readonly placeholder="(Ausgabe erscheint hier)"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- PANEL: Robot X Axis -->
|
||||||
|
<div class="tab-panel" id="tab-robot-x-axis">
|
||||||
|
<div class="sections">
|
||||||
|
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Robot X Axis <span class="status-badge open">offen</span></h2>
|
||||||
|
<div class="placeholder-note">
|
||||||
|
Ziel: X-Achse des Roboters im Weltkoordinatensystem verorten (Richtungsvektor und
|
||||||
|
Nullpunkt). Roboter fährt zwei bekannte Positionen an, Kamera beobachtet den
|
||||||
|
Endeffektor-Marker.<br><br>
|
||||||
|
Geplante Aktionen: Zu Referenzposition 1 fahren · Foto · Marker merken ·
|
||||||
|
Zu Referenzposition 2 fahren · Foto · Achsvektor berechnen · Speichern.<br><br>
|
||||||
|
<em>Aktionen werden ergänzt sobald das Konzept feststeht.</em>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="controls" style="margin-top: 16px;">
|
||||||
|
<button disabled title="Noch nicht implementiert">Pos 1 anfahren</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Foto Pos 1</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Pos 2 anfahren</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Foto Pos 2</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Achse berechnen</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Speichern</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Ausgabe / Log</h2>
|
||||||
|
<textarea id="log-xaxis" readonly placeholder="(Ausgabe erscheint hier)"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- PANEL: Arm1 / Arm2 -->
|
||||||
|
<div class="tab-panel" id="tab-arm">
|
||||||
|
<div class="sections">
|
||||||
|
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Arm1 / Arm2 – Gelenk-Kalibrierung <span class="status-badge open">offen</span></h2>
|
||||||
|
<div class="placeholder-note">
|
||||||
|
Ziel: Nullposition und Kinematikparameter von Arm1 und Arm2 einmessen.
|
||||||
|
Arm fährt in mechanische Nullposition, Kamera prüft die tatsächliche Pose,
|
||||||
|
Offset wird berechnet und gespeichert.<br><br>
|
||||||
|
Geplante Aktionen: Arm1 → Nullpos → Foto → Winkel · Arm2 → Nullpos → Foto →
|
||||||
|
Winkel · Offset-Korrektur speichern.<br><br>
|
||||||
|
<em>Aktionen werden ergänzt sobald das Konzept feststeht.</em>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="controls" style="margin-top: 16px;">
|
||||||
|
<button disabled title="Noch nicht implementiert">Arm1 → Nullpos</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Foto Arm1</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Arm2 → Nullpos</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Foto Arm2</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Offsets berechnen</button>
|
||||||
|
<button disabled title="Noch nicht implementiert">Speichern</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Ausgabe / Log</h2>
|
||||||
|
<textarea id="log-arm" readonly placeholder="(Ausgabe erscheint hier)"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Tab-Switching
|
||||||
|
document.getElementById('tabBar').addEventListener('click', e => {
|
||||||
|
const btn = e.target.closest('.tab-btn');
|
||||||
|
if (!btn) return;
|
||||||
|
|
||||||
|
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
|
||||||
|
document.querySelectorAll('.tab-panel').forEach(p => p.classList.remove('active'));
|
||||||
|
|
||||||
|
btn.classList.add('active');
|
||||||
|
const panelId = 'tab-' + btn.dataset.tab;
|
||||||
|
document.getElementById(panelId).classList.add('active');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Section collapse (gleiche Logik wie Hauptseite)
|
||||||
|
document.querySelectorAll('.section h2').forEach(h2 => {
|
||||||
|
h2.addEventListener('click', () => h2.closest('.section').classList.toggle('collapsed'));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -33,20 +33,23 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="btn-calculate">Read Position from Markers</button>
|
<button id="btn-calculate">Read Position from Markers</button>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- FOTO -->
|
|
||||||
<div class="section full">
|
|
||||||
<h2>Foto</h2>
|
|
||||||
<div class="controls">
|
|
||||||
<select id="cam-select" title="Kamera wählen">
|
<select id="cam-select" title="Kamera wählen">
|
||||||
<option value="cam0">cam0 (front)</option>
|
<option value="cam0">cam0 (front)</option>
|
||||||
<option value="cam1">cam1 (left)</option>
|
<option value="cam1">cam1 (left)</option>
|
||||||
<option value="cam2">cam2 (right)</option>
|
<option value="cam2">cam2 (right)</option>
|
||||||
</select>
|
</select>
|
||||||
<button id="btn-foto">Foto</button>
|
<button id="btn-foto">Foto</button>
|
||||||
|
|
||||||
|
<a href="/calibration.html">
|
||||||
|
<button type="button">Calibration Page</button>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- FOTO DISPLAY -->
|
||||||
|
<div class="section full">
|
||||||
|
<h2>Foto</h2>
|
||||||
<div id="foto-display"></div>
|
<div id="foto-display"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user