Example #1
0
    public void AssociateGOToRobot(GameObject GO, Cellulo robot)
    {
        print("Associating GO " + GO.name + " to robot ID" + robot.getID());
        CelluloIndexEntry myEntry = GetEntry(robot);

        myEntry.AssociatedGO = GO;
    }
Example #2
0
 // 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);
     }
 }
Example #3
0
    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");
        }
    }
Example #4
0
    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");
        }
    }
Example #5
0
    public CelluloIndexEntry GetEntry(Cellulo robot)
    {
        CelluloIndexEntry EntryToReturn = CelluloInPool.Find(x => x.Id.Equals(robot.getID()));

        return(EntryToReturn);
    }
Example #6
0
 public CelluloIndexEntry()
 {
     Robot = new Cellulo();
     Id    = Robot.getID();
 }