示例#1
0
 /// <summary>
 /// Every time RobotScene is loaded, attempt to retrieve intrensics
 /// and start updating the space pinning if successful
 /// </summary>
 private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     if (scene.name.Equals("RobotScene"))
     {
         Intrensics?intr = CameraIntrensicsHelper.ReadIntrensics();
         if (intr.HasValue)
         {
             _intrensics = intr.Value;
             StartCoroutine("PinSpace");
         }
         else
         {
             Debug.Log("Failed to retrieve existing webcam parameters from disk. Manual calibration is required!");
             // Tell the UI to prompt user for calibration
             GoalPoseClient gpc = FindObjectOfType <GoalPoseClient>();
             if (gpc != null)
             {
                 gpc.State = GoalPoseClient.GoalPoseClientState.NEEDING_CALIBRATION;
             }
         }
     }
     else
     {
         CancelInvoke("PipePhotoToSpacePinning");
     }
 }
示例#2
0
 private void Start()
 {
     gpc = FindObjectOfType <GoalPoseClient>();
 }