00001
00002
00003 package ros.pkg.sensor_msgs.msg;
00004
00005 import java.nio.ByteBuffer;
00006
00007 public class CompressedImage extends ros.communication.Message {
00008
00009 public ros.pkg.std_msgs.msg.Header header = new ros.pkg.std_msgs.msg.Header();
00010 public java.lang.String format = new java.lang.String();
00011 public short[] data = new short[0];
00012
00013 public CompressedImage() {
00014 }
00015
00016 public static java.lang.String __s_getDataType() { return "sensor_msgs/CompressedImage"; }
00017 public java.lang.String getDataType() { return __s_getDataType(); }
00018 public static java.lang.String __s_getMD5Sum() { return "8f7a12909da2c9d3332d540a0977563f"; }
00019 public java.lang.String getMD5Sum() { return __s_getMD5Sum(); }
00020 public static java.lang.String __s_getMessageDefinition() { return "# This message contains a compressed image\n" +
00021 "\n" +
00022 "Header header # Header timestamp should be acquisition time of image\n" +
00023 " # Header frame_id should be optical frame of camera\n" +
00024 " # origin of frame should be optical center of cameara\n" +
00025 " # +x should point to the right in the image\n" +
00026 " # +y should point down in the image\n" +
00027 " # +z should point into to plane of the image\n" +
00028 "\n" +
00029 "string format # Specifies the format of the data\n" +
00030 " # Acceptable values:\n" +
00031 " # jpeg, png\n" +
00032 "uint8[] data # Compressed image buffer\n" +
00033 "\n" +
00034 "================================================================================\n" +
00035 "MSG: std_msgs/Header\n" +
00036 "# Standard metadata for higher-level stamped data types.\n" +
00037 "# This is generally used to communicate timestamped data \n" +
00038 "# in a particular coordinate frame.\n" +
00039 "# \n" +
00040 "# sequence ID: consecutively increasing ID \n" +
00041 "uint32 seq\n" +
00042 "#Two-integer timestamp that is expressed as:\n" +
00043 "# * stamp.secs: seconds (stamp_secs) since epoch\n" +
00044 "# * stamp.nsecs: nanoseconds since stamp_secs\n" +
00045 "# time-handling sugar is provided by the client library\n" +
00046 "time stamp\n" +
00047 "#Frame this data is associated with\n" +
00048 "# 0: no frame\n" +
00049 "# 1: global frame\n" +
00050 "string frame_id\n" +
00051 "\n" +
00052 ""; }
00053 public java.lang.String getMessageDefinition() { return __s_getMessageDefinition(); }
00054
00055 public CompressedImage clone() {
00056 CompressedImage c = new CompressedImage();
00057 c.deserialize(serialize(0));
00058 return c;
00059 }
00060
00061 public void setTo(ros.communication.Message m) {
00062 deserialize(m.serialize(0));
00063 }
00064
00065 public int serializationLength() {
00066 int __l = 0;
00067 __l += header.serializationLength();
00068 __l += 4 + format.length();
00069 __l += 4 + data.length * 1;
00070 return __l;
00071 }
00072
00073 public void serialize(ByteBuffer bb, int seq) {
00074 header.serialize(bb, seq);
00075 Serialization.writeString(bb, format);
00076 bb.putInt(data.length);
00077 for(short val : data) {
00078 bb.put((byte)val);
00079 }
00080 }
00081
00082 public void deserialize(ByteBuffer bb) {
00083 header.deserialize(bb);
00084 format = Serialization.readString(bb);
00085
00086 int __data_len = bb.getInt();
00087 data = new short[__data_len];
00088 for(int __i=0; __i<__data_len; __i++) {
00089 data[__i] = (short)(bb.get() & 0xff);
00090 }
00091 }
00092
00093 @SuppressWarnings("all")
00094 public boolean equals(Object o) {
00095 if(!(o instanceof CompressedImage))
00096 return false;
00097 CompressedImage other = (CompressedImage) o;
00098 return
00099 header.equals(other.header) &&
00100 format.equals(other.format) &&
00101 java.util.Arrays.equals(data, other.data) &&
00102 true;
00103 }
00104
00105 @SuppressWarnings("all")
00106 public int hashCode() {
00107 final int prime = 31;
00108 int result = 1;
00109 long tmp;
00110 result = prime * result + (this.header == null ? 0 : this.header.hashCode());
00111 result = prime * result + (this.format == null ? 0 : this.format.hashCode());
00112 result = prime * result + java.util.Arrays.hashCode(this.data);
00113 return result;
00114 }
00115 }
00116