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;
                IntPtr        ptr;
                int           x__size;

                //solution
                if (solution == null)
                {
                    solution = new Messages.trajectory_msgs.JointTrajectory();
                }
                pieces.Add(solution.Serialize(true));
                //error_code
                if (error_code == null)
                {
                    error_code = new Messages.moveit_msgs.MoveItErrorCodes();
                }
                pieces.Add(error_code.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);
            }
Exemplo n.º 2
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;
     IntPtr ptr;
     int x__size;
     
     //path
     hasmetacomponents |= true;
     if (path == null)
         path = new Messages.xamlamoveit_msgs.JointPathPoint[0];
     pieces.Add(BitConverter.GetBytes(path.Length));
     for (int i=0;i<path.Length; i++) {
         //path[i]
         if (path[i] == null)
             path[i] = new Messages.xamlamoveit_msgs.JointPathPoint();
         pieces.Add(path[i].Serialize(true));
     }
     //joint_names
     hasmetacomponents |= false;
     if (joint_names == null)
         joint_names = new string[0];
     pieces.Add(BitConverter.GetBytes(joint_names.Length));
     for (int i=0;i<joint_names.Length; i++) {
         //joint_names[i]
         if (joint_names[i] == null)
             joint_names[i] = "";
         scratch1 = Encoding.ASCII.GetBytes((string)joint_names[i]);
         thischunk = new byte[scratch1.Length + 4];
         scratch2 = BitConverter.GetBytes(scratch1.Length);
         Array.Copy(scratch1, 0, thischunk, 4, scratch1.Length);
         Array.Copy(scratch2, thischunk, 4);
         pieces.Add(thischunk);
     }
     //error_code
     if (error_code == null)
         error_code = new Messages.moveit_msgs.MoveItErrorCodes();
     pieces.Add(error_code.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;
 }
Exemplo n.º 3
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;
                IntPtr        ptr;
                int           x__size;

                //path
                hasmetacomponents |= false;
                if (path == null)
                {
                    path = new Messages.geometry_msgs.PoseStamped[0];
                }
                pieces.Add(BitConverter.GetBytes(path.Length));
                for (int i = 0; i < path.Length; i++)
                {
                    //path[i]
                    if (path[i] == null)
                    {
                        path[i] = new Messages.geometry_msgs.PoseStamped();
                    }
                    pieces.Add(path[i].Serialize(true));
                }
                //error_code
                if (error_code == null)
                {
                    error_code = new Messages.moveit_msgs.MoveItErrorCodes();
                }
                pieces.Add(error_code.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);
            }