public override int Deserialize(System.Byte[] serialized, int startIndex)
            {
                int curIndex = startIndex;

                curIndex += header.Deserialize(serialized, curIndex);
                System.UInt32 joint_names_len = BitConverter.ToUInt32(serialized, curIndex);
                curIndex += BitConverter.GetBytes(joint_names_len).Length;
                for (int i = 0; i < (int)joint_names_len; i++)
                {
                    System.UInt32 element_len = BitConverter.ToUInt32(serialized, curIndex);
                    curIndex += BitConverter.GetBytes(element_len).Length;
                    string element = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)element_len);
                    curIndex += (int)element_len;
                    joint_names.Add(element);
                }
                System.UInt32 points_len = BitConverter.ToUInt32(serialized, curIndex);
                curIndex += BitConverter.GetBytes(points_len).Length;
                for (int i = 0; i < (int)points_len; i++)
                {
                    trajectory_msgs.JointTrajectoryPoint element = new trajectory_msgs.JointTrajectoryPoint();
                    curIndex += element.Deserialize(serialized, curIndex);
                    points.Add(element);
                }
                return(curIndex - startIndex);
            }
Exemple #2
0
        public override bool Equals(IRosMessage ____other)
        {
            if (____other == null)
            {
                return(false);
            }
            bool ret = true;

            trajectory_msgs.JointTrajectoryPoint other = (Messages.trajectory_msgs.JointTrajectoryPoint)____other;

            if (positions.Length != other.positions.Length)
            {
                return(false);
            }
            for (int __i__ = 0; __i__ < positions.Length; __i__++)
            {
                ret &= positions[__i__] == other.positions[__i__];
            }
            if (velocities.Length != other.velocities.Length)
            {
                return(false);
            }
            for (int __i__ = 0; __i__ < velocities.Length; __i__++)
            {
                ret &= velocities[__i__] == other.velocities[__i__];
            }
            if (accelerations.Length != other.accelerations.Length)
            {
                return(false);
            }
            for (int __i__ = 0; __i__ < accelerations.Length; __i__++)
            {
                ret &= accelerations[__i__] == other.accelerations[__i__];
            }
            if (effort.Length != other.effort.Length)
            {
                return(false);
            }
            for (int __i__ = 0; __i__ < effort.Length; __i__++)
            {
                ret &= effort[__i__] == other.effort[__i__];
            }
            ret &= time_from_start.data.Equals(other.time_from_start.data);
            // for each SingleType st:
            //    ret &= {st.Name} == other.{st.Name};
            return(ret);
        }
 public override int Deserialize(System.Byte[] serialized, int startIndex)
 {
     int curIndex = startIndex;
     curIndex += header.Deserialize(serialized, curIndex);
     System.UInt32 joint_names_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(joint_names_len).Length;
     for (int i = 0; i < (int)joint_names_len; i++)
     {
         System.UInt32 element_len = BitConverter.ToUInt32(serialized, curIndex);
         curIndex += BitConverter.GetBytes(element_len).Length;
         string element = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)element_len);
         curIndex += (int)element_len;
         joint_names.Add(element);
     }
     System.UInt32 points_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(points_len).Length;
     for (int i = 0; i < (int)points_len; i++)
     {
         trajectory_msgs.JointTrajectoryPoint element = new trajectory_msgs.JointTrajectoryPoint();
         curIndex += element.Deserialize(serialized, curIndex);
         points.Add(element);
     }
     return (curIndex - startIndex);
 }