public void SpeakGuidanceMessageForPractice(string msg, string displeyType = "All") { RosBridge.human_navigation.HumanNaviGuidanceMsg guidanceMsg = new RosBridge.human_navigation.HumanNaviGuidanceMsg(); guidanceMsg.message = msg; guidanceMsg.display_type = displeyType; this.tts.OnReceiveROSHumanNaviGuidanceMessage(guidanceMsg); }
//void OnDestroy() //{ // this.CloseRosConnections(); //} // Update is called once per frame void Update() { try { if (this.isAllTaskFinished) { return; } if (this.interruptedReason != string.Empty && this.step != Step.WaitForNextTrial) { SIGVerseLogger.Info("Failed '" + this.interruptedReason + "'"); this.SendPanelNotice("Failed\n" + interruptedReason.Replace('_', ' '), 100, PanelNoticeStatus.Red); this.TimeIsUp(); } if (OVRInput.GetDown(OVRInput.RawButton.X) && this.isDuringTrial) { if (!this.sessionManager.GetSeechRunState()) { //this.SendRosHumanNaviMessage(MsgRequest, ""); RosBridge.human_navigation.HumanNaviGuidanceMsg guidaneMsg = new RosBridge.human_navigation.HumanNaviGuidanceMsg(); guidaneMsg.message = "Please take a canned juice on the table and put it into the left trash can."; guidaneMsg.display_type = "All"; this.tts.OnReceiveROSHumanNaviGuidanceMessage(guidaneMsg); } } switch (this.step) { case Step.Initialize: { if (this.isCompetitionStarted) { this.PreProcess(); this.step++; } break; } case Step.InitializePlayback: // Need to wait for an update to finish instantiating objects to record { this.InitializePlayback(); this.step++; break; } case Step.WaitForStart: { if (this.stepTimer.IsTimePassed((int)this.step, 3000)) { if (this.IsPlaybackInitialized() /*&& this.IsConnectedToRos()*/) { this.step++; } } break; } case Step.TrialStart: { this.goToNextTrialPanel.SetActive(false); SIGVerseLogger.Info("Trial start!"); this.RecordEventLog("Trial_start"); this.scoreManager.TaskStart(); this.SendPanelNotice("Trial start!", 100, PanelNoticeStatus.Green); base.StartCoroutine(this.ShowNoticeMessagePanelForAvatar("Trial start!", 3.0f)); this.isDuringTrial = true; this.step++; break; } case Step.WaitForIamReady: { //if (this.receivedMessageMap[MsgIamReady]) if (true) { this.tts.ResetNotificationDestinations(); this.StartPlaybackRecord(); this.step++; break; } //this.SendMessageAtIntervals(MsgAreYouReady, "", SendingAreYouReadyInterval); //break; } case Step.SendTaskInfo: { //this.SendRosTaskInfoMessage(this.taskInfoForRobot); SIGVerseLogger.Info("Waiting for end of trial"); this.step++; break; } case Step.WaitForEndOfSession: { if (!this.isFirstInstructionFinished) { RosBridge.human_navigation.HumanNaviGuidanceMsg guidaneMsg = new RosBridge.human_navigation.HumanNaviGuidanceMsg(); guidaneMsg.message = "Please take a canned juice on the table and put it into the left trash can."; guidaneMsg.display_type = "All"; this.tts.OnReceiveROSHumanNaviGuidanceMessage(guidaneMsg); this.isFirstInstructionFinished = true; } this.CheckHandInteraction(this.LeftHand); this.CheckHandInteraction(this.rightHand); break; } case Step.WaitForNextTrial: { if (this.goNextTrial) { SIGVerseLogger.Info("Go to next trial"); this.RecordEventLog("Go_to_next_trial"); //this.SendRosHumanNaviMessage(MsgGoToNextTrial, ""); this.step = Step.Initialize; } break; } } } catch (Exception exception) { Debug.LogError(exception); SIGVerseLogger.Error(exception.Message); SIGVerseLogger.Error(exception.StackTrace); this.ApplicationQuitAfter1sec(); } }
public void ForwardSubRosGuidanceMessage(RosBridge.human_navigation.HumanNaviGuidanceMsg guidaneMsg) { this.photonView.RPC("ForwardSubRosGuidanceMessageRPC", RpcTarget.All, guidaneMsg.message, guidaneMsg.display_type, guidaneMsg.source_language, guidaneMsg.target_language); }
public void SubscribeHumanNaviGuidanceMessageCallback(RosBridge.human_navigation.HumanNaviGuidanceMsg guidaneMsg) { SIGVerseLogger.Info("Received guide message : " + guidaneMsg.message + ", display type: " + guidaneMsg.display_type); this.tts.OnReceiveROSHumanNaviGuidanceMessage(guidaneMsg); }