public override String to_script(bRobotBrand type) { CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; TextInfo textInfo = cultureInfo.TextInfo; string cmd; bool temp = !this._value; switch (type) { case (bRobotBrand.UNKNOWN): return "Unknown robot model"; // URSCRIPT case (bRobotBrand.UR): cmd = String.Format("\twhile(get_digital_in({0}) == {1}):\n\tend\n", _id, textInfo.ToTitleCase(temp.ToString())); return cmd; case (bRobotBrand.KUKA): cmd = String.Format("WHILE $IN[{0}]=={1}\nENDWHILE\n", _id, temp.ToString().ToUpper()); return cmd; case (bRobotBrand.ABB): return "Not implemented.\n"; default: return "Bad command."; } }
public override String to_script(bRobotBrand type, bool cont) { string cmd; switch (type) { case (bRobotBrand.UNKNOWN): return "Unknown robot model"; // URSCRIPT case (bRobotBrand.UR): Types.UR.AxisAngle aa = new Types.UR.AxisAngle(Rhino.Geometry.Transform.PlaneToPlane(Plane.WorldXY, this.waypoint)); if (this.axis) { cmd = String.Format("movep([{0:0.000}, {1:0.000}, {2:0.000}, {3:0.000}, {4:0.000}, {5:0.000}], a={6:0.000}, v={7:0.000}", this.q[0], this.q[1], this.q[2], this.q[3], this.q[4], this.q[5], this.qdd, this.qd); } else { cmd = String.Format("movep(p[{0:0.000}, {1:0.000}, {2:0.000}, {3:0.000}, {4:0.000}, {5:0.000}], a={6:0.000}, v={7:0.000}", this.waypoint.Origin.X * 0.001, this.waypoint.Origin.Y * 0.001, this.waypoint.Origin.Z * 0.001, aa.x * aa.angle, aa.y * aa.angle, aa.z * aa.angle, this.qdd, this.qd); } if (r > 0.0001) cmd += String.Format(", r={0:0.0000}", r * 0.001); cmd += ")\n"; return cmd; // KUKA KRL case (bRobotBrand.KUKA): Types.KUKA.kukaABC k1 = new Types.KUKA.kukaABC(Rhino.Geometry.Transform.PlaneToPlane(Plane.WorldXY, this.waypoint)); cmd = "SPL {" + String.Format("X {0:0.0000}, Y {1:0.0000}, Z {2:0.0000}, A {3:0.0000}, B {4:0.0000}, C {5:0.0000},", k1.x, k1.y, k1.z, k1.a, k1.b, k1.c) + "E1 0, E2 0, E3 0, E4 0, E5 0, E6 0}"; if (cont) cmd += "\n"; //cmd += " C_VEL\n"; else cmd += "\n"; return cmd; // ABB RAPID case (bRobotBrand.ABB): Quaternion quat; break; } return "circular move"; }
public override String to_script(bRobotBrand type, bool cont) { string cmd; switch (type) { case (bRobotBrand.UNKNOWN): return "Unknown robot model"; case (bRobotBrand.UR): Types.UR.AxisAngle aa = new Types.UR.AxisAngle(Rhino.Geometry.Transform.PlaneToPlane(Plane.WorldXY, this.waypoint)); if (this.axis) { cmd = String.Format("movej([{0:0.0000}, {1:0.0000}, {2:0.0000}, {3:0.0000}, {4:0.0000}, {5:0.0000}], a={6:0.0000}, v={7:0.0000}", this.q[0], this.q[1], this.q[2], this.q[3], this.q[4], this.q[5], this.qdd, this.qd); } else { cmd = String.Format("movej(p[{0:0.0000}, {1:0.0000}, {2:0.0000}, {3:0.0000}, {4:0.0000}, {5:0.0000}], a={6:0.0000}, v={7:0.0000}", this.waypoint.Origin.X * 0.001, this.waypoint.Origin.Y * 0.001, this.waypoint.Origin.Z * 0.001, aa.x * aa.angle, aa.y * aa.angle, aa.z * aa.angle, this.qdd, this.qd); } if (r > 0.0001) cmd += String.Format(", r = {0:0.0000}", r * 0.001); cmd += ")\n"; return cmd; case (bRobotBrand.KUKA): Types.KUKA.kukaABC k = new Types.KUKA.kukaABC(Rhino.Geometry.Transform.PlaneToPlane(Plane.WorldXY, this.waypoint)); //cmd = "PTP {" + String.Format("X {0:0.0000}, Y {1:0.0000}, Z {2:0.0000}, A {3:0.0000}, B {4:0.0000}, C {5:0.0000},", //k.x, k.y, k.z, k.a, k.b, k.c) //+ String.Format("E1 0, E2 0, E3 0, E4 0, E5 0, E6 0, S {0}, T {1}", k.s, k.t) + "}"; cmd = "PTP {" + String.Format("X {0:0.0000}, Y {1:0.0000}, Z {2:0.0000}, A {3:0.0000}, B {4:0.0000}, C {5:0.0000},", k.x, k.y, k.z, k.a, k.b, k.c) + "E1 0, E2 0, E3 0, E4 0, E5 0, E6 0 }"; if (cont) cmd += "\n"; //cmd += " C_PTP\n"; else cmd += "\n"; return cmd; case (bRobotBrand.ABB): break; } return "joint move"; }
public override String to_script(bRobotBrand type, bool cont) { switch (type) { case (bRobotBrand.UNKNOWN): return "Unknown robot model"; // URSCRIPT case (bRobotBrand.UR): return String.Format("stopl(a={0:0.000}\n", this.qdd); // KUKA KRL case (bRobotBrand.KUKA): return "HALT\n"; // ABB RAPID case (bRobotBrand.ABB): break; } return "stop move"; }
public override String to_script(bRobotBrand type, bool cont) { switch (type) { case (bRobotBrand.UNKNOWN): return "Unknown robot model"; case (bRobotBrand.UR): Types.UR.AxisAngle q1 = new Types.UR.AxisAngle(Rhino.Geometry.Transform.PlaneToPlane(Plane.WorldXY, this.waypoint)); Types.UR.AxisAngle q2 = new Types.UR.AxisAngle(Rhino.Geometry.Transform.PlaneToPlane(Plane.WorldXY, this.waypoint2)); return String.Format("movec(p[{0:0.0000}, {1:0.0000}, {2:0.0000}, {3:0.0000}, {4:0.0000}, {5:0.0000}], p[{6:0.0000}, {7:0.0000}, {8:0.0000}, {9:0.0000}, {10:0.0000}, {11:0.0000}], a={12:0.0000}, v={13:0.0000})", this.waypoint.Origin.X * 0.001, this.waypoint.Origin.Y * 0.001, this.waypoint.Origin.Z * 0.001, q1.x, q1.y, q1.z, this.waypoint2.Origin.X * 0.001, this.waypoint2.Origin.Y * 0.001, this.waypoint2.Origin.Z * 0.001, q2.x, q2.y, q2.z, this.qdd, this.qd); case (bRobotBrand.KUKA): Types.KUKA.kukaABC k1 = new Types.KUKA.kukaABC(Rhino.Geometry.Transform.PlaneToPlane(Plane.WorldXY, this.waypoint)); Types.KUKA.kukaABC k2 = new Types.KUKA.kukaABC(Rhino.Geometry.Transform.PlaneToPlane(Plane.WorldXY, this.waypoint2)); string cmd = String.Format("CIRC {X {0:0.000}, Y {1:0.000}, Z {2:0.000}, A {3:0.000}, B {4:0.000}, C {5:0.000},", k1.x, k1.y, k1.z, k1.a, k1.b, k1.c) + String.Format("X {0:0.000}, Y {1:0.000}, Z {2:0.000}, A {3:0.000}, B {4:0.000}, C {5:0.000},", k2.x, k2.y, k2.z, k2.a, k2.b, k2.c) + "E1 0, E2 0, E3 0, E4 0, E5 0, E6 0}"; if (cont) cmd += " C_VEL\n"; else cmd += "\n"; return cmd; case (bRobotBrand.ABB): break; } return "circular move"; }
public override String to_script(bRobotBrand type) { CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; TextInfo textInfo = cultureInfo.TextInfo; string cmd; switch (type) { case (bRobotBrand.UNKNOWN): return "Unknown robot model"; // URSCRIPT case (bRobotBrand.UR): cmd = String.Format("\tset_digital_out({0}, {1})\n", _id, textInfo.ToTitleCase(_value.ToString())); return cmd; case (bRobotBrand.KUKA): cmd = String.Format("$OUT[{0}]={1}\n", _id, _value.ToString().ToUpper()); return cmd; case (bRobotBrand.ABB): return "Not implemented.\n"; default: return "Bad command."; } }
public virtual String to_script(bRobotBrand model, bool cont) { return "Not implemented."; }
public virtual String to_script(bRobotBrand brand) { return "Not implemented."; }