logging
This commit is contained in:
@@ -89,6 +89,8 @@ class GCode{
|
||||
|
||||
if(g == undefined) return;
|
||||
|
||||
console.log("GCode: Empfange GCode: " + g);
|
||||
|
||||
var multipleCommands = g.split(" G");
|
||||
var doProcessRest = false;
|
||||
if(multipleCommands.length > 1){
|
||||
@@ -104,6 +106,7 @@ class GCode{
|
||||
|
||||
if(g[0] == "G90") {robot.moveRelative = false; calculateNew = false;}
|
||||
else if(g[0] == "G91") {robot.moveRelative = true; calculateNew = false;}
|
||||
// G28 - Move to Home Position
|
||||
else if(g[0] == "G28") {
|
||||
robot.x = 0;
|
||||
robot.y = robot.l1 + robot.l2 + robot.l3;
|
||||
|
||||
@@ -67,7 +67,6 @@ class Robot{
|
||||
|
||||
// Berechnet aus XYZ die Motor-Winkel für den GCode
|
||||
calculateAngles3D(){
|
||||
|
||||
while(this.phi > Math.PI){this.phi -= 2*Math.PI}
|
||||
while(this.phi < -Math.PI){this.phi += 2*Math.PI}
|
||||
while(this.theta > Math.PI){this.theta -= 2*Math.PI}
|
||||
@@ -145,7 +144,7 @@ class Robot{
|
||||
this.motorPositionOld = this.motorPosition;
|
||||
this.createMotorPosition()
|
||||
|
||||
console.log("Robot.sendCommand: neue RobotMotorPosition: x=", this.motorPosition.x.toFixed(3), "yMotor=",this.motorPosition.y.toFixed(3), "zMotor=",this.motorPosition.z.toFixed(3), "aM=", this.motorPosition.a.toFixed(3), "bM=", this.motorPosition.b.toFixed(3), "cM=", this.motorPosition.c.toFixed(3), " e=", this.motorPosition.e.toFixed(3));
|
||||
console.log("Robot.sendCommand: Motor-Pos: x=", this.motorPosition.x.toFixed(3), "yMotor=",this.motorPosition.y.toFixed(3), "zMotor=",this.motorPosition.z.toFixed(3), "aM=", this.motorPosition.a.toFixed(3), "bM=", this.motorPosition.b.toFixed(3), "cM=", this.motorPosition.c.toFixed(3), " e=", this.motorPosition.e.toFixed(3));
|
||||
|
||||
this.cmdReceivers.forEach(receiver => {
|
||||
receiver.moveTo(this.motorPositionOld, this.motorPosition);
|
||||
|
||||
Reference in New Issue
Block a user