$search
00001 """autogenerated by genmsg_py from urdf.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 urdf(roslib.message.Message): 00011 _md5sum = "5e0ef6153464ee9ec35b3eb8f82bc8a1" 00012 _type = "srs_object_database_msgs/urdf" 00013 _has_header = False #flag to mark the presence of a Header object 00014 _full_text = """int32 objectId 00015 visualization_msgs/Marker[] markers 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 uint8 ARROW=0 00021 uint8 CUBE=1 00022 uint8 SPHERE=2 00023 uint8 CYLINDER=3 00024 uint8 LINE_STRIP=4 00025 uint8 LINE_LIST=5 00026 uint8 CUBE_LIST=6 00027 uint8 SPHERE_LIST=7 00028 uint8 POINTS=8 00029 uint8 TEXT_VIEW_FACING=9 00030 uint8 MESH_RESOURCE=10 00031 uint8 TRIANGLE_LIST=11 00032 00033 uint8 ADD=0 00034 uint8 MODIFY=0 00035 uint8 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__ = ['objectId','markers'] 00118 _slot_types = ['int32','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 objectId,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(urdf, self).__init__(*args, **kwds) 00136 #message fields cannot be None, assign default values for those that are 00137 if self.objectId is None: 00138 self.objectId = 0 00139 if self.markers is None: 00140 self.markers = [] 00141 else: 00142 self.objectId = 0 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 buff.write(_struct_i.pack(self.objectId)) 00159 length = len(self.markers) 00160 buff.write(_struct_I.pack(length)) 00161 for val1 in self.markers: 00162 _v1 = val1.header 00163 buff.write(_struct_I.pack(_v1.seq)) 00164 _v2 = _v1.stamp 00165 _x = _v2 00166 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00167 _x = _v1.frame_id 00168 length = len(_x) 00169 buff.write(struct.pack('<I%ss'%length, length, _x)) 00170 _x = val1.ns 00171 length = len(_x) 00172 buff.write(struct.pack('<I%ss'%length, length, _x)) 00173 _x = val1 00174 buff.write(_struct_3i.pack(_x.id, _x.type, _x.action)) 00175 _v3 = val1.pose 00176 _v4 = _v3.position 00177 _x = _v4 00178 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00179 _v5 = _v3.orientation 00180 _x = _v5 00181 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00182 _v6 = val1.scale 00183 _x = _v6 00184 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00185 _v7 = val1.color 00186 _x = _v7 00187 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00188 _v8 = val1.lifetime 00189 _x = _v8 00190 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00191 buff.write(_struct_B.pack(val1.frame_locked)) 00192 length = len(val1.points) 00193 buff.write(_struct_I.pack(length)) 00194 for val2 in val1.points: 00195 _x = val2 00196 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00197 length = len(val1.colors) 00198 buff.write(_struct_I.pack(length)) 00199 for val2 in val1.colors: 00200 _x = val2 00201 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00202 _x = val1.text 00203 length = len(_x) 00204 buff.write(struct.pack('<I%ss'%length, length, _x)) 00205 _x = val1.mesh_resource 00206 length = len(_x) 00207 buff.write(struct.pack('<I%ss'%length, length, _x)) 00208 buff.write(_struct_B.pack(val1.mesh_use_embedded_materials)) 00209 except struct.error as se: self._check_types(se) 00210 except TypeError as te: self._check_types(te) 00211 00212 def deserialize(self, str): 00213 """ 00214 unpack serialized message in str into this message instance 00215 @param str: byte array of serialized message 00216 @type str: str 00217 """ 00218 try: 00219 end = 0 00220 start = end 00221 end += 4 00222 (self.objectId,) = _struct_i.unpack(str[start:end]) 00223 start = end 00224 end += 4 00225 (length,) = _struct_I.unpack(str[start:end]) 00226 self.markers = [] 00227 for i in range(0, length): 00228 val1 = visualization_msgs.msg.Marker() 00229 _v9 = val1.header 00230 start = end 00231 end += 4 00232 (_v9.seq,) = _struct_I.unpack(str[start:end]) 00233 _v10 = _v9.stamp 00234 _x = _v10 00235 start = end 00236 end += 8 00237 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00238 start = end 00239 end += 4 00240 (length,) = _struct_I.unpack(str[start:end]) 00241 start = end 00242 end += length 00243 _v9.frame_id = str[start:end] 00244 start = end 00245 end += 4 00246 (length,) = _struct_I.unpack(str[start:end]) 00247 start = end 00248 end += length 00249 val1.ns = str[start:end] 00250 _x = val1 00251 start = end 00252 end += 12 00253 (_x.id, _x.type, _x.action,) = _struct_3i.unpack(str[start:end]) 00254 _v11 = val1.pose 00255 _v12 = _v11.position 00256 _x = _v12 00257 start = end 00258 end += 24 00259 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00260 _v13 = _v11.orientation 00261 _x = _v13 00262 start = end 00263 end += 32 00264 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00265 _v14 = val1.scale 00266 _x = _v14 00267 start = end 00268 end += 24 00269 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00270 _v15 = val1.color 00271 _x = _v15 00272 start = end 00273 end += 16 00274 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00275 _v16 = val1.lifetime 00276 _x = _v16 00277 start = end 00278 end += 8 00279 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00280 start = end 00281 end += 1 00282 (val1.frame_locked,) = _struct_B.unpack(str[start:end]) 00283 val1.frame_locked = bool(val1.frame_locked) 00284 start = end 00285 end += 4 00286 (length,) = _struct_I.unpack(str[start:end]) 00287 val1.points = [] 00288 for i in range(0, length): 00289 val2 = geometry_msgs.msg.Point() 00290 _x = val2 00291 start = end 00292 end += 24 00293 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00294 val1.points.append(val2) 00295 start = end 00296 end += 4 00297 (length,) = _struct_I.unpack(str[start:end]) 00298 val1.colors = [] 00299 for i in range(0, length): 00300 val2 = std_msgs.msg.ColorRGBA() 00301 _x = val2 00302 start = end 00303 end += 16 00304 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00305 val1.colors.append(val2) 00306 start = end 00307 end += 4 00308 (length,) = _struct_I.unpack(str[start:end]) 00309 start = end 00310 end += length 00311 val1.text = str[start:end] 00312 start = end 00313 end += 4 00314 (length,) = _struct_I.unpack(str[start:end]) 00315 start = end 00316 end += length 00317 val1.mesh_resource = str[start:end] 00318 start = end 00319 end += 1 00320 (val1.mesh_use_embedded_materials,) = _struct_B.unpack(str[start:end]) 00321 val1.mesh_use_embedded_materials = bool(val1.mesh_use_embedded_materials) 00322 self.markers.append(val1) 00323 return self 00324 except struct.error as e: 00325 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00326 00327 00328 def serialize_numpy(self, buff, numpy): 00329 """ 00330 serialize message with numpy array types into buffer 00331 @param buff: buffer 00332 @type buff: StringIO 00333 @param numpy: numpy python module 00334 @type numpy module 00335 """ 00336 try: 00337 buff.write(_struct_i.pack(self.objectId)) 00338 length = len(self.markers) 00339 buff.write(_struct_I.pack(length)) 00340 for val1 in self.markers: 00341 _v17 = val1.header 00342 buff.write(_struct_I.pack(_v17.seq)) 00343 _v18 = _v17.stamp 00344 _x = _v18 00345 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00346 _x = _v17.frame_id 00347 length = len(_x) 00348 buff.write(struct.pack('<I%ss'%length, length, _x)) 00349 _x = val1.ns 00350 length = len(_x) 00351 buff.write(struct.pack('<I%ss'%length, length, _x)) 00352 _x = val1 00353 buff.write(_struct_3i.pack(_x.id, _x.type, _x.action)) 00354 _v19 = val1.pose 00355 _v20 = _v19.position 00356 _x = _v20 00357 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00358 _v21 = _v19.orientation 00359 _x = _v21 00360 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00361 _v22 = val1.scale 00362 _x = _v22 00363 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00364 _v23 = val1.color 00365 _x = _v23 00366 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00367 _v24 = val1.lifetime 00368 _x = _v24 00369 buff.write(_struct_2i.pack(_x.secs, _x.nsecs)) 00370 buff.write(_struct_B.pack(val1.frame_locked)) 00371 length = len(val1.points) 00372 buff.write(_struct_I.pack(length)) 00373 for val2 in val1.points: 00374 _x = val2 00375 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00376 length = len(val1.colors) 00377 buff.write(_struct_I.pack(length)) 00378 for val2 in val1.colors: 00379 _x = val2 00380 buff.write(_struct_4f.pack(_x.r, _x.g, _x.b, _x.a)) 00381 _x = val1.text 00382 length = len(_x) 00383 buff.write(struct.pack('<I%ss'%length, length, _x)) 00384 _x = val1.mesh_resource 00385 length = len(_x) 00386 buff.write(struct.pack('<I%ss'%length, length, _x)) 00387 buff.write(_struct_B.pack(val1.mesh_use_embedded_materials)) 00388 except struct.error as se: self._check_types(se) 00389 except TypeError as te: self._check_types(te) 00390 00391 def deserialize_numpy(self, str, numpy): 00392 """ 00393 unpack serialized message in str into this message instance using numpy for array types 00394 @param str: byte array of serialized message 00395 @type str: str 00396 @param numpy: numpy python module 00397 @type numpy: module 00398 """ 00399 try: 00400 end = 0 00401 start = end 00402 end += 4 00403 (self.objectId,) = _struct_i.unpack(str[start:end]) 00404 start = end 00405 end += 4 00406 (length,) = _struct_I.unpack(str[start:end]) 00407 self.markers = [] 00408 for i in range(0, length): 00409 val1 = visualization_msgs.msg.Marker() 00410 _v25 = val1.header 00411 start = end 00412 end += 4 00413 (_v25.seq,) = _struct_I.unpack(str[start:end]) 00414 _v26 = _v25.stamp 00415 _x = _v26 00416 start = end 00417 end += 8 00418 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00419 start = end 00420 end += 4 00421 (length,) = _struct_I.unpack(str[start:end]) 00422 start = end 00423 end += length 00424 _v25.frame_id = str[start:end] 00425 start = end 00426 end += 4 00427 (length,) = _struct_I.unpack(str[start:end]) 00428 start = end 00429 end += length 00430 val1.ns = str[start:end] 00431 _x = val1 00432 start = end 00433 end += 12 00434 (_x.id, _x.type, _x.action,) = _struct_3i.unpack(str[start:end]) 00435 _v27 = val1.pose 00436 _v28 = _v27.position 00437 _x = _v28 00438 start = end 00439 end += 24 00440 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00441 _v29 = _v27.orientation 00442 _x = _v29 00443 start = end 00444 end += 32 00445 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00446 _v30 = val1.scale 00447 _x = _v30 00448 start = end 00449 end += 24 00450 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00451 _v31 = val1.color 00452 _x = _v31 00453 start = end 00454 end += 16 00455 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00456 _v32 = val1.lifetime 00457 _x = _v32 00458 start = end 00459 end += 8 00460 (_x.secs, _x.nsecs,) = _struct_2i.unpack(str[start:end]) 00461 start = end 00462 end += 1 00463 (val1.frame_locked,) = _struct_B.unpack(str[start:end]) 00464 val1.frame_locked = bool(val1.frame_locked) 00465 start = end 00466 end += 4 00467 (length,) = _struct_I.unpack(str[start:end]) 00468 val1.points = [] 00469 for i in range(0, length): 00470 val2 = geometry_msgs.msg.Point() 00471 _x = val2 00472 start = end 00473 end += 24 00474 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00475 val1.points.append(val2) 00476 start = end 00477 end += 4 00478 (length,) = _struct_I.unpack(str[start:end]) 00479 val1.colors = [] 00480 for i in range(0, length): 00481 val2 = std_msgs.msg.ColorRGBA() 00482 _x = val2 00483 start = end 00484 end += 16 00485 (_x.r, _x.g, _x.b, _x.a,) = _struct_4f.unpack(str[start:end]) 00486 val1.colors.append(val2) 00487 start = end 00488 end += 4 00489 (length,) = _struct_I.unpack(str[start:end]) 00490 start = end 00491 end += length 00492 val1.text = str[start:end] 00493 start = end 00494 end += 4 00495 (length,) = _struct_I.unpack(str[start:end]) 00496 start = end 00497 end += length 00498 val1.mesh_resource = str[start:end] 00499 start = end 00500 end += 1 00501 (val1.mesh_use_embedded_materials,) = _struct_B.unpack(str[start:end]) 00502 val1.mesh_use_embedded_materials = bool(val1.mesh_use_embedded_materials) 00503 self.markers.append(val1) 00504 return self 00505 except struct.error as e: 00506 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00507 00508 _struct_I = roslib.message.struct_I 00509 _struct_B = struct.Struct("<B") 00510 _struct_i = struct.Struct("<i") 00511 _struct_2i = struct.Struct("<2i") 00512 _struct_3i = struct.Struct("<3i") 00513 _struct_4f = struct.Struct("<4f") 00514 _struct_4d = struct.Struct("<4d") 00515 _struct_2I = struct.Struct("<2I") 00516 _struct_3d = struct.Struct("<3d")