Пример #1
0
        public override void Deserialize(byte[] serializedMessage, ref int currentIndex)
        {
            int  arraylength       = -1;
            bool hasmetacomponents = false;

            //header
            header = new Header(serializedMessage, ref currentIndex);
            //status_list
            hasmetacomponents |= false;
            arraylength        = BitConverter.ToInt32(serializedMessage, currentIndex);
            currentIndex      += Marshal.SizeOf(typeof(System.Int32));
            if (status_list == null)
            {
                status_list = new GoalStatus[arraylength];
            }
            else
            {
                Array.Resize(ref status_list, arraylength);
            }
            for (int i = 0; i < status_list.Length; i++)
            {
                //status_list[i]
                status_list[i] = new GoalStatus(serializedMessage, ref currentIndex);
            }
        }
Пример #2
0
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //header
            header = new Header();
            header.Randomize();
            //status_list
            arraylength = rand.Next(10);
            if (status_list == null)
            {
                status_list = new Messages.actionlib_msgs.GoalStatus[arraylength];
            }
            else
            {
                Array.Resize(ref status_list, arraylength);
            }
            for (int i = 0; i < status_list.Length; i++)
            {
                //status_list[i]
                status_list[i] = new Messages.actionlib_msgs.GoalStatus();
                status_list[i].Randomize();
            }
        }
Пример #3
0
        public override void Deserialize(byte[] SERIALIZEDSTUFF, ref int currentIndex)
        {
            int    arraylength       = -1;
            bool   hasmetacomponents = false;
            object __thing;
            int    piecesize = 0;

            byte[] thischunk, scratch1, scratch2;
            IntPtr h;

            //header
            header = new Header(SERIALIZEDSTUFF, ref currentIndex);
            //status_list
            hasmetacomponents |= true;
            arraylength        = BitConverter.ToInt32(SERIALIZEDSTUFF, currentIndex);
            currentIndex      += Marshal.SizeOf(typeof(System.Int32));
            if (status_list == null)
            {
                status_list = new Messages.actionlib_msgs.GoalStatus[arraylength];
            }
            else
            {
                Array.Resize(ref status_list, arraylength);
            }
            for (int i = 0; i < status_list.Length; i++)
            {
                //status_list[i]
                status_list[i] = new Messages.actionlib_msgs.GoalStatus(SERIALIZEDSTUFF, ref currentIndex);
            }
        }
Пример #4
0
 public ActionFailedExeption(string actionName, Messages.actionlib_msgs.GoalStatus goalStatus)
     : base($"The action '{actionName}' failed with final goal status '{GetGoalStatusString( goalStatus )}': {goalStatus?.text}")
 {
     this.ActionName      = actionName;
     this.FinalGoalStatus = (goalStatus)?.status ?? GoalStatus.LOST;
     this.StatusText      = goalStatus?.text;
 }
Пример #5
0
        public override byte[] Serialize(bool partofsomethingelse)
        {
            List <byte[]> pieces = new List <byte[]>();

            if (Header == null)
            {
                Header = new std_msgs.Header();
            }
            pieces.Add(Header.Serialize(true));

            if (GoalStatus == null)
            {
                GoalStatus = new actionlib_msgs.GoalStatus();
            }
            pieces.Add(GoalStatus.Serialize(true));

            if (Content == null)
            {
                Content = new T();
            }
            pieces.Add(Content.Serialize(true));

            // combine every array in pieces into one array and return it
            int __a_b__f = pieces.Sum((__a_b__c) => __a_b__c.Length);
            int __a_b__e = 0;

            byte[] __a_b__d = new byte[__a_b__f];
            foreach (var __p__ in pieces)
            {
                Array.Copy(__p__, 0, __a_b__d, __a_b__e, __p__.Length);
                __a_b__e += __p__.Length;
            }
            return(__a_b__d);
        }
Пример #6
0
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();

            //header
            header = new Header();
            header.Randomize();
            //status_list
            arraylength = rand.Next(10);
            if (status_list == null)
            {
                status_list = new GoalStatus[arraylength];
            }
            else
            {
                Array.Resize(ref status_list, arraylength);
            }
            for (int i = 0; i < status_list.Length; i++)
            {
                //status_list[i]
                status_list[i] = new GoalStatus();
                status_list[i].Randomize();
            }
        }
