public void AssociateGOToRobot(GameObject GO, Cellulo robot) { print("Associating GO " + GO.name + " to robot ID" + robot.getID()); CelluloIndexEntry myEntry = GetEntry(robot); myEntry.AssociatedGO = GO; }
// Update is called once per frame void Update() { while (true) { if (CelluloInPool.Count == Cellulo.totalRobots()) { break; } CelluloIndexEntry newEntry = new CelluloIndexEntry(); print("Adding new CelluloTrackerEntry : \n robot ID= " + newEntry.Id); CelluloInPool.Add(newEntry); } foreach (CelluloIndexEntry Entry in CelluloInPool) { //print("List Entry robot ID :"+ Entry.Id+ "\n has associated GO :"+Entry.AssociatedGO); } }
void Start() { //mSpeed=5; if (!CelluloInit) { Cellulo.initialize(); CelluloInit = true; print("Cellulo initialized"); } if (robot != null) { //robot.clearTracking(); start_time = Time.time; MappingMode = 0; convertCoord = this.gameObject.GetComponent <LibDotsMapping>(); //isRunning=true; MasterInfo = GameObject.Find("SimMasterInfo"); TestGO = GameObject.Find("Test GO"); } }
void connect() { if (robot != null) { return; } robot = CelluloTrakingScript.getUnassociatedCellulo(); CelluloTrakingScript.AssociateGOToRobot(this.gameObject, robot); this.celluloLessDebug = false; Debug.Log("Robot connection to pool tried " + "\n" + "New value is :" + robot); initialCelluloTheta = robot.getTheta(); initialCelluloTheta = 0; if (!robot.hapticOn) { robot.setHapticBackdriveAssist(0.8f, 0.8f, 0.8f); robot.hapticOn = true; print("haptic assist is ON"); } }
public CelluloIndexEntry GetEntry(Cellulo robot) { CelluloIndexEntry EntryToReturn = CelluloInPool.Find(x => x.Id.Equals(robot.getID())); return(EntryToReturn); }
public CelluloIndexEntry() { Robot = new Cellulo(); Id = Robot.getID(); }