Пример #1
0
        public override bool Equals(IRosMessage ____other)
        {
            if (____other == null)
            {
                return(false);
            }
            bool ret = true;

            hector_uav_msgs.LandingActionResult other = (hector_uav_msgs.LandingActionResult)____other;

            ret &= header.Equals(other.header);
            ret &= status.Equals(other.status);
            ret &= result.Equals(other.result);
            // for each SingleType st:
            //    ret &= {st.Name} == other.{st.Name};
            return(ret);
        }
        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;

            //action_goal
            action_goal = new hector_uav_msgs.LandingActionGoal(SERIALIZEDSTUFF, ref currentIndex);
            //action_result
            action_result = new hector_uav_msgs.LandingActionResult(SERIALIZEDSTUFF, ref currentIndex);
            //action_feedback
            action_feedback = new hector_uav_msgs.LandingActionFeedback(SERIALIZEDSTUFF, ref currentIndex);
        }
Пример #3
0
        public override AActionResult Clone()
        {
            LandingActionResult lar = new LandingActionResult();

            lar.header                   = new Header();
            lar.header.Frame_id          = header.Frame_id;
            lar.header.Seq               = header.Seq;
            lar.header.Stamp             = new Time(header.Stamp.data);
            lar.GoalStatus               = new GoalStatus();
            lar.GoalStatus.goal_id       = new GoalID();
            lar.GoalStatus.goal_id.id    = status.goal_id.id;
            lar.GoalStatus.goal_id.stamp = new Time(status.goal_id.stamp.data);
            lar.GoalStatus.status        = status.status;
            lar.GoalStatus.text          = status.text;
            lar.result                   = (LandingResult)result.Clone();

            return(lar);
        }
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //action_goal
            action_goal = new hector_uav_msgs.LandingActionGoal();
            action_goal.Randomize();
            //action_result
            action_result = new hector_uav_msgs.LandingActionResult();
            action_result.Randomize();
            //action_feedback
            action_feedback = new hector_uav_msgs.LandingActionFeedback();
            action_feedback.Randomize();
        }
        public override byte[] Serialize(bool partofsomethingelse)
        {
            int  currentIndex = 0, length = 0;
            bool hasmetacomponents = false;

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

            //action_goal
            if (action_goal == null)
            {
                action_goal = new hector_uav_msgs.LandingActionGoal();
            }
            pieces.Add(action_goal.Serialize(true));
            //action_result
            if (action_result == null)
            {
                action_result = new hector_uav_msgs.LandingActionResult();
            }
            pieces.Add(action_result.Serialize(true));
            //action_feedback
            if (action_feedback == null)
            {
                action_feedback = new hector_uav_msgs.LandingActionFeedback();
            }
            pieces.Add(action_feedback.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);
        }