Пример #7
0
 public override void Deserialize(byte[] serializedMessage, ref int currentIndex)
 {
     Header     = new std_msgs.Header(serializedMessage, ref currentIndex);
     GoalStatus = new actionlib_msgs.GoalStatus(serializedMessage, ref currentIndex);
     //Content = (T)Activator.CreateInstance( typeof( T ), serializedMessage, currentIndex );
     Content = (T)typeof(T).GetInstance();
     Content.Deserialize(serializedMessage, ref currentIndex);
 }
 public override void Deserialize(byte[] SERIALIZEDSTUFF, ref int currentIndex)
 {
     //header
     header = new Header(SERIALIZEDSTUFF, ref currentIndex);
     //status
     status = new Messages.actionlib_msgs.GoalStatus(SERIALIZEDSTUFF, ref currentIndex);
     //feedback
     feedback = new hector_uav_msgs.LandingFeedback(SERIALIZEDSTUFF, ref currentIndex);
 }
Пример #9
0
        public override void Deserialize(byte[] SERIALIZEDSTUFF, ref int currentIndex)
        {
            int    arraylength       = -1;
            bool   hasmetacomponents = false;
            object __thing;
            int    piecesize = 0;

            byte[] thischunk, scratch1, scratch2;
            IntPtr h;

            //header
            header = new Header(SERIALIZEDSTUFF, ref currentIndex);
            //status
            status = new Messages.actionlib_msgs.GoalStatus(SERIALIZEDSTUFF, ref currentIndex);
            //result
            result = new Messages.control_msgs.PointHeadResult(SERIALIZEDSTUFF, ref currentIndex);
        }
        public override void Deserialize(byte[] SERIALIZEDSTUFF, ref int currentIndex)
        {
            int    arraylength       = -1;
            bool   hasmetacomponents = false;
            object __thing;
            int    piecesize = 0;

            byte[] thischunk, scratch1, scratch2;
            IntPtr h;

            //header
            header = new Header(SERIALIZEDSTUFF, ref currentIndex);
            //status
            status = new Messages.actionlib_msgs.GoalStatus(SERIALIZEDSTUFF, ref currentIndex);
            //feedback
            feedback = new Messages.object_recognition_msgs.ObjectRecognitionFeedback(SERIALIZEDSTUFF, ref currentIndex);
        }
Пример #11
0
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //header
            header = new Header();
            header.Randomize();
            //status
            status = new Messages.actionlib_msgs.GoalStatus();
            status.Randomize();
            //feedback
            feedback = new Messages.control_msgs.FollowJointTrajectoryFeedback();
            feedback.Randomize();
        }
Пример #12
0
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //header
            header = new Header();
            header.Randomize();
            //status
            status = new Messages.actionlib_msgs.GoalStatus();
            status.Randomize();
            //result
            result = new Messages.control_msgs.PointHeadResult();
            result.Randomize();
        }
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //header
            header = new Header();
            header.Randomize();
            //status
            status = new Messages.actionlib_msgs.GoalStatus();
            status.Randomize();
            //result
            result = new Messages.humanoid_nav_msgs.ExecFootstepsResult();
            result.Randomize();
        }
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //header
            header = new Header();
            header.Randomize();
            //status
            status = new Messages.actionlib_msgs.GoalStatus();
            status.Randomize();
            //feedback
            feedback = new hector_uav_msgs.LandingFeedback();
            feedback.Randomize();
        }
Пример #15
0
        public override byte[] Serialize(bool partofsomethingelse)
        {
            int  currentIndex = 0, length = 0;
            bool hasmetacomponents = false;

            byte[]        thischunk, scratch1, scratch2;
            List <byte[]> pieces = new List <byte[]>();
            GCHandle      h;

            //header
            if (header == null)
            {
                header = new Header();
            }
            pieces.Add(header.Serialize(true));
            //status_list
            hasmetacomponents |= true;
            if (status_list == null)
            {
                status_list = new Messages.actionlib_msgs.GoalStatus[0];
            }
            pieces.Add(BitConverter.GetBytes(status_list.Length));
            for (int i = 0; i < status_list.Length; i++)
            {
                //status_list[i]
                if (status_list[i] == null)
                {
                    status_list[i] = new Messages.actionlib_msgs.GoalStatus();
                }
                pieces.Add(status_list[i].Serialize(true));
            }
            //combine every array in pieces into one array and return it
            int __a_b__f = pieces.Sum((__a_b__c) => __a_b__c.Length);
            int __a_b__e = 0;

            byte[] __a_b__d = new byte[__a_b__f];
            foreach (var __p__ in pieces)
            {
                Array.Copy(__p__, 0, __a_b__d, __a_b__e, __p__.Length);
                __a_b__e += __p__.Length;
            }
            return(__a_b__d);
        }
