Beispiel #1
0
        private void SendRosAvatarPoseMessage(RosBridge.human_navigation.HumanNaviAvatarPose avatarPose)
        {
            ExecuteEvents.Execute <IRosAvatarPoseSendHandler>
            (
                target: this.gameObject,
                eventData: null,
                functor: (reciever, eventData) => reciever.OnSendRosAvatarPoseMessage(avatarPose)
            );

            ExecuteEvents.Execute <IRosAvatarPoseSendHandler>
            (
                target: this.playbackManager,
                eventData: null,
                functor: (reciever, eventData) => reciever.OnSendRosAvatarPoseMessage(avatarPose)
            );
        }
Beispiel #2
0
        public void OnReceiveRosMessage(RosBridge.human_navigation.HumanNaviMsg humanNaviMsg)
        {
            if (this.receivedMessageMap.ContainsKey(humanNaviMsg.message))
            {
                this.receivedMessageMap[humanNaviMsg.message] = true;

                if (humanNaviMsg.message == MsgGiveUp)
                {
                    this.OnGiveUp();
                }
                else if (humanNaviMsg.message == MsgGetAvatarPose)
                {
                    RosBridge.human_navigation.HumanNaviAvatarPose avatarPose = new RosBridge.human_navigation.HumanNaviAvatarPose();

                    avatarPose.head.position          = ConvertCoorinateSystemUnityToROS_Position(this.head.transform.position);
                    avatarPose.head.orientation       = ConvertCoorinateSystemUnityToROS_Rotation(this.head.transform.rotation);
                    avatarPose.left_hand.position     = ConvertCoorinateSystemUnityToROS_Position(this.LeftHand.transform.position);
                    avatarPose.left_hand.orientation  = ConvertCoorinateSystemUnityToROS_Rotation(this.LeftHand.transform.rotation);
                    avatarPose.right_hand.position    = ConvertCoorinateSystemUnityToROS_Position(this.rightHand.transform.position);
                    avatarPose.right_hand.orientation = ConvertCoorinateSystemUnityToROS_Rotation(this.rightHand.transform.rotation);

                    this.SendRosAvatarPoseMessage(avatarPose);
                }
                else if (humanNaviMsg.message == MsgConfirmSpeechState)
                {
                    if (this.isDuringTrial)
                    {
                        this.SendRosHumanNaviMessage(MsgSpeechState, this.sessionManager.GetSeechRunStateMsgString());
                    }
                }
            }
            else
            {
                SIGVerseLogger.Warn("Received Illegal message : " + humanNaviMsg.message);
            }
        }