00001
00002
00003 package ros.pkg.sensor_msgs.msg;
00004
00005 import java.nio.ByteBuffer;
00006
00007 public class PointCloud extends ros.communication.Message {
00008
00009 public ros.pkg.std_msgs.msg.Header header = new ros.pkg.std_msgs.msg.Header();
00010 public java.util.ArrayList<ros.pkg.geometry_msgs.msg.Point32> points = new java.util.ArrayList<ros.pkg.geometry_msgs.msg.Point32>();
00011 public java.util.ArrayList<ros.pkg.sensor_msgs.msg.ChannelFloat32> channels = new java.util.ArrayList<ros.pkg.sensor_msgs.msg.ChannelFloat32>();
00012
00013 public PointCloud() {
00014 }
00015
00016 public static java.lang.String __s_getDataType() { return "sensor_msgs/PointCloud"; }
00017 public java.lang.String getDataType() { return __s_getDataType(); }
00018 public static java.lang.String __s_getMD5Sum() { return "d8e9c3f5afbdd8a130fd1d2763945fca"; }
00019 public java.lang.String getMD5Sum() { return __s_getMD5Sum(); }
00020 public static java.lang.String __s_getMessageDefinition() { return "# This message holds a collection of 3d points, plus optional additional\n" +
00021 "# information about each point.\n" +
00022 "\n" +
00023 "# Time of sensor data acquisition, coordinate frame ID.\n" +
00024 "Header header\n" +
00025 "\n" +
00026 "# Array of 3d points. Each Point32 should be interpreted as a 3d point\n" +
00027 "# in the frame given in the header.\n" +
00028 "geometry_msgs/Point32[] points\n" +
00029 "\n" +
00030 "# Each channel should have the same number of elements as points array,\n" +
00031 "# and the data in each channel should correspond 1:1 with each point.\n" +
00032 "# Channel names in common practice are listed in ChannelFloat32.msg.\n" +
00033 "ChannelFloat32[] channels\n" +
00034 "\n" +
00035 "================================================================================\n" +
00036 "MSG: std_msgs/Header\n" +
00037 "# Standard metadata for higher-level stamped data types.\n" +
00038 "# This is generally used to communicate timestamped data \n" +
00039 "# in a particular coordinate frame.\n" +
00040 "# \n" +
00041 "# sequence ID: consecutively increasing ID \n" +
00042 "uint32 seq\n" +
00043 "#Two-integer timestamp that is expressed as:\n" +
00044 "# * stamp.secs: seconds (stamp_secs) since epoch\n" +
00045 "# * stamp.nsecs: nanoseconds since stamp_secs\n" +
00046 "# time-handling sugar is provided by the client library\n" +
00047 "time stamp\n" +
00048 "#Frame this data is associated with\n" +
00049 "# 0: no frame\n" +
00050 "# 1: global frame\n" +
00051 "string frame_id\n" +
00052 "\n" +
00053 "================================================================================\n" +
00054 "MSG: geometry_msgs/Point32\n" +
00055 "# This contains the position of a point in free space(with 32 bits of precision).\n" +
00056 "# It is recommeded to use Point wherever possible instead of Point32. \n" +
00057 "# \n" +
00058 "# This recommendation is to promote interoperability. \n" +
00059 "#\n" +
00060 "# This message is designed to take up less space when sending\n" +
00061 "# lots of points at once, as in the case of a PointCloud. \n" +
00062 "\n" +
00063 "float32 x\n" +
00064 "float32 y\n" +
00065 "float32 z\n" +
00066 "================================================================================\n" +
00067 "MSG: sensor_msgs/ChannelFloat32\n" +
00068 "# This message is used by the PointCloud message to hold optional data\n" +
00069 "# associated with each point in the cloud. The length of the values\n" +
00070 "# array should be the same as the length of the points array in the\n" +
00071 "# PointCloud, and each value should be associated with the corresponding\n" +
00072 "# point.\n" +
00073 "\n" +
00074 "# Channel names in existing practice include:\n" +
00075 "# \"u\", \"v\" - row and column (respectively) in the left stereo image.\n" +
00076 "# This is opposite to usual conventions but remains for\n" +
00077 "# historical reasons. The newer PointCloud2 message has no\n" +
00078 "# such problem.\n" +
00079 "# \"rgb\" - For point clouds produced by color stereo cameras. uint8\n" +
00080 "# (R,G,B) values packed into the least significant 24 bits,\n" +
00081 "# in order.\n" +
00082 "# \"intensity\" - laser or pixel intensity.\n" +
00083 "# \"distance\"\n" +
00084 "\n" +
00085 "# The channel name should give semantics of the channel (e.g.\n" +
00086 "# \"intensity\" instead of \"value\").\n" +
00087 "string name\n" +
00088 "\n" +
00089 "# The values array should be 1-1 with the elements of the associated\n" +
00090 "# PointCloud.\n" +
00091 "float32[] values\n" +
00092 "\n" +
00093 ""; }
00094 public java.lang.String getMessageDefinition() { return __s_getMessageDefinition(); }
00095
00096 public PointCloud clone() {
00097 PointCloud c = new PointCloud();
00098 c.deserialize(serialize(0));
00099 return c;
00100 }
00101
00102 public void setTo(ros.communication.Message m) {
00103 deserialize(m.serialize(0));
00104 }
00105
00106 public int serializationLength() {
00107 int __l = 0;
00108 __l += header.serializationLength();
00109 __l += 4;
00110 for(ros.pkg.geometry_msgs.msg.Point32 val : points) {
00111 __l += val.serializationLength();
00112 }
00113 __l += 4;
00114 for(ros.pkg.sensor_msgs.msg.ChannelFloat32 val : channels) {
00115 __l += val.serializationLength();
00116 }
00117 return __l;
00118 }
00119
00120 public void serialize(ByteBuffer bb, int seq) {
00121 header.serialize(bb, seq);
00122 bb.putInt(points.size());
00123 for(ros.pkg.geometry_msgs.msg.Point32 val : points) {
00124 val.serialize(bb, seq);
00125 }
00126 bb.putInt(channels.size());
00127 for(ros.pkg.sensor_msgs.msg.ChannelFloat32 val : channels) {
00128 val.serialize(bb, seq);
00129 }
00130 }
00131
00132 public void deserialize(ByteBuffer bb) {
00133 header.deserialize(bb);
00134
00135 int __points_len = bb.getInt();
00136 points = new java.util.ArrayList<ros.pkg.geometry_msgs.msg.Point32>(__points_len);
00137 for(int __i=0; __i<__points_len; __i++) {
00138 ros.pkg.geometry_msgs.msg.Point32 __tmp = new ros.pkg.geometry_msgs.msg.Point32();
00139 __tmp.deserialize(bb);
00140 points.add(__tmp);;
00141 }
00142
00143 int __channels_len = bb.getInt();
00144 channels = new java.util.ArrayList<ros.pkg.sensor_msgs.msg.ChannelFloat32>(__channels_len);
00145 for(int __i=0; __i<__channels_len; __i++) {
00146 ros.pkg.sensor_msgs.msg.ChannelFloat32 __tmp = new ros.pkg.sensor_msgs.msg.ChannelFloat32();
00147 __tmp.deserialize(bb);
00148 channels.add(__tmp);;
00149 }
00150 }
00151
00152 @SuppressWarnings("all")
00153 public boolean equals(Object o) {
00154 if(!(o instanceof PointCloud))
00155 return false;
00156 PointCloud other = (PointCloud) o;
00157 return
00158 header.equals(other.header) &&
00159 points.equals(other.points) &&
00160 channels.equals(other.channels) &&
00161 true;
00162 }
00163
00164 @SuppressWarnings("all")
00165 public int hashCode() {
00166 final int prime = 31;
00167 int result = 1;
00168 long tmp;
00169 result = prime * result + (this.header == null ? 0 : this.header.hashCode());
00170 result = prime * result + (this.points == null ? 0 : this.points.hashCode());
00171 result = prime * result + (this.channels == null ? 0 : this.channels.hashCode());
00172 return result;
00173 }
00174 }
00175