string CodeKuka(RobotSystem robotSystem, Target target) { var number = GetNumber(robotSystem); string textValue = Value ? "TRUE" : "FALSE"; return($"WAIT FOR $IN[{number}]=={textValue}"); }
string CodeAbb(RobotSystem robotSystem, Target target) { var io = robotSystem.IO; string textValue = Value ? "1" : "0"; return($"WaitDI {io.DI[DI]},{textValue};"); }
public UnityMeshPoser(RobotSystem robot, Material material) { _default = robot.DefaultPose; var allMeshes = _default.Meshes.SelectMany(m => m).ToList(); _joints = new Transform[allMeshes.Count]; var parent = GameObject.Find("Robot").transform; for (int i = 0; i < allMeshes.Count; i++) { string name = $"Joint {i}"; var go = new GameObject(name, typeof(MeshFilter), typeof(MeshRenderer)); var filter = go.GetComponent <MeshFilter>(); filter.mesh = ToMesh(allMeshes[i], name); var renderer = go.GetComponent <MeshRenderer>(); renderer.material = material; var transform = go.transform; transform.SetParent(parent); _joints[i] = transform; } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { wandererWorld = Matrix.Identity; wanderer = new WandererBody(this); heightMapTransformSystem_Wanderer = new HeightMapTransformSystem_Wanderer(); heightMapComponent = new HeightMapComponent(); heightMapCameraComponent = new HeightMapCameraComponent(); robotComponent = new RobotComponent(); heightMapSystem = new HeightmapSystem(); heightMapTranformSystem = new HeightMapTranformSystem(); heightMapRenderSystem = new HeightMapRenderSystem(graphics.GraphicsDevice); robotSystem = new RobotSystem(); robotTranformSystem = new RobotTranformSystem(); robotRenderSystem = new RobotRenderSystem(); collisionSystem = new CollisionSystem(); houseSystem = new HouseSystem(this); systemRenderer = new Renderer(); base.Initialize(); }
public CustomProgram(string name, RobotSystem robotSystem, List <int> multiFileIndices, List <List <List <string> > > code) { Name = name; RobotSystem = robotSystem; Code = code; MultiFileIndices = multiFileIndices; }
string CodeStaubli(RobotSystem robotSystem, Target target) { var number = GetNumber(robotSystem); string textValue = Value ? "true" : "false"; return($"waitEndMove()\r\nwait(dis[{number}] == {textValue})"); }
string CodeUR(RobotSystem robotSystem, Target target) { //string textValue = Value ? "True" : "False"; const string indent = " "; string textValue = Value ? "not " : ""; return($"while {textValue}get_digital_in({robotSystem.IO.DI[DI]}):\r\n{indent}{indent}sleep(0.008)\r\n{indent}end"); }
public static List <Mesh> Pose(RobotSystem robot, List <KinematicSolution> solutions, IList <Target> targets) { var tools = targets.Map(t => t.Tool); var poser = new RhinoMeshPoser(robot); poser.Pose(solutions, tools); return(poser.Meshes); }
string GetNumber(RobotSystem robotSystem) { var io = robotSystem.IO; return(io.UseControllerNumbering ? DO.ToString() : io.DO[DO]); }
public RhinoMeshPoser(RobotSystem robot) { _default = robot.DefaultPose; var meshCount = _default.Meshes.Sum(m => m.Count + 1); Meshes = new List <Mesh>(meshCount); }
string CodeUR(RobotSystem robotSystem, Target target) { var number = GetNumber(robotSystem); const string indent = " "; string textValue = Value ? "not " : ""; return($"while {textValue}get_digital_in({number}):\r\n{indent}{indent}sleep(0.008)\r\n{indent}end"); }
string CodeUR(RobotSystem robotSystem, Target target) { var number = GetNumber(robotSystem); string textValue = Value ? "True" : "False"; return($"set_digital_out({number},{textValue})"); }
private void Awake() { instance = this; this.SpawnedRobotDictionary = new Dictionary <string, RobotBase>(); this.SpawnedRobotList = new List <RobotBase>(); this.StoredRobotSourceCodes = new List <RobotSourceCode>(); }
protected override void ErrorChecking(RobotSystem robotSystem) { if (robotSystem.IO.AO == null) { throw new Exception(" Robot contains no analog outputs."); } if (AO > robotSystem.IO.AO.Length - 1) { throw new Exception(" Index of analog output is too high."); } }
protected override void ErrorChecking(RobotSystem robotSystem) { if (robotSystem.IO.DI == null) { throw new Exception(" Robot contains no digital inputs."); } if (DI > robotSystem.IO.DI.Length - 1) { throw new Exception(" Index of digital inputs is too high."); } }
protected override string CodeAbb(RobotSystem robotSystem, Target target) { if (target.Zone.IsFlyBy) { return($@"WaitTime {this.Name};"); } else { return($@"WaitTime \InPos,{this.Name};"); } }
protected override string CodeKuka(RobotSystem robotSystem, Target target) { if (target.Zone.IsFlyBy) { return($"CONTINUE\r\nWAIT SEC {this.Name}"); } else { return($"WAIT SEC {this.Name}"); } }
string CodeAbb(RobotSystem robotSystem, Target target) { if (target.Zone.IsFlyBy) { return($"WaitTime {Name};"); } else { return($@"WaitTime \InPos,{Name};"); } }
protected override string CodeKuka(RobotSystem robotSystem, Target target) { if (target.Zone.IsFlyBy) { return($"CONTINUE\r\nPULSE($OUT[{robotSystem.IO.DO[DO]}],TRUE,{length:0.00})"); } else { return($"PULSE($OUT[{robotSystem.IO.DO[DO]}],TRUE,{length:0.00})"); } }
string DeclarationUR(RobotSystem robotSystem) { var number = GetNumber(robotSystem); string time = $"{Name} = {_length:0.###}"; string thread = $@" thread run{Name}(): sleep({Name}) set_digital_out({number}, False) end"; return($"{time}\r\n{thread}"); }
string CodeKuka(RobotSystem robotSystem, Target target) { var number = GetNumber(robotSystem); if (target.Zone.IsFlyBy) { return($"CONTINUE\r\nPULSE($OUT[{number}],TRUE,{_length:0.###})"); } else { return($"PULSE($OUT[{number}],TRUE,{_length:0.###})"); } }
protected override string CodeKuka(RobotSystem robotSystem, Target target) { string textValue = Value ? "TRUE" : "FALSE"; if (target.Zone.IsFlyBy) { return($"CONTINUE\r\n$OUT[{robotSystem.IO.DO[DO]}] = {textValue}"); } else { return($"$OUT[{robotSystem.IO.DO[DO]}] = {textValue}"); } }
protected override string CodeAbb(RobotSystem robotSystem, Target target) { string textValue = Value ? "1" : "0"; if (target.Zone.IsFlyBy) { return($"SetDO {robotSystem.IO.DO[DO]},{textValue};"); } else { return($@"SetDO \Sync ,{robotSystem.IO.DO[DO]},{textValue};"); } }
internal CheckProgram(Program program, List <CellTarget> cellTargets, double stepSize) { _robotSystem = program.RobotSystem; _program = program; FixFirstTarget(cellTargets[0]); FixTargetAttributes(cellTargets); var indexError = FixTargetMotions(cellTargets, stepSize); FixedTargets = (indexError != -1) ? cellTargets.GetRange(0, indexError + 1) : cellTargets; }
string CodeAbb(RobotSystem robotSystem, Target target) { var io = robotSystem.IO; string textValue = Value ? "1" : "0"; if (target.Zone.IsFlyBy) { return($"SetDO {io.DO[DO]},{textValue};"); } else { return($@"SetDO \Sync ,{io.DO[DO]},{textValue};"); } }
string CodeKuka(RobotSystem robotSystem, Target target) { var number = GetNumber(robotSystem); string textValue = Value ? "TRUE" : "FALSE"; if (target.Zone.IsFlyBy) { return($"CONTINUE\r\n$OUT[{number}] = {textValue}"); } else { return($"$OUT[{number}] = {textValue}"); } }
public static List <Mesh> PoseMeshes(RobotSystem robot, List <KinematicSolution> solutions, List <Mesh> tools) { var cell = robot as RobotCell; if (cell != null) { var meshes = solutions.SelectMany((_, i) => PoseMeshes(cell.MechanicalGroups[i], solutions[i].Planes, tools[i])).ToList(); return(meshes); } else { var ur = robot as RobotCellUR; var meshes = PoseMeshesRobot(ur.Robot, solutions[0].Planes, tools[0]); return(meshes); } }
//发送处理完的所有的robot的信息 public void send_robots_data() { List <Robot> robots = RobotSystem.get_singleton().get_robots(); lock (robots) { foreach (Robot robot in robots) { Queue <NetworkMsg> sendQue = robot.m_clientSocket.load_send_queue(); while (sendQue.Count > 0) { NetworkMsg msg = sendQue.Dequeue(); m_tcpServer.send_networkMessage(msg, robot.m_clientSocket.m_socket); } } } }
protected override void SolveInstance(IGH_DataAccess DA) { string name = null; GH_Plane basePlane = null; if (!DA.GetData(0, ref name)) { return; } if (!DA.GetData(1, ref basePlane)) { return; } var robotSystem = RobotSystem.Load(name, basePlane.Value);; DA.SetData(0, new GH_RobotSystem(robotSystem)); }
public HelixMeshPoser(RobotSystem robot, PBRMaterial material, ObservableElement3DCollection robotModels) { _default = robot.DefaultPose; _robotModels = robotModels; foreach (var joint in _default.Meshes.SelectMany(m => m)) { var model = new MeshGeometryModel3D { Geometry = ToWPF(joint), Material = material, Transform = Transform3D.Identity, IsThrowingShadow = true }; robotModels.Add(model); } }