Пример #16
0
/*		public void updateFeedback<TFeedback> (ClientGoalHandle<ActionSpec> gh, TFeedback actionFeedback) where TFeedback : AActionFeedback, new()
 *              {
 *                      // Check if this feedback is for us
 *                      if ( actionGoal.GoalID.id != actionFeedback.GoalStatus.goal_id.id )
 * //			if ( actionGoal.goal_id.id != actionFeedback.status.goal_id.id )
 *                              return;
 *
 *                      if ( feedbackCallback != null )
 *                      {
 * //				EnclosureDeleter<const ActionFeedback> d(actionFeedback);
 * //				FeedbackConstPtr feedback(&(actionFeedback->feedback), d);
 *                              AFeedback feedback = actionFeedback.Feedback.Clone ();
 *                              feedbackCallback ( gh, feedback );
 *                      }
 *              }*/

        public void updateResult(ClientGoalHandle <ActionSpec> gh, AActionResult actionResult)
        {
            // Check if this feedback is for us
            if (actionGoal.GoalID.id != actionResult.GoalStatus.goal_id.id)
            {
//			if ( actionGoal.goal_id.id != actionResult.status.goal_id.id )
                return;
            }
            latest_goal_status_ = actionResult.GoalStatus;
//			latest_goal_status_ = actionResult.status;
            latestResult = actionResult;
            switch (state.state)
            {
            case CommState.StateEnum.WAITING_FOR_GOAL_ACK:
            case CommState.StateEnum.PENDING:
            case CommState.StateEnum.ACTIVE:
            case CommState.StateEnum.WAITING_FOR_RESULT:
            case CommState.StateEnum.WAITING_FOR_CANCEL_ACK:
            case CommState.StateEnum.RECALLING:
            case CommState.StateEnum.PREEMPTING:
            {
                // A little bit of hackery to call all the right state transitions before processing result
                gsarray      statusArray = new gsarray();
                List <gstat> list        = new List <gstat> (statusArray.status_list);
                list.Add(actionResult.GoalStatus);
//					list.Add ( actionResult.status );
                statusArray.status_list = list.ToArray();
                updateStatus(gh, statusArray);

                transitionToState(gh, CommState.StateEnum.DONE);
                break;
            }

            case CommState.StateEnum.DONE:
                ROS.Error("actionlib", "Got a result when we were already in the DONE state");
                break;

            default:
                ROS.Error("actionlib", "In a funny comm state: %u", state.state);
                break;
            }
        }
Пример #17
0
        public override byte[] Serialize(bool partofsomethingelse)
        {
            int  currentIndex = 0, length = 0;
            bool hasmetacomponents = false;

            byte[]        thischunk, scratch1, scratch2;
            List <byte[]> pieces = new List <byte[]>();
            GCHandle      h;

            //header
            if (header == null)
            {
                header = new Header();
            }
            pieces.Add(header.Serialize(true));
            //status
            if (status == null)
            {
                status = new Messages.actionlib_msgs.GoalStatus();
            }
            pieces.Add(status.Serialize(true));
            //result
            if (result == null)
            {
                result = new Messages.control_msgs.PointHeadResult();
            }
            pieces.Add(result.Serialize(true));
            //combine every array in pieces into one array and return it
            int __a_b__f = pieces.Sum((__a_b__c) => __a_b__c.Length);
            int __a_b__e = 0;

            byte[] __a_b__d = new byte[__a_b__f];
            foreach (var __p__ in pieces)
            {
                Array.Copy(__p__, 0, __a_b__d, __a_b__e, __p__.Length);
                __a_b__e += __p__.Length;
            }
            return(__a_b__d);
        }
