00001 """autogenerated by genpy from rve_msgs/Points.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 rve_msgs.msg
00008 import std_msgs.msg
00009
00010 class Points(genpy.Message):
00011 _md5sum = "74cfd9b96bfbb40c5e9f79498734e737"
00012 _type = "rve_msgs/Points"
00013 _has_header = False
00014 _full_text = """uint8 TYPE_POINTS = 0
00015 uint8 TYPE_BILLBOARDS = 1
00016 uint8 TYPE_BILLBOARD_SPHERES = 2
00017 uint8 TYPE_BOXES = 3
00018
00019 uint8 type
00020 Vector3 scale
00021
00022 Vector3[] positions
00023 Vector3[] normals
00024 Vector3[] scales
00025 Quaternion[] orientations
00026 std_msgs/ColorRGBA[] colors
00027
00028 ================================================================================
00029 MSG: rve_msgs/Vector3
00030 float32 x
00031 float32 y
00032 float32 z
00033
00034 ================================================================================
00035 MSG: rve_msgs/Quaternion
00036 float32 x
00037 float32 y
00038 float32 z
00039 float32 w
00040
00041 ================================================================================
00042 MSG: std_msgs/ColorRGBA
00043 float32 r
00044 float32 g
00045 float32 b
00046 float32 a
00047
00048 """
00049
00050 TYPE_POINTS = 0
00051 TYPE_BILLBOARDS = 1
00052 TYPE_BILLBOARD_SPHERES = 2
00053 TYPE_BOXES = 3
00054
00055 __slots__ = ['type','scale','positions','normals','scales','orientations','colors']
00056 _slot_types = ['uint8','rve_msgs/Vector3','rve_msgs/Vector3[]','rve_msgs/Vector3[]','rve_msgs/Vector3[]','rve_msgs/Quaternion[]','std_msgs/ColorRGBA[]']
00057
00058 def __init__(self, *args, **kwds):
00059 """
00060 Constructor. Any message fields that are implicitly/explicitly
00061 set to None will be assigned a default value. The recommend
00062 use is keyword arguments as this is more robust to future message
00063 changes. You cannot mix in-order arguments and keyword arguments.
00064
00065 The available fields are:
00066 type,scale,positions,normals,scales,orientations,colors
00067
00068 :param args: complete set of field values, in .msg order
00069 :param kwds: use keyword arguments corresponding to message field names
00070 to set specific fields.
00071 """
00072 if args or kwds:
00073 super(Points, self).__init__(*args, **kwds)
00074
00075 if self.type is None:
00076 self.type = 0
00077 if self.scale is None:
00078 self.scale = rve_msgs.msg.Vector3()
00079 if self.positions is None:
00080 self.positions = []
00081 if self.normals is None:
00082 self.normals = []
00083 if self.scales is None:
00084 self.scales = []
00085 if self.orientations is None:
00086 self.orientations = []
00087 if self.colors is None:
00088 self.colors = []
00089 else:
00090 self.type = 0
00091 self.scale = rve_msgs.msg.Vector3()
00092 self.positions = []
00093 self.normals = []
00094 self.scales = []
00095 self.orientations = []
00096 self.colors = []
00097
00098 def _get_types(self):
00099 """
00100 internal API method
00101 """
00102 return self._slot_types
00103
00104 def serialize(self, buff):
00105 """
00106 serialize message into buffer
00107 :param buff: buffer, ``StringIO``
00108 """
00109 try:
00110 _x = self
00111 buff.write(_struct_B3f.pack(_x.type, _x.scale.x, _x.scale.y, _x.scale.z))
00112 length = len(self.positions)
00113 buff.write(_struct_I.pack(length))
00114 for val1 in self.positions:
00115 _x = val1
00116 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00117 length = len(self.normals)
00118 buff.write(_struct_I.pack(length))
00119 for val1 in self.normals:
00120 _x = val1
00121 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00122 length = len(self.scales)
00123 buff.write(_struct_I.pack(length))
00124 for val1 in self.scales:
00125 _x = val1
00126 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00127 length = len(self.orientations)
00128 buff.write(_struct_I.pack(length))
00129 for val1 in self.orientations:
00130 _x = val1
00131 buff.write(_struct_4f.pack(_x.x, _x.y, _x.z, _x.w))
00132 length = len(self.colors)
00133 buff.write(_struct_I.pack(length))
00134 for val1 in self.colors:
00135 _x = val1
00136 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00137 except struct.error as se: self._check_types(se)
00138 except TypeError as te: self._check_types(te)
00139
00140 def deserialize(self, str):
00141 """
00142 unpack serialized message in str into this message instance
00143 :param str: byte array of serialized message, ``str``
00144 """
00145 try:
00146 if self.scale is None:
00147 self.scale = rve_msgs.msg.Vector3()
00148 if self.positions is None:
00149 self.positions = None
00150 if self.normals is None:
00151 self.normals = None
00152 if self.scales is None:
00153 self.scales = None
00154 if self.orientations is None:
00155 self.orientations = None
00156 if self.colors is None:
00157 self.colors = None
00158 end = 0
00159 _x = self
00160 start = end
00161 end += 13
00162 (_x.type, _x.scale.x, _x.scale.y, _x.scale.z,) = _struct_B3f.unpack(str[start:end])
00163 start = end
00164 end += 4
00165 (length,) = _struct_I.unpack(str[start:end])
00166 self.positions = []
00167 for i in range(0, length):
00168 val1 = rve_msgs.msg.Vector3()
00169 _x = val1
00170 start = end
00171 end += 12
00172 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00173 self.positions.append(val1)
00174 start = end
00175 end += 4
00176 (length,) = _struct_I.unpack(str[start:end])
00177 self.normals = []
00178 for i in range(0, length):
00179 val1 = rve_msgs.msg.Vector3()
00180 _x = val1
00181 start = end
00182 end += 12
00183 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00184 self.normals.append(val1)
00185 start = end
00186 end += 4
00187 (length,) = _struct_I.unpack(str[start:end])
00188 self.scales = []
00189 for i in range(0, length):
00190 val1 = rve_msgs.msg.Vector3()
00191 _x = val1
00192 start = end
00193 end += 12
00194 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00195 self.scales.append(val1)
00196 start = end
00197 end += 4
00198 (length,) = _struct_I.unpack(str[start:end])
00199 self.orientations = []
00200 for i in range(0, length):
00201 val1 = rve_msgs.msg.Quaternion()
00202 _x = val1
00203 start = end
00204 end += 16
00205 (_x.x, _x.y, _x.z, _x.w,) = _struct_4f.unpack(str[start:end])
00206 self.orientations.append(val1)
00207 start = end
00208 end += 4
00209 (length,) = _struct_I.unpack(str[start:end])
00210 self.colors = []
00211 for i in range(0, length):
00212 val1 = std_msgs.msg.ColorRGBA()
00213 _x = val1
00214 start = end
00215 end += 16
00216 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00217 self.colors.append(val1)
00218 return self
00219 except struct.error as e:
00220 raise genpy.DeserializationError(e)
00221
00222
00223 def serialize_numpy(self, buff, numpy):
00224 """
00225 serialize message with numpy array types into buffer
00226 :param buff: buffer, ``StringIO``
00227 :param numpy: numpy python module
00228 """
00229 try:
00230 _x = self
00231 buff.write(_struct_B3f.pack(_x.type, _x.scale.x, _x.scale.y, _x.scale.z))
00232 length = len(self.positions)
00233 buff.write(_struct_I.pack(length))
00234 for val1 in self.positions:
00235 _x = val1
00236 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00237 length = len(self.normals)
00238 buff.write(_struct_I.pack(length))
00239 for val1 in self.normals:
00240 _x = val1
00241 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00242 length = len(self.scales)
00243 buff.write(_struct_I.pack(length))
00244 for val1 in self.scales:
00245 _x = val1
00246 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00247 length = len(self.orientations)
00248 buff.write(_struct_I.pack(length))
00249 for val1 in self.orientations:
00250 _x = val1
00251 buff.write(_struct_4f.pack(_x.x, _x.y, _x.z, _x.w))
00252 length = len(self.colors)
00253 buff.write(_struct_I.pack(length))
00254 for val1 in self.colors:
00255 _x = val1
00256 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00257 except struct.error as se: self._check_types(se)
00258 except TypeError as te: self._check_types(te)
00259
00260 def deserialize_numpy(self, str, numpy):
00261 """
00262 unpack serialized message in str into this message instance using numpy for array types
00263 :param str: byte array of serialized message, ``str``
00264 :param numpy: numpy python module
00265 """
00266 try:
00267 if self.scale is None:
00268 self.scale = rve_msgs.msg.Vector3()
00269 if self.positions is None:
00270 self.positions = None
00271 if self.normals is None:
00272 self.normals = None
00273 if self.scales is None:
00274 self.scales = None
00275 if self.orientations is None:
00276 self.orientations = None
00277 if self.colors is None:
00278 self.colors = None
00279 end = 0
00280 _x = self
00281 start = end
00282 end += 13
00283 (_x.type, _x.scale.x, _x.scale.y, _x.scale.z,) = _struct_B3f.unpack(str[start:end])
00284 start = end
00285 end += 4
00286 (length,) = _struct_I.unpack(str[start:end])
00287 self.positions = []
00288 for i in range(0, length):
00289 val1 = rve_msgs.msg.Vector3()
00290 _x = val1
00291 start = end
00292 end += 12
00293 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00294 self.positions.append(val1)
00295 start = end
00296 end += 4
00297 (length,) = _struct_I.unpack(str[start:end])
00298 self.normals = []
00299 for i in range(0, length):
00300 val1 = rve_msgs.msg.Vector3()
00301 _x = val1
00302 start = end
00303 end += 12
00304 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00305 self.normals.append(val1)
00306 start = end
00307 end += 4
00308 (length,) = _struct_I.unpack(str[start:end])
00309 self.scales = []
00310 for i in range(0, length):
00311 val1 = rve_msgs.msg.Vector3()
00312 _x = val1
00313 start = end
00314 end += 12
00315 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00316 self.scales.append(val1)
00317 start = end
00318 end += 4
00319 (length,) = _struct_I.unpack(str[start:end])
00320 self.orientations = []
00321 for i in range(0, length):
00322 val1 = rve_msgs.msg.Quaternion()
00323 _x = val1
00324 start = end
00325 end += 16
00326 (_x.x, _x.y, _x.z, _x.w,) = _struct_4f.unpack(str[start:end])
00327 self.orientations.append(val1)
00328 start = end
00329 end += 4
00330 (length,) = _struct_I.unpack(str[start:end])
00331 self.colors = []
00332 for i in range(0, length):
00333 val1 = std_msgs.msg.ColorRGBA()
00334 _x = val1
00335 start = end
00336 end += 16
00337 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00338 self.colors.append(val1)
00339 return self
00340 except struct.error as e:
00341 raise genpy.DeserializationError(e)
00342
00343 _struct_I = genpy.struct_I
00344 _struct_4f = struct.Struct("<4f")
00345 _struct_B3f = struct.Struct("<B3f")
00346 _struct_3f = struct.Struct("<3f")