コード例 #1
0
 /// <summary>
 /// Create an instance of <c>ActionFailedExeption</c> using an action name and a goal status
 /// </summary>
 /// <param name="actionName">The name of the action</param>
 /// <param name="goalStatus">The goal status as an instance of <c>actionlib_msgs.GoalStatus</c></param>
 public ActionFailedExeption(string actionName, actionlib_msgs.GoalStatus goalStatus)
     : base($"The action '{actionName}' failed with final goal status '{GetGoalStatusString(goalStatus)}': {goalStatus?.text}")
 {
     this.ActionName      = actionName;
     this.FinalGoalStatus = ((GoalStatus?)goalStatus?.status) ?? GoalStatus.LOST;
     this.StatusText      = goalStatus?.text;
 }
コード例 #2
0
        /// <summary>
        /// Get the goal status
        /// </summary>
        /// <param name="goalStatus">The goal status as an instance of <c>actionlib_msgs.GoalStatus</c></param>
        /// <returns>Returns the goal status as <c>string</c>.</returns>
        public static string GetGoalStatusString(actionlib_msgs.GoalStatus goalStatus)
        {
            if (goalStatus == null)
            {
                return("null");
            }

            if (Enum.IsDefined(typeof(GoalStatus), goalStatus.status))
            {
                GoalStatus status = (GoalStatus)goalStatus.status;
                return(status.ToString("g"));
            }
            return($"INVALID GOAL STATUS {goalStatus.status}");
        }
コード例 #3
0
 public override int Deserialize(System.Byte[] serialized, int startIndex)
 {
     int curIndex = startIndex;
     curIndex += header.Deserialize(serialized, curIndex);
     System.UInt32 status_list_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(status_list_len).Length;
     for (int i = 0; i < (int)status_list_len; i++)
     {
         actionlib_msgs.GoalStatus element = new actionlib_msgs.GoalStatus();
         curIndex += element.Deserialize(serialized, curIndex);
         status_list.Add(element);
     }
     return (curIndex - startIndex);
 }
コード例 #4
0
            public override int Deserialize(System.Byte[] serialized, int startIndex)
            {
                int curIndex = startIndex;

                curIndex += header.Deserialize(serialized, curIndex);
                System.UInt32 status_list_len = BitConverter.ToUInt32(serialized, curIndex);
                curIndex += BitConverter.GetBytes(status_list_len).Length;
                for (int i = 0; i < (int)status_list_len; i++)
                {
                    actionlib_msgs.GoalStatus element = new actionlib_msgs.GoalStatus();
                    curIndex += element.Deserialize(serialized, curIndex);
                    status_list.Add(element);
                }
                return(curIndex - startIndex);
            }
コード例 #5
0
        public override bool Equals(IRosMessage ____other)
        {
            if (____other == null)
            {
                return(false);
            }
            bool ret = true;

            actionlib_msgs.GoalStatus other = (Messages.actionlib_msgs.GoalStatus)____other;

            ret &= goal_id.Equals(other.goal_id);
            ret &= status == other.status;
            ret &= text == other.text;
            // for each SingleType st:
            //    ret &= {st.Name} == other.{st.Name};
            return(ret);
        }
コード例 #6
0
 public GetMapActionFeedback(std_msgs.Header header, actionlib_msgs.GoalStatus status, nav_msgs.GetMapFeedback feedback)
 {
     this.header   = header;
     this.status   = status;
     this.feedback = feedback;
 }
コード例 #7
0
 public GetMapActionFeedback()
 {
     this.header   = new std_msgs.Header();
     this.status   = new actionlib_msgs.GoalStatus();
     this.feedback = new nav_msgs.GetMapFeedback();
 }
コード例 #8
0
 public GetMapActionResult(std_msgs.Header header, actionlib_msgs.GoalStatus status, nav_msgs.GetMapResult result)
 {
     this.header = header;
     this.status = status;
     this.result = result;
 }
コード例 #9
0
 public GetMapActionResult()
 {
     this.header = new std_msgs.Header();
     this.status = new actionlib_msgs.GoalStatus();
     this.result = new nav_msgs.GetMapResult();
 }