public static async Task <Program> CreateAsync() { var robot = await GetRobotAsync(); var planeA = Plane.WorldYZ; var planeB = Plane.WorldYZ; planeA.Origin = new Point3d(300, 200, 610); planeB.Origin = new Point3d(300, -200, 610); var speed = new Speed(300); var targetA = new CartesianTarget(planeA, RobotConfigurations.Wrist, Motions.Joint); var targetB = new CartesianTarget(planeB, null, Motions.Linear, speed: speed); var toolpath = new SimpleToolpath() { targetA, targetB }; return(new Program("TestProgram", robot, new[] { toolpath })); }
public TestProgram() { var robot = RobotSystem.Load("Bartlett-IRB120", Plane.WorldXY); var planeA = Plane.WorldYZ; var planeB = Plane.WorldYZ; planeA.Origin = new Point3d(300, 200, 610); planeB.Origin = new Point3d(300, -200, 610); var speed = new Speed(300); var targetA = new CartesianTarget(planeA, RobotConfigurations.Wrist, Motions.Joint); var targetB = new CartesianTarget(planeB, null, Motions.Linear, speed: speed); var toolpath = new SimpleToolpath() { targetA, targetB }; Program = new Program("TestProgram", robot, new[] { toolpath }); }
public URTests() { const string xml = "<RobotCell name=\"UR10\" manufacturer=\"UR\"><Mechanisms><RobotArm model=\"UR10\" manufacturer=\"UR\" payload=\"10\"><Base x=\"0.000\" y=\"0.000\" z=\"0.000\" q1=\"1.000\" q2=\"0.000\" q3=\"0.000\" q4=\"0.000\"/><Joints><Revolute number=\"1\" a =\"0\" d =\"127.3\" minrange = \"-360\" maxrange =\"360\" maxspeed =\"120\"/><Revolute number=\"2\" a =\"-612\" d =\"0\" minrange = \"-360\" maxrange =\"360\" maxspeed =\"120\"/><Revolute number=\"3\" a =\"-572.3\" d =\"0\" minrange = \"-360\" maxrange =\"360\" maxspeed =\"180\"/><Revolute number=\"4\" a =\"0\" d =\"163.941\" minrange = \"-360\" maxrange =\"360\" maxspeed =\"180\"/><Revolute number=\"5\" a =\"0\" d =\"115.7\" minrange = \"-360\" maxrange =\"360\" maxspeed =\"180\"/><Revolute number=\"6\" a =\"0\" d =\"92.2\" minrange = \"-360\" maxrange =\"360\" maxspeed =\"180\"/></Joints></RobotArm></Mechanisms><IO><DO names=\"0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16\"/><DI names=\"0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16\"/><AO names=\"0,1\"/><AI names=\"0,1\"/></IO></RobotCell>"; var robot = FileIO.ParseRobotSystem(xml, Plane.WorldXY); var planeA = Plane.WorldZX; var planeB = Plane.WorldZX; planeA.Origin = new Point3d(200, 100, 600); planeB.Origin = new Point3d(700, 250, 600); var speed = new Speed(300); var targetA = new CartesianTarget(planeA, RobotConfigurations.Wrist, Motions.Joint); var targetB = new CartesianTarget(planeB, null, Motions.Linear, speed: speed); var toolpath = new SimpleToolpath() { targetA, targetB }; _program = new Program("URTest", robot, new[] { toolpath }); }
public ABBTests() { const string xml = "<RobotCell name=\"IRB120\" manufacturer=\"ABB\"><Mechanisms><RobotArm model=\"IRB120\" manufacturer=\"ABB\" payload=\"3\"><Base x=\"0.000\" y=\"0.000\" z=\"0.000\" q1=\"1.000\" q2=\"0.000\" q3=\"0.000\" q4=\"0.000\"/><Joints><Revolute number=\"1\" a =\"0\" d =\"290\" minrange = \"-165\" maxrange =\"165\" maxspeed =\"250\"/><Revolute number=\"2\" a =\"270\" d =\"0\" minrange = \"-110\" maxrange =\"110\" maxspeed =\"250\"/><Revolute number=\"3\" a =\"70\" d =\"0\" minrange = \"-110\" maxrange =\"70\" maxspeed =\"250\"/><Revolute number=\"4\" a =\"0\" d =\"302\" minrange = \"-160\" maxrange =\"160\" maxspeed =\"320\"/><Revolute number=\"5\" a =\"0\" d =\"0\" minrange = \"-120\" maxrange =\"120\" maxspeed =\"320\"/><Revolute number=\"6\" a =\"0\" d =\"72\" minrange = \"-400\" maxrange =\"400\" maxspeed =\"420\"/></Joints></RobotArm></Mechanisms><IO><DO names=\"DO10_1,DO10_2\"/><DI names=\"DI10_1,DI10_2\"/></IO></RobotCell>"; var robot = FileIO.ParseRobotSystem(xml, Plane.WorldXY); var planeA = Plane.WorldYZ; var planeB = Plane.WorldYZ; planeA.Origin = new Point3d(300, 200, 610); planeB.Origin = new Point3d(300, -200, 610); var speed = new Speed(300); var targetA = new CartesianTarget(planeA, RobotConfigurations.Wrist, Motions.Joint); var targetB = new CartesianTarget(planeB, null, Motions.Linear, speed: speed); var toolpath = new SimpleToolpath() { targetA, targetB }; _program = new Program("TestProgram", robot, new[] { toolpath }); }
public GH_Toolpath() { Value = new SimpleToolpath(); }
protected override void SolveInstance(IGH_DataAccess DA) { string name = null; GH_RobotSystem robotSystem = null; var initCommandsGH = new List <GH_Command>(); var toolpathsA = new List <GH_Toolpath>(); var toolpathsB = new List <GH_Toolpath>(); var multiFileIndices = new List <int>(); double stepSize = 1; if (!DA.GetData(0, ref name)) { return; } if (!DA.GetData(1, ref robotSystem)) { return; } if (!DA.GetDataList(2, toolpathsA)) { return; } DA.GetDataList(3, toolpathsB); DA.GetDataList(4, initCommandsGH); DA.GetDataList(5, multiFileIndices); if (!DA.GetData(6, ref stepSize)) { return; } var initCommands = initCommandsGH.Count > 0 ? new Robots.Commands.Group(initCommandsGH.Select(x => x.Value)) : null; var toolpaths = new List <IToolpath>(); var toolpathA = new SimpleToolpath(toolpathsA.Select(t => t.Value)); toolpaths.Add(toolpathA); if (toolpathsB.Count > 0) { var toolpathB = new SimpleToolpath(toolpathsB.Select(t => t.Value)); toolpaths.Add(toolpathB); } var program = new Program(name, robotSystem.Value, toolpaths, initCommands, multiFileIndices, stepSize); DA.SetData(0, new GH_Program(program)); if (program.Code != null) { var path = DA.ParameterTargetPath(2); var structure = new GH_Structure <GH_String>(); for (int i = 0; i < program.Code.Count; i++) { var tempPath = path.AppendElement(i); for (int j = 0; j < program.Code[i].Count; j++) { structure.AppendRange(program.Code[i][j].Select(x => new GH_String(x)), tempPath.AppendElement(j)); } } DA.SetDataTree(1, structure); } DA.SetData(2, program.Duration); if (program.Warnings.Count > 0) { DA.SetDataList(3, program.Warnings); this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "Warnings in program"); } if (program.Errors.Count > 0) { DA.SetDataList(4, program.Errors); this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Errors in program"); } }