Пример #18
0
        /**
         * \brief Get the terminal state information for this goal
         *
         * Possible States Are: RECALLED, REJECTED, PREEMPTED, ABORTED, SUCCEEDED, LOST
         * This call only makes sense if CommState==DONE. This will send ROS_WARNs if we're not in DONE
         * \return The terminal state
         */
        public TerminalState getTerminalState()
        {
            if (!isActive)
            {
                ROS.Error("actionlib", "Trying to getTerminalState on an inactive ClientGoalHandle. You are incorrectly using a ClientGoalHandle");
                return(new TerminalState(TerminalState.StateEnum.LOST));
            }

            DestructionGuard.ScopedProtector protector = new DestructionGuard.ScopedProtector(guard);
            if (!protector.isProtected())
            {
                ROS.Error("actionlib", "This action client associated with the goal handle has already been destructed. Ignoring this getTerminalState() call");
                return(new TerminalState(TerminalState.StateEnum.LOST));
            }

            UnityEngine.Debug.Assert(goalManager != null);
            lock ( lockObject )
            {
                CommState comm_state = listHandle.GetElement().getCommState();
//				CommState comm_state = listHandle.getElem()->getCommState();
                if (comm_state != CommState.StateEnum.DONE)
                {
                    ROS.Warn("actionlib", "Asking for the terminal state when we're in [%s]", comm_state.toString());
                }

                Messages.actionlib_msgs.GoalStatus goal_status = listHandle.GetElement().getGoalStatus();
//				Messages.actionlib_msgs.GoalStatus goal_status = listHandle.getElem()->getGoalStatus();

                switch (goal_status.status)
                {
                case gstat.PENDING:
                case gstat.ACTIVE:
                case gstat.PREEMPTING:
                case gstat.RECALLING:
                    ROS.Error("actionlib", "Asking for terminal state, but latest goal status is %u", goal_status.status);
                    return(new TerminalState(TerminalState.StateEnum.LOST, goal_status.text));

                case gstat.PREEMPTED:
                    return(new TerminalState(TerminalState.StateEnum.PREEMPTED, goal_status.text));

                case gstat.SUCCEEDED:
                    return(new TerminalState(TerminalState.StateEnum.SUCCEEDED, goal_status.text));

                case gstat.ABORTED:
                    return(new TerminalState(TerminalState.StateEnum.ABORTED, goal_status.text));

                case gstat.REJECTED:
                    return(new TerminalState(TerminalState.StateEnum.REJECTED, goal_status.text));

                case gstat.RECALLED:
                    return(new TerminalState(TerminalState.StateEnum.RECALLED, goal_status.text));

                case gstat.LOST:
                    return(new TerminalState(TerminalState.StateEnum.LOST, goal_status.text));

                default:
                    ROS.Error("actionlib", "Unknown goal status: %u", goal_status.status);
                    break;
                }

                ROS.Error("actionlib", "Bug in determining terminal state");
                return(new TerminalState(TerminalState.StateEnum.LOST, goal_status.text));
            }
        }
