00001 """autogenerated by genmsg_py from DenseLaserObjectFeatures.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import calibration_msgs.msg
00006 import geometry_msgs.msg
00007 import std_msgs.msg
00008
00009 class DenseLaserObjectFeatures(roslib.message.Message):
00010 _md5sum = "b642d46e47d54e00f98a3d98b02b5cc6"
00011 _type = "calibration_msgs/DenseLaserObjectFeatures"
00012 _has_header = True
00013 _full_text = """# Synchronized with sensor output
00014 Header header
00015
00016 # Pixel locations of detected features
00017 DenseLaserPoint[] dense_laser_points
00018
00019 # Defines geometry of detected features in some "object" coordinate frame
00020 geometry_msgs/Point[] object_points
00021
00022 # False on detection failure or partial detection
00023 uint8 success
00024
00025 ================================================================================
00026 MSG: std_msgs/Header
00027 # Standard metadata for higher-level stamped data types.
00028 # This is generally used to communicate timestamped data
00029 # in a particular coordinate frame.
00030 #
00031 # sequence ID: consecutively increasing ID
00032 uint32 seq
00033 #Two-integer timestamp that is expressed as:
00034 # * stamp.secs: seconds (stamp_secs) since epoch
00035 # * stamp.nsecs: nanoseconds since stamp_secs
00036 # time-handling sugar is provided by the client library
00037 time stamp
00038 #Frame this data is associated with
00039 # 0: no frame
00040 # 1: global frame
00041 string frame_id
00042
00043 ================================================================================
00044 MSG: calibration_msgs/DenseLaserPoint
00045 # Stores the xy subpixel location of a point in a DenseLaserSnapshot
00046 float64 scan # Which scan line we detected the feature
00047 float64 ray # Which ray in the specified scan we detected the feature
00048
00049 ================================================================================
00050 MSG: geometry_msgs/Point
00051 # This contains the position of a point in free space
00052 float64 x
00053 float64 y
00054 float64 z
00055
00056 """
00057 __slots__ = ['header','dense_laser_points','object_points','success']
00058 _slot_types = ['Header','calibration_msgs/DenseLaserPoint[]','geometry_msgs/Point[]','uint8']
00059
00060 def __init__(self, *args, **kwds):
00061 """
00062 Constructor. Any message fields that are implicitly/explicitly
00063 set to None will be assigned a default value. The recommend
00064 use is keyword arguments as this is more robust to future message
00065 changes. You cannot mix in-order arguments and keyword arguments.
00066
00067 The available fields are:
00068 header,dense_laser_points,object_points,success
00069
00070 @param args: complete set of field values, in .msg order
00071 @param kwds: use keyword arguments corresponding to message field names
00072 to set specific fields.
00073 """
00074 if args or kwds:
00075 super(DenseLaserObjectFeatures, self).__init__(*args, **kwds)
00076
00077 if self.header is None:
00078 self.header = std_msgs.msg._Header.Header()
00079 if self.dense_laser_points is None:
00080 self.dense_laser_points = []
00081 if self.object_points is None:
00082 self.object_points = []
00083 if self.success is None:
00084 self.success = 0
00085 else:
00086 self.header = std_msgs.msg._Header.Header()
00087 self.dense_laser_points = []
00088 self.object_points = []
00089 self.success = 0
00090
00091 def _get_types(self):
00092 """
00093 internal API method
00094 """
00095 return self._slot_types
00096
00097 def serialize(self, buff):
00098 """
00099 serialize message into buffer
00100 @param buff: buffer
00101 @type buff: StringIO
00102 """
00103 try:
00104 _x = self
00105 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00106 _x = self.header.frame_id
00107 length = len(_x)
00108 buff.write(struct.pack('<I%ss'%length, length, _x))
00109 length = len(self.dense_laser_points)
00110 buff.write(_struct_I.pack(length))
00111 for val1 in self.dense_laser_points:
00112 _x = val1
00113 buff.write(_struct_2d.pack(_x.scan, _x.ray))
00114 length = len(self.object_points)
00115 buff.write(_struct_I.pack(length))
00116 for val1 in self.object_points:
00117 _x = val1
00118 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00119 buff.write(_struct_B.pack(self.success))
00120 except struct.error, se: self._check_types(se)
00121 except TypeError, te: self._check_types(te)
00122
00123 def deserialize(self, str):
00124 """
00125 unpack serialized message in str into this message instance
00126 @param str: byte array of serialized message
00127 @type str: str
00128 """
00129 try:
00130 if self.header is None:
00131 self.header = std_msgs.msg._Header.Header()
00132 end = 0
00133 _x = self
00134 start = end
00135 end += 12
00136 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00137 start = end
00138 end += 4
00139 (length,) = _struct_I.unpack(str[start:end])
00140 start = end
00141 end += length
00142 self.header.frame_id = str[start:end]
00143 start = end
00144 end += 4
00145 (length,) = _struct_I.unpack(str[start:end])
00146 self.dense_laser_points = []
00147 for i in xrange(0, length):
00148 val1 = calibration_msgs.msg.DenseLaserPoint()
00149 _x = val1
00150 start = end
00151 end += 16
00152 (_x.scan, _x.ray,) = _struct_2d.unpack(str[start:end])
00153 self.dense_laser_points.append(val1)
00154 start = end
00155 end += 4
00156 (length,) = _struct_I.unpack(str[start:end])
00157 self.object_points = []
00158 for i in xrange(0, length):
00159 val1 = geometry_msgs.msg.Point()
00160 _x = val1
00161 start = end
00162 end += 24
00163 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00164 self.object_points.append(val1)
00165 start = end
00166 end += 1
00167 (self.success,) = _struct_B.unpack(str[start:end])
00168 return self
00169 except struct.error, e:
00170 raise roslib.message.DeserializationError(e)
00171
00172
00173 def serialize_numpy(self, buff, numpy):
00174 """
00175 serialize message with numpy array types into buffer
00176 @param buff: buffer
00177 @type buff: StringIO
00178 @param numpy: numpy python module
00179 @type numpy module
00180 """
00181 try:
00182 _x = self
00183 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00184 _x = self.header.frame_id
00185 length = len(_x)
00186 buff.write(struct.pack('<I%ss'%length, length, _x))
00187 length = len(self.dense_laser_points)
00188 buff.write(_struct_I.pack(length))
00189 for val1 in self.dense_laser_points:
00190 _x = val1
00191 buff.write(_struct_2d.pack(_x.scan, _x.ray))
00192 length = len(self.object_points)
00193 buff.write(_struct_I.pack(length))
00194 for val1 in self.object_points:
00195 _x = val1
00196 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00197 buff.write(_struct_B.pack(self.success))
00198 except struct.error, se: self._check_types(se)
00199 except TypeError, te: self._check_types(te)
00200
00201 def deserialize_numpy(self, str, numpy):
00202 """
00203 unpack serialized message in str into this message instance using numpy for array types
00204 @param str: byte array of serialized message
00205 @type str: str
00206 @param numpy: numpy python module
00207 @type numpy: module
00208 """
00209 try:
00210 if self.header is None:
00211 self.header = std_msgs.msg._Header.Header()
00212 end = 0
00213 _x = self
00214 start = end
00215 end += 12
00216 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00217 start = end
00218 end += 4
00219 (length,) = _struct_I.unpack(str[start:end])
00220 start = end
00221 end += length
00222 self.header.frame_id = str[start:end]
00223 start = end
00224 end += 4
00225 (length,) = _struct_I.unpack(str[start:end])
00226 self.dense_laser_points = []
00227 for i in xrange(0, length):
00228 val1 = calibration_msgs.msg.DenseLaserPoint()
00229 _x = val1
00230 start = end
00231 end += 16
00232 (_x.scan, _x.ray,) = _struct_2d.unpack(str[start:end])
00233 self.dense_laser_points.append(val1)
00234 start = end
00235 end += 4
00236 (length,) = _struct_I.unpack(str[start:end])
00237 self.object_points = []
00238 for i in xrange(0, length):
00239 val1 = geometry_msgs.msg.Point()
00240 _x = val1
00241 start = end
00242 end += 24
00243 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00244 self.object_points.append(val1)
00245 start = end
00246 end += 1
00247 (self.success,) = _struct_B.unpack(str[start:end])
00248 return self
00249 except struct.error, e:
00250 raise roslib.message.DeserializationError(e)
00251
00252 _struct_I = roslib.message.struct_I
00253 _struct_2d = struct.Struct("<2d")
00254 _struct_3I = struct.Struct("<3I")
00255 _struct_B = struct.Struct("<B")
00256 _struct_3d = struct.Struct("<3d")