00001
00002
00003 package ros.pkg.sensor_msgs.msg;
00004
00005 import java.nio.ByteBuffer;
00006
00007 public class PointCloud2 extends ros.communication.Message {
00008
00009 public ros.pkg.std_msgs.msg.Header header = new ros.pkg.std_msgs.msg.Header();
00010 public long height;
00011 public long width;
00012 public java.util.ArrayList<ros.pkg.sensor_msgs.msg.PointField> fields = new java.util.ArrayList<ros.pkg.sensor_msgs.msg.PointField>();
00013 public boolean is_bigendian;
00014 public long point_step;
00015 public long row_step;
00016 public short[] data = new short[0];
00017 public boolean is_dense;
00018
00019 public PointCloud2() {
00020 }
00021
00022 public static java.lang.String __s_getDataType() { return "sensor_msgs/PointCloud2"; }
00023 public java.lang.String getDataType() { return __s_getDataType(); }
00024 public static java.lang.String __s_getMD5Sum() { return "1158d486dd51d683ce2f1be655c3c181"; }
00025 public java.lang.String getMD5Sum() { return __s_getMD5Sum(); }
00026 public static java.lang.String __s_getMessageDefinition() { return "# This message holds a collection of N-dimensional points, which may\n" +
00027 "# contain additional information such as normals, intensity, etc. The\n" +
00028 "# point data is stored as a binary blob, its layout described by the\n" +
00029 "# contents of the \"fields\" array.\n" +
00030 "\n" +
00031 "# The point cloud data may be organized 2d (image-like) or 1d\n" +
00032 "# (unordered). Point clouds organized as 2d images may be produced by\n" +
00033 "# camera depth sensors such as stereo or time-of-flight.\n" +
00034 "\n" +
00035 "# Time of sensor data acquisition, and the coordinate frame ID (for 3d\n" +
00036 "# points).\n" +
00037 "Header header\n" +
00038 "\n" +
00039 "# 2D structure of the point cloud. If the cloud is unordered, height is\n" +
00040 "# 1 and width is the length of the point cloud.\n" +
00041 "uint32 height\n" +
00042 "uint32 width\n" +
00043 "\n" +
00044 "# Describes the channels and their layout in the binary data blob.\n" +
00045 "PointField[] fields\n" +
00046 "\n" +
00047 "bool is_bigendian # Is this data bigendian?\n" +
00048 "uint32 point_step # Length of a point in bytes\n" +
00049 "uint32 row_step # Length of a row in bytes\n" +
00050 "uint8[] data # Actual point data, size is (row_step*height)\n" +
00051 "\n" +
00052 "bool is_dense # True if there are no invalid points\n" +
00053 "\n" +
00054 "================================================================================\n" +
00055 "MSG: std_msgs/Header\n" +
00056 "# Standard metadata for higher-level stamped data types.\n" +
00057 "# This is generally used to communicate timestamped data \n" +
00058 "# in a particular coordinate frame.\n" +
00059 "# \n" +
00060 "# sequence ID: consecutively increasing ID \n" +
00061 "uint32 seq\n" +
00062 "#Two-integer timestamp that is expressed as:\n" +
00063 "# * stamp.secs: seconds (stamp_secs) since epoch\n" +
00064 "# * stamp.nsecs: nanoseconds since stamp_secs\n" +
00065 "# time-handling sugar is provided by the client library\n" +
00066 "time stamp\n" +
00067 "#Frame this data is associated with\n" +
00068 "# 0: no frame\n" +
00069 "# 1: global frame\n" +
00070 "string frame_id\n" +
00071 "\n" +
00072 "================================================================================\n" +
00073 "MSG: sensor_msgs/PointField\n" +
00074 "# This message holds the description of one point entry in the\n" +
00075 "# PointCloud2 message format.\n" +
00076 "uint8 INT8 = 1\n" +
00077 "uint8 UINT8 = 2\n" +
00078 "uint8 INT16 = 3\n" +
00079 "uint8 UINT16 = 4\n" +
00080 "uint8 INT32 = 5\n" +
00081 "uint8 UINT32 = 6\n" +
00082 "uint8 FLOAT32 = 7\n" +
00083 "uint8 FLOAT64 = 8\n" +
00084 "\n" +
00085 "string name # Name of field\n" +
00086 "uint32 offset # Offset from start of point struct\n" +
00087 "uint8 datatype # Datatype enumeration, see above\n" +
00088 "uint32 count # How many elements in the field\n" +
00089 "\n" +
00090 ""; }
00091 public java.lang.String getMessageDefinition() { return __s_getMessageDefinition(); }
00092
00093 public PointCloud2 clone() {
00094 PointCloud2 c = new PointCloud2();
00095 c.deserialize(serialize(0));
00096 return c;
00097 }
00098
00099 public void setTo(ros.communication.Message m) {
00100 deserialize(m.serialize(0));
00101 }
00102
00103 public int serializationLength() {
00104 int __l = 0;
00105 __l += header.serializationLength();
00106 __l += 4;
00107 __l += 4;
00108 __l += 4;
00109 for(ros.pkg.sensor_msgs.msg.PointField val : fields) {
00110 __l += val.serializationLength();
00111 }
00112 __l += 1;
00113 __l += 4;
00114 __l += 4;
00115 __l += 4 + data.length * 1;
00116 __l += 1;
00117 return __l;
00118 }
00119
00120 public void serialize(ByteBuffer bb, int seq) {
00121 header.serialize(bb, seq);
00122 bb.putInt((int)height);
00123 bb.putInt((int)width);
00124 bb.putInt(fields.size());
00125 for(ros.pkg.sensor_msgs.msg.PointField val : fields) {
00126 val.serialize(bb, seq);
00127 }
00128 bb.put((byte)(is_bigendian ? 1 : 0));
00129 bb.putInt((int)point_step);
00130 bb.putInt((int)row_step);
00131 bb.putInt(data.length);
00132 for(short val : data) {
00133 bb.put((byte)val);
00134 }
00135 bb.put((byte)(is_dense ? 1 : 0));
00136 }
00137
00138 public void deserialize(ByteBuffer bb) {
00139 header.deserialize(bb);
00140 height = (long)(bb.getInt() & 0xffffffff);
00141 width = (long)(bb.getInt() & 0xffffffff);
00142
00143 int __fields_len = bb.getInt();
00144 fields = new java.util.ArrayList<ros.pkg.sensor_msgs.msg.PointField>(__fields_len);
00145 for(int __i=0; __i<__fields_len; __i++) {
00146 ros.pkg.sensor_msgs.msg.PointField __tmp = new ros.pkg.sensor_msgs.msg.PointField();
00147 __tmp.deserialize(bb);
00148 fields.add(__tmp);;
00149 }
00150 is_bigendian = bb.get() != 0 ? true : false;
00151 point_step = (long)(bb.getInt() & 0xffffffff);
00152 row_step = (long)(bb.getInt() & 0xffffffff);
00153
00154 int __data_len = bb.getInt();
00155 data = new short[__data_len];
00156 for(int __i=0; __i<__data_len; __i++) {
00157 data[__i] = (short)(bb.get() & 0xff);
00158 }
00159 is_dense = bb.get() != 0 ? true : false;
00160 }
00161
00162 @SuppressWarnings("all")
00163 public boolean equals(Object o) {
00164 if(!(o instanceof PointCloud2))
00165 return false;
00166 PointCloud2 other = (PointCloud2) o;
00167 return
00168 header.equals(other.header) &&
00169 height == other.height &&
00170 width == other.width &&
00171 fields.equals(other.fields) &&
00172 is_bigendian == other.is_bigendian &&
00173 point_step == other.point_step &&
00174 row_step == other.row_step &&
00175 java.util.Arrays.equals(data, other.data) &&
00176 is_dense == other.is_dense &&
00177 true;
00178 }
00179
00180 @SuppressWarnings("all")
00181 public int hashCode() {
00182 final int prime = 31;
00183 int result = 1;
00184 long tmp;
00185 result = prime * result + (this.header == null ? 0 : this.header.hashCode());
00186 result = prime * result + (int)(this.height ^ (this.height >>> 32));
00187 result = prime * result + (int)(this.width ^ (this.width >>> 32));
00188 result = prime * result + (this.fields == null ? 0 : this.fields.hashCode());
00189 result = prime * result + (this.is_bigendian ? 1231 : 1237);
00190 result = prime * result + (int)(this.point_step ^ (this.point_step >>> 32));
00191 result = prime * result + (int)(this.row_step ^ (this.row_step >>> 32));
00192 result = prime * result + java.util.Arrays.hashCode(this.data);
00193 result = prime * result + (this.is_dense ? 1231 : 1237);
00194 return result;
00195 }
00196 }
00197