aufräumen
|
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 274 KiB |
|
Before Width: | Height: | Size: 321 KiB After Width: | Height: | Size: 321 KiB |
|
Before Width: | Height: | Size: 354 KiB After Width: | Height: | Size: 354 KiB |
|
Before Width: | Height: | Size: 544 KiB After Width: | Height: | Size: 544 KiB |
|
Before Width: | Height: | Size: 575 KiB After Width: | Height: | Size: 575 KiB |
|
Before Width: | Height: | Size: 747 KiB After Width: | Height: | Size: 747 KiB |
|
Before Width: | Height: | Size: 626 KiB After Width: | Height: | Size: 626 KiB |
|
Before Width: | Height: | Size: 588 KiB After Width: | Height: | Size: 588 KiB |
|
Before Width: | Height: | Size: 506 KiB After Width: | Height: | Size: 506 KiB |
|
Before Width: | Height: | Size: 554 KiB After Width: | Height: | Size: 554 KiB |
@@ -20,9 +20,6 @@
|
||||
|
||||
<div class="controls">
|
||||
<button data-cmd="HOME">HOME</button>
|
||||
<button data-cmd="STOP">STOP</button>
|
||||
<button data-cmd="STATUS">STATUS</button>
|
||||
<button data-cmd="RESET">RESET</button>
|
||||
<button data-cmd="PING">PING</button>
|
||||
|
||||
<input
|
||||
@@ -35,7 +32,7 @@
|
||||
GCodeMotor
|
||||
</button>
|
||||
|
||||
<button id="btn-calculate">Calculate Actions</button>
|
||||
<button id="btn-calculate">Read Position from Markers</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
const { calculate } = require('../public/calculateAngles');
|
||||
|
||||
|
||||
|
||||
function foundMarkers(y, robot, a=0, translate=[0,0,0]){
|
||||
|
||||
const alphaPi = y * Math.PI / 180;
|
||||
|
||||
const pos20 = [0,Math.sin(alphaPi)*10,Math.cos(alphaPi)*10]
|
||||
|
||||
m = {"markers": [
|
||||
{"id": 20, "position_mm": pos20 }
|
||||
]}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
robot = {
|
||||
"Elements":["Base", "Arm1"],
|
||||
"ElementLength":{"Arm1":250, "Joint1": 89.5, "Arm2":250, "Finger1":100, "Finger2":100},
|
||||
"Joints":{
|
||||
"jointB":{"name":"Shoulder","type":"revolute","axis":[1,0,0],"parent":"Base","child":"Arm1","origin":[-89.5,0,0], "originSource":[null, "test", "test"]},
|
||||
"jointC":{"name":"Ellbow","type":"revolute","axis":[1,0,0],"parent":"Arm1","child":"Joint1", "origin":[-89.5, -250, 0]},
|
||||
"jointD":{"name":"EllbowTwist","type":"revolute","axis":[0,1,0],"parent":"Joint1","child":"Arm2", "origin":[0, -250, 0]}
|
||||
},
|
||||
"Marker":[
|
||||
{"id":20, "on":"Arm1", "relPos":[0,0,10]},
|
||||
{"id":40, "on":"Arm2", "relPos":[0,200,35]},
|
||||
{"id":41, "on":"Arm2", "relPos":[0,160,35]}
|
||||
],
|
||||
"recognized":{"x":null, "y":null, "z":null}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function normalizeAngleDeg(angle) {
|
||||
return ((angle % 360) + 360) % 360;
|
||||
}
|
||||
|
||||
|
||||
describe('calculateAngles minimal test', () => {
|
||||
it('should run calculate() artificially created robot & testData', async () => {
|
||||
|
||||
|
||||
var result = calculate(foundMarkers(45, robot), robot);
|
||||
|
||||
expect(result).toBeDefined();
|
||||
expect(robot.recognized.y).toBeDefined();
|
||||
expect(robot.recognized.y).toBeCloseTo(45,2);
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
});
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
|
||||
const Robot = require('../public/calculateActions.js');
|
||||
|
||||
|
||||
|
||||
test('Initialisiere den Robot', () => {
|
||||
|
||||
expect(1).toBeCloseTo(1,0.002);
|
||||
|
||||
});
|
||||