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