Example #1
0
        void Awake()
        {
            try
            {
#if ENABLE_VRIK
                this.avatar               = this.avatarForFinalIK;
                this.head                 = this.headForFinalIK;
                this.body                 = this.bodyForFinalIK;
                this.LeftHand             = this.LeftHandForFinalIK;
                this.rightHand            = this.rightHandForFinalIK;
                this.noticePanelForAvatar = this.noticePanelForFinalIKAvatar;
                this.noticeTextForAvatar  = this.noticeTextForFinalIKAvatar;
#else
                this.avatar               = this.avatarForSimpleIK;
                this.head                 = this.headForSimpleIK;
                this.body                 = this.bodyForSimpleIK;
                this.LeftHand             = this.LeftHandForSimpleIK;
                this.rightHand            = this.rightHandForSimpleIK;
                this.noticePanelForAvatar = this.noticePanelForSimpleIKAvatar;
                this.noticeTextForAvatar  = this.noticeTextForSimpleIKAvatar;
#endif
                // Practice mode
                if (HumanNaviConfig.Instance.configInfo.executionMode == (int)ExecutionMode.Practice)
                {
                    this.isPracticeMode = true;
                }

                // Playback system
                this.playbackRecorder = this.playbackManager.GetComponent <HumanNaviPlaybackRecorder>();

                // Avatar
                this.initialAvatarPosition = this.avatar.transform.position;
                this.initialAvatarRotation = this.avatar.transform.eulerAngles;

                // GUI
                this.mainMenu            = GameObject.FindGameObjectWithTag("MainMenu");
                this.panelMainController = mainMenu.GetComponent <PanelMainController>();

                this.noticePanelForAvatar.SetActive(false);
                this.noticeTextForAvatar.text = "";

                // MessageMap
                this.receivedMessageMap = new Dictionary <string, bool>();
                this.receivedMessageMap.Add(MsgIamReady, false);
                this.receivedMessageMap.Add(MsgGetAvatarStatus, false);
                this.receivedMessageMap.Add(MsgGetObjectStatus, false);
                this.receivedMessageMap.Add(MsgGetSpeechState, false);
                this.receivedMessageMap.Add(MsgGiveUp, false);

                // Timer
                this.stepTimer = new StepTimer();
            }
            catch (Exception exception)
            {
                Debug.LogError(exception);
                SIGVerseLogger.Error(exception.Message);
                SIGVerseLogger.Error(exception.StackTrace);
                this.ApplicationQuitAfter1sec();
            }
        }
Example #2
0
        void Awake()
        {
            try
            {
                // Playback system
                this.playbackRecorder = this.playbackManager.GetComponent <HumanNaviPlaybackRecorder>();

                // Avatar
                this.initialAvatarPosition = this.avatar.transform.position;
                this.initialAvatarRotation = this.avatar.transform.eulerAngles;

                // GUI
                this.mainMenu            = GameObject.FindGameObjectWithTag("MainMenu");
                this.panelMainController = mainMenu.GetComponent <PanelMainController>();

                this.noticePanelForAvatar.SetActive(false);
                this.noticeTextForAvatar.text = "";

                // MessageMap
                this.receivedMessageMap = new Dictionary <string, bool>();
                this.receivedMessageMap.Add(MsgIamReady, false);
                this.receivedMessageMap.Add(MsgGetAvatarPose, false);
                this.receivedMessageMap.Add(MsgConfirmSpeechState, false);
                this.receivedMessageMap.Add(MsgGiveUp, false);

                // ROSBridge
                // (Should be read after the robot is instantiated (after Awake process of SessionManager))
                this.rosConnections = SIGVerseUtils.FindObjectsOfInterface <IRosConnection>();
                SIGVerseLogger.Info("ROS connection : count=" + this.rosConnections.Length);

                // Timer
                this.stepTimer = new StepTimer();
            }
            catch (Exception exception)
            {
                Debug.LogError(exception);
                SIGVerseLogger.Error(exception.Message);
                SIGVerseLogger.Error(exception.StackTrace);
                this.ApplicationQuitAfter1sec();
            }
        }