internal RobotCellUR(string name, RobotArm robot, IO io, Plane basePlane, Mesh environment) : base(name, Manufacturers.UR, io, basePlane, environment) { this.Robot = robot as RobotUR; this.DisplayMesh = new Mesh(); DisplayMesh.Append(robot.DisplayMesh); this.DisplayMesh.Transform(this.BasePlane.ToTransform()); }
public RobotSystem(string name, Manufacturers manufacturer, IO io, Plane basePlane, Mesh environment) { this.Name = name; this.Manufacturer = manufacturer; this.IO = io; this.BasePlane = basePlane; this.Environment = environment; }
internal RobotCell(string name, Manufacturers manufacturer, List<MechanicalGroup> mechanicalGroups, IO io, Plane basePlane, Mesh environment) : base(name, manufacturer, io, basePlane, environment) { this.MechanicalGroups = mechanicalGroups; this.DisplayMesh = new Mesh(); foreach (var group in mechanicalGroups) { DisplayMesh.Append(group.Robot.DisplayMesh); foreach (var external in group.Externals) DisplayMesh.Append(external.DisplayMesh); } this.DisplayMesh.Transform(this.BasePlane.ToTransform()); }
private static RobotSystem Create(XElement element, Plane basePlane) { var type = element.Name.LocalName; var name = element.Attribute(XName.Get("name")).Value; var manufacturer = (Manufacturers)Enum.Parse(typeof(Manufacturers), element.Attribute(XName.Get("manufacturer")).Value); var mechanisms = new List<Mechanism>(); var mechanicalGroups = new List<MechanicalGroup>(); foreach (var mechanicalGroup in element.Elements(XName.Get("Mechanisms"))) { mechanicalGroups.Add(MechanicalGroup.Create(mechanicalGroup)); } IO io = null; XElement ioElement = element.Element(XName.Get("IO")); if (ioElement != null) { string[] doNames = null, diNames = null, aoNames = null, aiNames = null; var doElement = ioElement.Element(XName.Get("DO")); var diElement = ioElement.Element(XName.Get("DI")); var aoElement = ioElement.Element(XName.Get("AO")); var aiElement = ioElement.Element(XName.Get("AI")); if (doElement != null) doNames = doElement.Attribute(XName.Get("names")).Value.Split(','); if (diElement != null) diNames = diElement.Attribute(XName.Get("names")).Value.Split(','); if (aoElement != null) aoNames = aoElement.Attribute(XName.Get("names")).Value.Split(','); if (aiElement != null) aiNames = aiElement.Attribute(XName.Get("names")).Value.Split(','); io = new IO() { DO = doNames, DI = diNames, AO = aoNames, AI = aiNames }; } Mesh environment = null; if (type == "RobotCell") { switch (manufacturer) { case (Manufacturers.ABB): return new RobotCellAbb(name, mechanicalGroups, io, basePlane, environment); case (Manufacturers.KUKA): return new RobotCellKuka(name, mechanicalGroups, io, basePlane, environment); case (Manufacturers.UR): return new RobotCellUR(name, mechanicalGroups[0].Robot, io, basePlane, environment); } } return null; }
internal RobotCellAbb(string name, List<MechanicalGroup> mechanicalGroups, IO io, Plane basePlane, Mesh environment) : base(name, Manufacturers.ABB, mechanicalGroups, io, basePlane, environment) { }
internal RobotCellAbb(string name, List <MechanicalGroup> mechanicalGroups, IO io, Plane basePlane, Mesh environment) : base(name, Manufacturers.ABB, mechanicalGroups, io, basePlane, environment) { }
internal RobotCellKuka(string name, List<MechanicalGroup> mechanicalGroup, IO io, Plane basePlane, Mesh environment) : base(name, Manufacturers.KUKA, mechanicalGroup, io, basePlane, environment) { }