00001 """autogenerated by genmsg_py from MarkerArray.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006 import geometry_msgs.msg
00007 import visualization_msgs.msg
00008 import std_msgs.msg
00009
00010 class MarkerArray(roslib.message.Message):
00011 _md5sum = "f10fe193d6fac1bf68fad5d31da421a7"
00012 _type = "visualization_msgs/MarkerArray"
00013 _has_header = False
00014 _full_text = """Marker[] markers
00015
00016 ================================================================================
00017 MSG: visualization_msgs/Marker
00018 # See http://www.ros.org/wiki/rviz/DisplayTypes/Marker and http://www.ros.org/wiki/rviz/Tutorials/Markers%3A%20Basic%20Shapes for more information on using this message with rviz
00019
00020 byte ARROW=0
00021 byte CUBE=1
00022 byte SPHERE=2
00023 byte CYLINDER=3
00024 byte LINE_STRIP=4
00025 byte LINE_LIST=5
00026 byte CUBE_LIST=6
00027 byte SPHERE_LIST=7
00028 byte POINTS=8
00029 byte TEXT_VIEW_FACING=9
00030 byte MESH_RESOURCE=10
00031 byte TRIANGLE_LIST=11
00032
00033 byte ADD=0
00034 byte MODIFY=0
00035 byte DELETE=2
00036
00037 Header header # header for time/frame information
00038 string ns # Namespace to place this object in... used in conjunction with id to create a unique name for the object
00039 int32 id # object ID useful in conjunction with the namespace for manipulating and deleting the object later
00040 int32 type # Type of object
00041 int32 action # 0 add/modify an object, 1 (deprecated), 2 deletes an object
00042 geometry_msgs/Pose pose # Pose of the object
00043 geometry_msgs/Vector3 scale # Scale of the object 1,1,1 means default (usually 1 meter square)
00044 std_msgs/ColorRGBA color # Color [0.0-1.0]
00045 duration lifetime # How long the object should last before being automatically deleted. 0 means forever
00046 bool frame_locked # If this marker should be frame-locked, i.e. retransformed into its frame every timestep
00047
00048 #Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, ...)
00049 geometry_msgs/Point[] points
00050 #Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, ...)
00051 #number of colors must either be 0 or equal to the number of points
00052 #NOTE: alpha is not yet used
00053 std_msgs/ColorRGBA[] colors
00054
00055 # NOTE: only used for text markers
00056 string text
00057
00058 # NOTE: only used for MESH_RESOURCE markers
00059 string mesh_resource
00060 bool mesh_use_embedded_materials
00061
00062 ================================================================================
00063 MSG: std_msgs/Header
00064 # Standard metadata for higher-level stamped data types.
00065 # This is generally used to communicate timestamped data
00066 # in a particular coordinate frame.
00067 #
00068 # sequence ID: consecutively increasing ID
00069 uint32 seq
00070 #Two-integer timestamp that is expressed as:
00071 # * stamp.secs: seconds (stamp_secs) since epoch
00072 # * stamp.nsecs: nanoseconds since stamp_secs
00073 # time-handling sugar is provided by the client library
00074 time stamp
00075 #Frame this data is associated with
00076 # 0: no frame
00077 # 1: global frame
00078 string frame_id
00079
00080 ================================================================================
00081 MSG: geometry_msgs/Pose
00082 # A representation of pose in free space, composed of postion and orientation.
00083 Point position
00084 Quaternion orientation
00085
00086 ================================================================================
00087 MSG: geometry_msgs/Point
00088 # This contains the position of a point in free space
00089 float64 x
00090 float64 y
00091 float64 z
00092
00093 ================================================================================
00094 MSG: geometry_msgs/Quaternion
00095 # This represents an orientation in free space in quaternion form.
00096
00097 float64 x
00098 float64 y
00099 float64 z
00100 float64 w
00101
00102 ================================================================================
00103 MSG: geometry_msgs/Vector3
00104 # This represents a vector in free space.
00105
00106 float64 x
00107 float64 y
00108 float64 z
00109 ================================================================================
00110 MSG: std_msgs/ColorRGBA
00111 float32 r
00112 float32 g
00113 float32 b
00114 float32 a
00115
00116 """
00117 __slots__ = ['markers']
00118 _slot_types = ['visualization_msgs/Marker[]']
00119
00120 def __init__(self, *args, **kwds):
00121 """
00122 Constructor. Any message fields that are implicitly/explicitly
00123 set to None will be assigned a default value. The recommend
00124 use is keyword arguments as this is more robust to future message
00125 changes. You cannot mix in-order arguments and keyword arguments.
00126
00127 The available fields are:
00128 markers
00129
00130 @param args: complete set of field values, in .msg order
00131 @param kwds: use keyword arguments corresponding to message field names
00132 to set specific fields.
00133 """
00134 if args or kwds:
00135 super(MarkerArray, self).__init__(*args, **kwds)
00136
00137 if self.markers is None:
00138 self.markers = []
00139 else:
00140 self.markers = []
00141
00142 def _get_types(self):
00143 """
00144 internal API method
00145 """
00146 return self._slot_types
00147
00148 def serialize(self, buff):
00149 """
00150 serialize message into buffer
00151 @param buff: buffer
00152 @type buff: StringIO
00153 """
00154 try:
00155 length = len(self.markers)
00156 buff.write(_struct_I.pack(length))
00157 for val1 in self.markers:
00158 _v1 = val1.header
00159 buff.write(_struct_I.pack(_v1.seq))
00160 _v2 = _v1.stamp
00161 _x = _v2
00162 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00163 _x = _v1.frame_id
00164 length = len(_x)
00165 buff.write(struct.pack('<I%ss'%length, length, _x))
00166 _x = val1.ns
00167 length = len(_x)
00168 buff.write(struct.pack('<I%ss'%length, length, _x))
00169 _x = val1
00170 buff.write(_struct_3i.pack(_x.id, _x.type, _x.action))
00171 _v3 = val1.pose
00172 _v4 = _v3.position
00173 _x = _v4
00174 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00175 _v5 = _v3.orientation
00176 _x = _v5
00177 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00178 _v6 = val1.scale
00179 _x = _v6
00180 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00181 _v7 = val1.color
00182 _x = _v7
00183 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00184 _v8 = val1.lifetime
00185 _x = _v8
00186 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00187 buff.write(_struct_B.pack(val1.frame_locked))
00188 length = len(val1.points)
00189 buff.write(_struct_I.pack(length))
00190 for val2 in val1.points:
00191 _x = val2
00192 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00193 length = len(val1.colors)
00194 buff.write(_struct_I.pack(length))
00195 for val2 in val1.colors:
00196 _x = val2
00197 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00198 _x = val1.text
00199 length = len(_x)
00200 buff.write(struct.pack('<I%ss'%length, length, _x))
00201 _x = val1.mesh_resource
00202 length = len(_x)
00203 buff.write(struct.pack('<I%ss'%length, length, _x))
00204 buff.write(_struct_B.pack(val1.mesh_use_embedded_materials))
00205 except struct.error, se: self._check_types(se)
00206 except TypeError, te: self._check_types(te)
00207
00208 def deserialize(self, str):
00209 """
00210 unpack serialized message in str into this message instance
00211 @param str: byte array of serialized message
00212 @type str: str
00213 """
00214 try:
00215 end = 0
00216 start = end
00217 end += 4
00218 (length,) = _struct_I.unpack(str[start:end])
00219 self.markers = []
00220 for i in xrange(0, length):
00221 val1 = visualization_msgs.msg.Marker()
00222 _v9 = val1.header
00223 start = end
00224 end += 4
00225 (_v9.seq,) = _struct_I.unpack(str[start:end])
00226 _v10 = _v9.stamp
00227 _x = _v10
00228 start = end
00229 end += 8
00230 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00231 start = end
00232 end += 4
00233 (length,) = _struct_I.unpack(str[start:end])
00234 start = end
00235 end += length
00236 _v9.frame_id = str[start:end]
00237 start = end
00238 end += 4
00239 (length,) = _struct_I.unpack(str[start:end])
00240 start = end
00241 end += length
00242 val1.ns = str[start:end]
00243 _x = val1
00244 start = end
00245 end += 12
00246 (_x.id, _x.type, _x.action,) = _struct_3i.unpack(str[start:end])
00247 _v11 = val1.pose
00248 _v12 = _v11.position
00249 _x = _v12
00250 start = end
00251 end += 24
00252 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00253 _v13 = _v11.orientation
00254 _x = _v13
00255 start = end
00256 end += 32
00257 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00258 _v14 = val1.scale
00259 _x = _v14
00260 start = end
00261 end += 24
00262 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00263 _v15 = val1.color
00264 _x = _v15
00265 start = end
00266 end += 16
00267 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00268 _v16 = val1.lifetime
00269 _x = _v16
00270 start = end
00271 end += 8
00272 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00273 start = end
00274 end += 1
00275 (val1.frame_locked,) = _struct_B.unpack(str[start:end])
00276 val1.frame_locked = bool(val1.frame_locked)
00277 start = end
00278 end += 4
00279 (length,) = _struct_I.unpack(str[start:end])
00280 val1.points = []
00281 for i in xrange(0, length):
00282 val2 = geometry_msgs.msg.Point()
00283 _x = val2
00284 start = end
00285 end += 24
00286 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00287 val1.points.append(val2)
00288 start = end
00289 end += 4
00290 (length,) = _struct_I.unpack(str[start:end])
00291 val1.colors = []
00292 for i in xrange(0, length):
00293 val2 = std_msgs.msg.ColorRGBA()
00294 _x = val2
00295 start = end
00296 end += 16
00297 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00298 val1.colors.append(val2)
00299 start = end
00300 end += 4
00301 (length,) = _struct_I.unpack(str[start:end])
00302 start = end
00303 end += length
00304 val1.text = str[start:end]
00305 start = end
00306 end += 4
00307 (length,) = _struct_I.unpack(str[start:end])
00308 start = end
00309 end += length
00310 val1.mesh_resource = str[start:end]
00311 start = end
00312 end += 1
00313 (val1.mesh_use_embedded_materials,) = _struct_B.unpack(str[start:end])
00314 val1.mesh_use_embedded_materials = bool(val1.mesh_use_embedded_materials)
00315 self.markers.append(val1)
00316 return self
00317 except struct.error, e:
00318 raise roslib.message.DeserializationError(e)
00319
00320
00321 def serialize_numpy(self, buff, numpy):
00322 """
00323 serialize message with numpy array types into buffer
00324 @param buff: buffer
00325 @type buff: StringIO
00326 @param numpy: numpy python module
00327 @type numpy module
00328 """
00329 try:
00330 length = len(self.markers)
00331 buff.write(_struct_I.pack(length))
00332 for val1 in self.markers:
00333 _v17 = val1.header
00334 buff.write(_struct_I.pack(_v17.seq))
00335 _v18 = _v17.stamp
00336 _x = _v18
00337 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00338 _x = _v17.frame_id
00339 length = len(_x)
00340 buff.write(struct.pack('<I%ss'%length, length, _x))
00341 _x = val1.ns
00342 length = len(_x)
00343 buff.write(struct.pack('<I%ss'%length, length, _x))
00344 _x = val1
00345 buff.write(_struct_3i.pack(_x.id, _x.type, _x.action))
00346 _v19 = val1.pose
00347 _v20 = _v19.position
00348 _x = _v20
00349 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00350 _v21 = _v19.orientation
00351 _x = _v21
00352 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00353 _v22 = val1.scale
00354 _x = _v22
00355 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00356 _v23 = val1.color
00357 _x = _v23
00358 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00359 _v24 = val1.lifetime
00360 _x = _v24
00361 buff.write(_struct_2i.pack(_x.secs, _x.nsecs))
00362 buff.write(_struct_B.pack(val1.frame_locked))
00363 length = len(val1.points)
00364 buff.write(_struct_I.pack(length))
00365 for val2 in val1.points:
00366 _x = val2
00367 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00368 length = len(val1.colors)
00369 buff.write(_struct_I.pack(length))
00370 for val2 in val1.colors:
00371 _x = val2
00372 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a))
00373 _x = val1.text
00374 length = len(_x)
00375 buff.write(struct.pack('<I%ss'%length, length, _x))
00376 _x = val1.mesh_resource
00377 length = len(_x)
00378 buff.write(struct.pack('<I%ss'%length, length, _x))
00379 buff.write(_struct_B.pack(val1.mesh_use_embedded_materials))
00380 except struct.error, se: self._check_types(se)
00381 except TypeError, te: self._check_types(te)
00382
00383 def deserialize_numpy(self, str, numpy):
00384 """
00385 unpack serialized message in str into this message instance using numpy for array types
00386 @param str: byte array of serialized message
00387 @type str: str
00388 @param numpy: numpy python module
00389 @type numpy: module
00390 """
00391 try:
00392 end = 0
00393 start = end
00394 end += 4
00395 (length,) = _struct_I.unpack(str[start:end])
00396 self.markers = []
00397 for i in xrange(0, length):
00398 val1 = visualization_msgs.msg.Marker()
00399 _v25 = val1.header
00400 start = end
00401 end += 4
00402 (_v25.seq,) = _struct_I.unpack(str[start:end])
00403 _v26 = _v25.stamp
00404 _x = _v26
00405 start = end
00406 end += 8
00407 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00408 start = end
00409 end += 4
00410 (length,) = _struct_I.unpack(str[start:end])
00411 start = end
00412 end += length
00413 _v25.frame_id = str[start:end]
00414 start = end
00415 end += 4
00416 (length,) = _struct_I.unpack(str[start:end])
00417 start = end
00418 end += length
00419 val1.ns = str[start:end]
00420 _x = val1
00421 start = end
00422 end += 12
00423 (_x.id, _x.type, _x.action,) = _struct_3i.unpack(str[start:end])
00424 _v27 = val1.pose
00425 _v28 = _v27.position
00426 _x = _v28
00427 start = end
00428 end += 24
00429 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00430 _v29 = _v27.orientation
00431 _x = _v29
00432 start = end
00433 end += 32
00434 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00435 _v30 = val1.scale
00436 _x = _v30
00437 start = end
00438 end += 24
00439 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00440 _v31 = val1.color
00441 _x = _v31
00442 start = end
00443 end += 16
00444 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00445 _v32 = val1.lifetime
00446 _x = _v32
00447 start = end
00448 end += 8
00449 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end])
00450 start = end
00451 end += 1
00452 (val1.frame_locked,) = _struct_B.unpack(str[start:end])
00453 val1.frame_locked = bool(val1.frame_locked)
00454 start = end
00455 end += 4
00456 (length,) = _struct_I.unpack(str[start:end])
00457 val1.points = []
00458 for i in xrange(0, length):
00459 val2 = geometry_msgs.msg.Point()
00460 _x = val2
00461 start = end
00462 end += 24
00463 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00464 val1.points.append(val2)
00465 start = end
00466 end += 4
00467 (length,) = _struct_I.unpack(str[start:end])
00468 val1.colors = []
00469 for i in xrange(0, length):
00470 val2 = std_msgs.msg.ColorRGBA()
00471 _x = val2
00472 start = end
00473 end += 16
00474 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end])
00475 val1.colors.append(val2)
00476 start = end
00477 end += 4
00478 (length,) = _struct_I.unpack(str[start:end])
00479 start = end
00480 end += length
00481 val1.text = str[start:end]
00482 start = end
00483 end += 4
00484 (length,) = _struct_I.unpack(str[start:end])
00485 start = end
00486 end += length
00487 val1.mesh_resource = str[start:end]
00488 start = end
00489 end += 1
00490 (val1.mesh_use_embedded_materials,) = _struct_B.unpack(str[start:end])
00491 val1.mesh_use_embedded_materials = bool(val1.mesh_use_embedded_materials)
00492 self.markers.append(val1)
00493 return self
00494 except struct.error, e:
00495 raise roslib.message.DeserializationError(e)
00496
00497 _struct_I = roslib.message.struct_I
00498 _struct_B = struct.Struct("<B")
00499 _struct_2i = struct.Struct("<2i")
00500 _struct_3i = struct.Struct("<3i")
00501 _struct_4f = struct.Struct("<4f")
00502 _struct_4d = struct.Struct("<4d")
00503 _struct_2I = struct.Struct("<2I")
00504 _struct_3d = struct.Struct("<3d")