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