public void ResetRobot() { if (this.currentRobot != null) { this.currentRobot.SetActive(false); // For guidance message panel controller Destroy(this.currentRobot); } this.currentRobot = MonoBehaviour.Instantiate(this.robot); this.currentRobot.name = this.robotName; this.currentRobot.SetActive(true); this.tts = this.currentRobot.transform.Find("CompetitionScripts").GetComponent <SAPIVoiceSynthesisExternal>(); this.birdsEyeViewCameraControllerForRobot.SetTarget(this.currentRobot.transform.Find("odom/base_footprint").gameObject); }
private void Awake() { try { // For practice mode if (HumanNaviConfig.Instance.configInfo.executionMode == (int)ExecutionMode.Practice) { this.GetComponent <HumanNaviPubTaskInfo>().enabled = false; this.GetComponent <HumanNaviPubMessage>().enabled = false; this.GetComponent <HumanNaviSubMessage>().enabled = false; this.GetComponent <HumanNaviPubAvatarStatus>().enabled = false; this.GetComponent <HumanNaviPubObjectStatus>().enabled = false; robot.transform.Find("RosBridgeScripts").gameObject.SetActive(false); robot.GetComponentInChildren <HumanNaviSubGuidanceMessage>().enabled = false; foreach (Camera camera in robot.transform.GetComponentsInChildren <Camera>()) { camera.gameObject.SetActive(false); } } this.robot.SetActive(false); this.robotBaseFootprint = SIGVerseUtils.FindTransformFromChild(this.robot.transform, "base_footprint"); this.InitializeEnvironments(); this.tts = this.robot.transform.Find("CompetitionScripts").GetComponent <SAPIVoiceSynthesisExternal>(); this.InitializeTaskInfo(); } catch (Exception e) { SIGVerseLogger.Error(e.Message); this.ApplicationQuitAfter1sec(); } }