00001 """autogenerated by genpy from srs_env_model_msgs/PlaneArray.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import geometry_msgs.msg
00008 import srs_env_model_msgs.msg
00009 import std_msgs.msg
00010
00011 class PlaneArray(genpy.Message):
00012 _md5sum = "f915b8673c2821d83cf7ad268a56dbb4"
00013 _type = "srs_env_model_msgs/PlaneArray"
00014 _has_header = True
00015 _full_text = """Header header
00016 PlaneDesc[] planes
00017
00018 ================================================================================
00019 MSG: std_msgs/Header
00020 # Standard metadata for higher-level stamped data types.
00021 # This is generally used to communicate timestamped data
00022 # in a particular coordinate frame.
00023 #
00024 # sequence ID: consecutively increasing ID
00025 uint32 seq
00026 #Two-integer timestamp that is expressed as:
00027 # * stamp.secs: seconds (stamp_secs) since epoch
00028 # * stamp.nsecs: nanoseconds since stamp_secs
00029 # time-handling sugar is provided by the client library
00030 time stamp
00031 #Frame this data is associated with
00032 # 0: no frame
00033 # 1: global frame
00034 string frame_id
00035
00036 ================================================================================
00037 MSG: srs_env_model_msgs/PlaneDesc
00038 int32 INSERT=0 # Clear old data, insert new one
00039 int32 MODIFY=1 # Modify plane
00040 int32 REMOVE=2 # Remove data
00041
00042 int32 id
00043 int32 flags
00044 geometry_msgs/Pose pose
00045 geometry_msgs/Vector3 scale
00046
00047 ================================================================================
00048 MSG: geometry_msgs/Pose
00049 # A representation of pose in free space, composed of postion and orientation.
00050 Point position
00051 Quaternion orientation
00052
00053 ================================================================================
00054 MSG: geometry_msgs/Point
00055 # This contains the position of a point in free space
00056 float64 x
00057 float64 y
00058 float64 z
00059
00060 ================================================================================
00061 MSG: geometry_msgs/Quaternion
00062 # This represents an orientation in free space in quaternion form.
00063
00064 float64 x
00065 float64 y
00066 float64 z
00067 float64 w
00068
00069 ================================================================================
00070 MSG: geometry_msgs/Vector3
00071 # This represents a vector in free space.
00072
00073 float64 x
00074 float64 y
00075 float64 z
00076 """
00077 __slots__ = ['header','planes']
00078 _slot_types = ['std_msgs/Header','srs_env_model_msgs/PlaneDesc[]']
00079
00080 def __init__(self, *args, **kwds):
00081 """
00082 Constructor. Any message fields that are implicitly/explicitly
00083 set to None will be assigned a default value. The recommend
00084 use is keyword arguments as this is more robust to future message
00085 changes. You cannot mix in-order arguments and keyword arguments.
00086
00087 The available fields are:
00088 header,planes
00089
00090 :param args: complete set of field values, in .msg order
00091 :param kwds: use keyword arguments corresponding to message field names
00092 to set specific fields.
00093 """
00094 if args or kwds:
00095 super(PlaneArray, self).__init__(*args, **kwds)
00096
00097 if self.header is None:
00098 self.header = std_msgs.msg.Header()
00099 if self.planes is None:
00100 self.planes = []
00101 else:
00102 self.header = std_msgs.msg.Header()
00103 self.planes = []
00104
00105 def _get_types(self):
00106 """
00107 internal API method
00108 """
00109 return self._slot_types
00110
00111 def serialize(self, buff):
00112 """
00113 serialize message into buffer
00114 :param buff: buffer, ``StringIO``
00115 """
00116 try:
00117 _x = self
00118 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00119 _x = self.header.frame_id
00120 length = len(_x)
00121 if python3 or type(_x) == unicode:
00122 _x = _x.encode('utf-8')
00123 length = len(_x)
00124 buff.write(struct.pack('<I%ss'%length, length, _x))
00125 length = len(self.planes)
00126 buff.write(_struct_I.pack(length))
00127 for val1 in self.planes:
00128 _x = val1
00129 buff.write(_struct_2i.pack(_x.id, _x.flags))
00130 _v1 = val1.pose
00131 _v2 = _v1.position
00132 _x = _v2
00133 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00134 _v3 = _v1.orientation
00135 _x = _v3
00136 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00137 _v4 = val1.scale
00138 _x = _v4
00139 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00140 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00141 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00142
00143 def deserialize(self, str):
00144 """
00145 unpack serialized message in str into this message instance
00146 :param str: byte array of serialized message, ``str``
00147 """
00148 try:
00149 if self.header is None:
00150 self.header = std_msgs.msg.Header()
00151 if self.planes is None:
00152 self.planes = None
00153 end = 0
00154 _x = self
00155 start = end
00156 end += 12
00157 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00158 start = end
00159 end += 4
00160 (length,) = _struct_I.unpack(str[start:end])
00161 start = end
00162 end += length
00163 if python3:
00164 self.header.frame_id = str[start:end].decode('utf-8')
00165 else:
00166 self.header.frame_id = str[start:end]
00167 start = end
00168 end += 4
00169 (length,) = _struct_I.unpack(str[start:end])
00170 self.planes = []
00171 for i in range(0, length):
00172 val1 = srs_env_model_msgs.msg.PlaneDesc()
00173 _x = val1
00174 start = end
00175 end += 8
00176 (_x.id, _x.flags,) = _struct_2i.unpack(str[start:end])
00177 _v5 = val1.pose
00178 _v6 = _v5.position
00179 _x = _v6
00180 start = end
00181 end += 24
00182 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00183 _v7 = _v5.orientation
00184 _x = _v7
00185 start = end
00186 end += 32
00187 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00188 _v8 = val1.scale
00189 _x = _v8
00190 start = end
00191 end += 24
00192 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00193 self.planes.append(val1)
00194 return self
00195 except struct.error as e:
00196 raise genpy.DeserializationError(e)
00197
00198
00199 def serialize_numpy(self, buff, numpy):
00200 """
00201 serialize message with numpy array types into buffer
00202 :param buff: buffer, ``StringIO``
00203 :param numpy: numpy python module
00204 """
00205 try:
00206 _x = self
00207 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00208 _x = self.header.frame_id
00209 length = len(_x)
00210 if python3 or type(_x) == unicode:
00211 _x = _x.encode('utf-8')
00212 length = len(_x)
00213 buff.write(struct.pack('<I%ss'%length, length, _x))
00214 length = len(self.planes)
00215 buff.write(_struct_I.pack(length))
00216 for val1 in self.planes:
00217 _x = val1
00218 buff.write(_struct_2i.pack(_x.id, _x.flags))
00219 _v9 = val1.pose
00220 _v10 = _v9.position
00221 _x = _v10
00222 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00223 _v11 = _v9.orientation
00224 _x = _v11
00225 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00226 _v12 = val1.scale
00227 _x = _v12
00228 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00229 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00230 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00231
00232 def deserialize_numpy(self, str, numpy):
00233 """
00234 unpack serialized message in str into this message instance using numpy for array types
00235 :param str: byte array of serialized message, ``str``
00236 :param numpy: numpy python module
00237 """
00238 try:
00239 if self.header is None:
00240 self.header = std_msgs.msg.Header()
00241 if self.planes is None:
00242 self.planes = None
00243 end = 0
00244 _x = self
00245 start = end
00246 end += 12
00247 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00248 start = end
00249 end += 4
00250 (length,) = _struct_I.unpack(str[start:end])
00251 start = end
00252 end += length
00253 if python3:
00254 self.header.frame_id = str[start:end].decode('utf-8')
00255 else:
00256 self.header.frame_id = str[start:end]
00257 start = end
00258 end += 4
00259 (length,) = _struct_I.unpack(str[start:end])
00260 self.planes = []
00261 for i in range(0, length):
00262 val1 = srs_env_model_msgs.msg.PlaneDesc()
00263 _x = val1
00264 start = end
00265 end += 8
00266 (_x.id, _x.flags,) = _struct_2i.unpack(str[start:end])
00267 _v13 = val1.pose
00268 _v14 = _v13.position
00269 _x = _v14
00270 start = end
00271 end += 24
00272 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00273 _v15 = _v13.orientation
00274 _x = _v15
00275 start = end
00276 end += 32
00277 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00278 _v16 = val1.scale
00279 _x = _v16
00280 start = end
00281 end += 24
00282 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00283 self.planes.append(val1)
00284 return self
00285 except struct.error as e:
00286 raise genpy.DeserializationError(e)
00287
00288 _struct_I = genpy.struct_I
00289 _struct_4d = struct.Struct("<4d")
00290 _struct_3I = struct.Struct("<3I")
00291 _struct_2i = struct.Struct("<2i")
00292 _struct_3d = struct.Struct("<3d")