public override int Deserialize(System.Byte[] serialized, int startIndex) { int curIndex = startIndex; curIndex += header.Deserialize(serialized, curIndex); height = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(height).Length; width = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(width).Length; System.UInt32 fields_len = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(fields_len).Length; for (int i = 0; i < (int)fields_len; i++) { sensor_msgs.PointField element = new sensor_msgs.PointField(); curIndex += element.Deserialize(serialized, curIndex); fields.Add(element); } is_bigendian = Convert.ToBoolean(serialized[curIndex]); curIndex++; point_step = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(point_step).Length; row_step = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(row_step).Length; System.UInt32 data_len = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(data_len).Length; System.Byte[] temp = new System.Byte[data_len]; Array.Copy(serialized, curIndex, temp, 0, data_len); data = temp.ToList(); curIndex += (int)data_len; is_dense = Convert.ToBoolean(serialized[curIndex]); curIndex++; return(curIndex - startIndex); }
public override bool Equals(IRosMessage ____other) { if (____other == null) { return(false); } bool ret = true; sensor_msgs.PointField other = (Messages.sensor_msgs.PointField)____other; ret &= name == other.name; ret &= offset == other.offset; ret &= datatype == other.datatype; ret &= count == other.count; // 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); height = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(height).Length; width = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(width).Length; System.UInt32 fields_len = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(fields_len).Length; for (int i = 0; i < (int)fields_len; i++) { sensor_msgs.PointField element = new sensor_msgs.PointField(); curIndex += element.Deserialize(serialized, curIndex); fields.Add(element); } is_bigendian = Convert.ToBoolean(serialized[curIndex]); curIndex++; point_step = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(point_step).Length; row_step = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(row_step).Length; compression_type = serialized[curIndex]; curIndex++; System.UInt32 compressed_data_len = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(compressed_data_len).Length; System.Byte[] temp = new System.Byte[compressed_data_len]; Array.Copy(serialized, curIndex, temp, 0, compressed_data_len); compressed_data = temp.ToList(); curIndex += (int)compressed_data_len; is_dense = Convert.ToBoolean(serialized[curIndex]); curIndex++; return (curIndex - startIndex); }