00001 """autogenerated by genmsg_py from RawScan.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class RawScan(roslib.message.Message):
00008 _md5sum = "a36da642742ddd79774fbc755f9c5cdd"
00009 _type = "velodyne_common/RawScan"
00010 _has_header = True
00011 _full_text = """# Raw Velodyne LIDAR input.
00012
00013 uint32 PACKET_SIZE = 1206
00014 uint32 PACKETS_PER_REVOLUTION = 260
00015
00016 Header header # standard ROS message header
00017 uint8[] data # data array
00018
00019
00020 ================================================================================
00021 MSG: std_msgs/Header
00022 # Standard metadata for higher-level stamped data types.
00023 # This is generally used to communicate timestamped data
00024 # in a particular coordinate frame.
00025 #
00026 # sequence ID: consecutively increasing ID
00027 uint32 seq
00028 #Two-integer timestamp that is expressed as:
00029 # * stamp.secs: seconds (stamp_secs) since epoch
00030 # * stamp.nsecs: nanoseconds since stamp_secs
00031 # time-handling sugar is provided by the client library
00032 time stamp
00033 #Frame this data is associated with
00034 # 0: no frame
00035 # 1: global frame
00036 string frame_id
00037
00038 """
00039
00040 PACKET_SIZE = 1206
00041 PACKETS_PER_REVOLUTION = 260
00042
00043 __slots__ = ['header','data']
00044 _slot_types = ['Header','uint8[]']
00045
00046 def __init__(self, *args, **kwds):
00047 """
00048 Constructor. Any message fields that are implicitly/explicitly
00049 set to None will be assigned a default value. The recommend
00050 use is keyword arguments as this is more robust to future message
00051 changes. You cannot mix in-order arguments and keyword arguments.
00052
00053 The available fields are:
00054 header,data
00055
00056 @param args: complete set of field values, in .msg order
00057 @param kwds: use keyword arguments corresponding to message field names
00058 to set specific fields.
00059 """
00060 if args or kwds:
00061 super(RawScan, self).__init__(*args, **kwds)
00062
00063 if self.header is None:
00064 self.header = std_msgs.msg._Header.Header()
00065 if self.data is None:
00066 self.data = ''
00067 else:
00068 self.header = std_msgs.msg._Header.Header()
00069 self.data = ''
00070
00071 def _get_types(self):
00072 """
00073 internal API method
00074 """
00075 return self._slot_types
00076
00077 def serialize(self, buff):
00078 """
00079 serialize message into buffer
00080 @param buff: buffer
00081 @type buff: StringIO
00082 """
00083 try:
00084 _x = self
00085 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00086 _x = self.header.frame_id
00087 length = len(_x)
00088 buff.write(struct.pack('<I%ss'%length, length, _x))
00089 _x = self.data
00090 length = len(_x)
00091
00092 if type(_x) in [list, tuple]:
00093 buff.write(struct.pack('<I%sB'%length, length, *_x))
00094 else:
00095 buff.write(struct.pack('<I%ss'%length, length, _x))
00096 except struct.error, se: self._check_types(se)
00097 except TypeError, te: self._check_types(te)
00098
00099 def deserialize(self, str):
00100 """
00101 unpack serialized message in str into this message instance
00102 @param str: byte array of serialized message
00103 @type str: str
00104 """
00105 try:
00106 if self.header is None:
00107 self.header = std_msgs.msg._Header.Header()
00108 end = 0
00109 _x = self
00110 start = end
00111 end += 12
00112 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00113 start = end
00114 end += 4
00115 (length,) = _struct_I.unpack(str[start:end])
00116 start = end
00117 end += length
00118 self.header.frame_id = str[start:end]
00119 start = end
00120 end += 4
00121 (length,) = _struct_I.unpack(str[start:end])
00122 start = end
00123 end += length
00124 self.data = str[start:end]
00125 return self
00126 except struct.error, e:
00127 raise roslib.message.DeserializationError(e)
00128
00129
00130 def serialize_numpy(self, buff, numpy):
00131 """
00132 serialize message with numpy array types into buffer
00133 @param buff: buffer
00134 @type buff: StringIO
00135 @param numpy: numpy python module
00136 @type numpy module
00137 """
00138 try:
00139 _x = self
00140 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00141 _x = self.header.frame_id
00142 length = len(_x)
00143 buff.write(struct.pack('<I%ss'%length, length, _x))
00144 _x = self.data
00145 length = len(_x)
00146
00147 if type(_x) in [list, tuple]:
00148 buff.write(struct.pack('<I%sB'%length, length, *_x))
00149 else:
00150 buff.write(struct.pack('<I%ss'%length, length, _x))
00151 except struct.error, se: self._check_types(se)
00152 except TypeError, te: self._check_types(te)
00153
00154 def deserialize_numpy(self, str, numpy):
00155 """
00156 unpack serialized message in str into this message instance using numpy for array types
00157 @param str: byte array of serialized message
00158 @type str: str
00159 @param numpy: numpy python module
00160 @type numpy: module
00161 """
00162 try:
00163 if self.header is None:
00164 self.header = std_msgs.msg._Header.Header()
00165 end = 0
00166 _x = self
00167 start = end
00168 end += 12
00169 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00170 start = end
00171 end += 4
00172 (length,) = _struct_I.unpack(str[start:end])
00173 start = end
00174 end += length
00175 self.header.frame_id = str[start:end]
00176 start = end
00177 end += 4
00178 (length,) = _struct_I.unpack(str[start:end])
00179 start = end
00180 end += length
00181 self.data = str[start:end]
00182 return self
00183 except struct.error, e:
00184 raise roslib.message.DeserializationError(e)
00185
00186 _struct_I = roslib.message.struct_I
00187 _struct_3I = struct.Struct("<3I")