Пример #19
0
        // Transitions caused by messages
        public void updateStatus(ClientGoalHandle <ActionSpec> gh, gsarray statusArray)
        {
            gstat goal_status = findGoalStatus(statusArray.status_list);

            // It's possible to receive old GoalStatus messages over the wire, even after receiving Result with a terminal state.
            //   Thus, we want to ignore all status that we get after we're done, because it is irrelevant. (See trac #2721)
            if (state == CommState.StateEnum.DONE)
            {
                return;
            }

            if (goal_status != null)
            {
                latest_goal_status_ = goal_status;
            }
            else
            {
                if (state != CommState.StateEnum.WAITING_FOR_GOAL_ACK &&
                    state != CommState.StateEnum.WAITING_FOR_RESULT &&
                    state != CommState.StateEnum.DONE)
                {
                    processLost(gh);
                }
                return;
            }

            switch (state.state)
            {
            case CommState.StateEnum.WAITING_FOR_GOAL_ACK:
            {
                if (goal_status != null)
                {
                    switch (goal_status.status)
                    {
                    case gstat.PENDING:
                        transitionToState(gh, CommState.StateEnum.PENDING);
                        break;

                    case gstat.ACTIVE:
                        transitionToState(gh, CommState.StateEnum.ACTIVE);
                        break;

                    case gstat.PREEMPTED:
                        transitionToState(gh, CommState.StateEnum.ACTIVE);
                        transitionToState(gh, CommState.StateEnum.PREEMPTING);
                        transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                        break;

                    case gstat.SUCCEEDED:
                        transitionToState(gh, CommState.StateEnum.ACTIVE);
                        transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                        break;

                    case gstat.ABORTED:
                        transitionToState(gh, CommState.StateEnum.ACTIVE);
                        transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                        break;

                    case gstat.REJECTED:
                        transitionToState(gh, CommState.StateEnum.PENDING);
                        transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                        break;

                    case gstat.RECALLED:
                        transitionToState(gh, CommState.StateEnum.PENDING);
                        transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                        break;

                    case gstat.PREEMPTING:
                        transitionToState(gh, CommState.StateEnum.ACTIVE);
                        transitionToState(gh, CommState.StateEnum.PREEMPTING);
                        break;

                    case gstat.RECALLING:
                        transitionToState(gh, CommState.StateEnum.PENDING);
                        transitionToState(gh, CommState.StateEnum.RECALLING);
                        break;

                    default:
                        ROS.Error("actionlib", "BUG: Got an unknown status from the ActionServer. status = %u", goal_status.status);
                        break;
                    }
                }
                break;
            }

            case CommState.StateEnum.PENDING:
            {
                switch (goal_status.status)
                {
                case gstat.PENDING:
                    break;

                case gstat.ACTIVE:
                    transitionToState(gh, CommState.StateEnum.ACTIVE);
                    break;

                case gstat.PREEMPTED:
                    transitionToState(gh, CommState.StateEnum.ACTIVE);
                    transitionToState(gh, CommState.StateEnum.PREEMPTING);
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.SUCCEEDED:
                    transitionToState(gh, CommState.StateEnum.ACTIVE);
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.ABORTED:
                    transitionToState(gh, CommState.StateEnum.ACTIVE);
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.REJECTED:
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.RECALLED:
                    transitionToState(gh, CommState.StateEnum.RECALLING);
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.PREEMPTING:
                    transitionToState(gh, CommState.StateEnum.ACTIVE);
                    transitionToState(gh, CommState.StateEnum.PREEMPTING);
                    break;

                case gstat.RECALLING:
                    transitionToState(gh, CommState.StateEnum.RECALLING);
                    break;

                default:
                    ROS.Error("actionlib", "BUG: Got an unknown goal status from the ActionServer. status = %u", goal_status.status);
                    break;
                }
                break;
            }

            case CommState.StateEnum.ACTIVE:
            {
                switch (goal_status.status)
                {
                case gstat.PENDING:
                    ROS.Error("actionlib", "Invalid transition from ACTIVE to PENDING"); break;

                case gstat.ACTIVE:
                    break;

                case gstat.REJECTED:
                    ROS.Error("actionlib", "Invalid transition from ACTIVE to REJECTED"); break;

                case gstat.RECALLING:
                    ROS.Error("actionlib", "Invalid transition from ACTIVE to RECALLING"); break;

                case gstat.RECALLED:
                    ROS.Error("actionlib", "Invalid transition from ACTIVE to RECALLED"); break;

                case gstat.PREEMPTED:
                    transitionToState(gh, CommState.StateEnum.PREEMPTING);
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.SUCCEEDED:
                case gstat.ABORTED:
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT); break;

                case gstat.PREEMPTING:
                    transitionToState(gh, CommState.StateEnum.PREEMPTING); break;

                default:
                    ROS.Error("actionlib", "BUG: Got an unknown goal status from the ActionServer. status = %u", goal_status.status);
                    break;
                }
                break;
            }

            case CommState.StateEnum.WAITING_FOR_RESULT:
            {
                switch (goal_status.status)
                {
                case gstat.PENDING:
                    ROS.Error("actionlib", "Invalid Transition from WAITING_FOR_RESUT to PENDING"); break;

                case gstat.PREEMPTING:
                    ROS.Error("actionlib", "Invalid Transition from WAITING_FOR_RESUT to PREEMPTING"); break;

                case gstat.RECALLING:
                    ROS.Error("actionlib", "Invalid Transition from WAITING_FOR_RESUT to RECALLING"); break;

                case gstat.ACTIVE:
                case gstat.PREEMPTED:
                case gstat.SUCCEEDED:
                case gstat.ABORTED:
                case gstat.REJECTED:
                case gstat.RECALLED:
                    break;

                default:
                    ROS.Error("actionlib", "BUG: Got an unknown state from the ActionServer. status = %u", goal_status.status);
                    break;
                }
                break;
            }

            case CommState.StateEnum.WAITING_FOR_CANCEL_ACK:
            {
                switch (goal_status.status)
                {
                case gstat.PENDING:
                    break;

                case gstat.ACTIVE:
                    break;

                case gstat.SUCCEEDED:
                case gstat.ABORTED:
                case gstat.PREEMPTED:
                    transitionToState(gh, CommState.StateEnum.PREEMPTING);
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.RECALLED:
                    transitionToState(gh, CommState.StateEnum.RECALLING);
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.REJECTED:
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT); break;

                case gstat.PREEMPTING:
                    transitionToState(gh, CommState.StateEnum.PREEMPTING); break;

                case gstat.RECALLING:
                    transitionToState(gh, CommState.StateEnum.RECALLING); break;

                default:
                    ROS.Error("actionlib", "BUG: Got an unknown state from the ActionServer. status = %u", goal_status.status);
                    break;
                }
                break;
            }

            case CommState.StateEnum.RECALLING:
            {
                switch (goal_status.status)
                {
                case gstat.PENDING:
                    ROS.Error("actionlib", "Invalid Transition from RECALLING to PENDING"); break;

                case gstat.ACTIVE:
                    ROS.Error("actionlib", "Invalid Transition from RECALLING to ACTIVE"); break;

                case gstat.SUCCEEDED:
                case gstat.ABORTED:
                case gstat.PREEMPTED:
                    transitionToState(gh, CommState.StateEnum.PREEMPTING);
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.RECALLED:
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT);
                    break;

                case gstat.REJECTED:
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT); break;

                case gstat.PREEMPTING:
                    transitionToState(gh, CommState.StateEnum.PREEMPTING); break;

                case gstat.RECALLING:
                    break;

                default:
                    ROS.Error("actionlib", "BUG: Got an unknown state from the ActionServer. status = %u", goal_status.status);
                    break;
                }
                break;
            }

            case CommState.StateEnum.PREEMPTING:
            {
                switch (goal_status.status)
                {
                case gstat.PENDING:
                    ROS.Error("actionlib", "Invalid Transition from PREEMPTING to PENDING"); break;

                case gstat.ACTIVE:
                    ROS.Error("actionlib", "Invalid Transition from PREEMPTING to ACTIVE"); break;

                case gstat.REJECTED:
                    ROS.Error("actionlib", "Invalid Transition from PREEMPTING to REJECTED"); break;

                case gstat.RECALLING:
                    ROS.Error("actionlib", "Invalid Transition from PREEMPTING to RECALLING"); break;

                case gstat.RECALLED:
                    ROS.Error("actionlib", "Invalid Transition from PREEMPTING to RECALLED"); break;
                    break;

                case gstat.PREEMPTED:
                case gstat.SUCCEEDED:
                case gstat.ABORTED:
                    transitionToState(gh, CommState.StateEnum.WAITING_FOR_RESULT); break;

                case gstat.PREEMPTING:
                    break;

                default:
                    ROS.Error("actionlib", "BUG: Got an unknown state from the ActionServer. status = %u", goal_status.status);
                    break;
                }
                break;
            }

            case CommState.StateEnum.DONE:
            {
                switch (goal_status.status)
                {
                case gstat.PENDING:
                    ROS.Error("actionlib", "Invalid Transition from DONE to PENDING"); break;

                case gstat.ACTIVE:
                    ROS.Error("actionlib", "Invalid Transition from DONE to ACTIVE"); break;

                case gstat.RECALLING:
                    ROS.Error("actionlib", "Invalid Transition from DONE to RECALLING"); break;

                case gstat.PREEMPTING:
                    ROS.Error("actionlib", "Invalid Transition from DONE to PREEMPTING"); break;

                case gstat.PREEMPTED:
                case gstat.SUCCEEDED:
                case gstat.ABORTED:
                case gstat.RECALLED:
                case gstat.REJECTED:
                    break;

                default:
                    ROS.Error("actionlib", "BUG: Got an unknown state from the ActionServer. status = %u", goal_status.status);
                    break;
                }
                break;
            }

            default:
                ROS.Error("actionlib", "In a funny comm state: %u", state.state);
                break;
            }
        }