00001 """autogenerated by genmsg_py from Estimate2DHullMeshRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import arm_navigation_msgs.msg
00006 import geometry_msgs.msg
00007 import std_msgs.msg
00008
00009 class Estimate2DHullMeshRequest(roslib.message.Message):
00010 _md5sum = "9c05409a5132ae03b3447a07d79be879"
00011 _type = "srs_env_model_percp/Estimate2DHullMeshRequest"
00012 _has_header = True
00013 _full_text = """
00014
00015
00016 Header header
00017
00018
00019 arm_navigation_msgs/Shape mesh
00020
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data
00025 # in a particular coordinate frame.
00026 #
00027 # sequence ID: consecutively increasing ID
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038
00039 ================================================================================
00040 MSG: arm_navigation_msgs/Shape
00041 byte SPHERE=0
00042 byte BOX=1
00043 byte CYLINDER=2
00044 byte MESH=3
00045
00046 byte type
00047
00048
00049 #### define sphere, box, cylinder ####
00050 # the origin of each shape is considered at the shape's center
00051
00052 # for sphere
00053 # radius := dimensions[0]
00054
00055 # for cylinder
00056 # radius := dimensions[0]
00057 # length := dimensions[1]
00058 # the length is along the Z axis
00059
00060 # for box
00061 # size_x := dimensions[0]
00062 # size_y := dimensions[1]
00063 # size_z := dimensions[2]
00064 float64[] dimensions
00065
00066
00067 #### define mesh ####
00068
00069 # list of triangles; triangle k is defined by tre vertices located
00070 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]
00071 int32[] triangles
00072 geometry_msgs/Point[] vertices
00073
00074 ================================================================================
00075 MSG: geometry_msgs/Point
00076 # This contains the position of a point in free space
00077 float64 x
00078 float64 y
00079 float64 z
00080
00081 """
00082 __slots__ = ['header','mesh']
00083 _slot_types = ['Header','arm_navigation_msgs/Shape']
00084
00085 def __init__(self, *args, **kwds):
00086 """
00087 Constructor. Any message fields that are implicitly/explicitly
00088 set to None will be assigned a default value. The recommend
00089 use is keyword arguments as this is more robust to future message
00090 changes. You cannot mix in-order arguments and keyword arguments.
00091
00092 The available fields are:
00093 header,mesh
00094
00095 @param args: complete set of field values, in .msg order
00096 @param kwds: use keyword arguments corresponding to message field names
00097 to set specific fields.
00098 """
00099 if args or kwds:
00100 super(Estimate2DHullMeshRequest, self).__init__(*args, **kwds)
00101
00102 if self.header is None:
00103 self.header = std_msgs.msg._Header.Header()
00104 if self.mesh is None:
00105 self.mesh = arm_navigation_msgs.msg.Shape()
00106 else:
00107 self.header = std_msgs.msg._Header.Header()
00108 self.mesh = arm_navigation_msgs.msg.Shape()
00109
00110 def _get_types(self):
00111 """
00112 internal API method
00113 """
00114 return self._slot_types
00115
00116 def serialize(self, buff):
00117 """
00118 serialize message into buffer
00119 @param buff: buffer
00120 @type buff: StringIO
00121 """
00122 try:
00123 _x = self
00124 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00125 _x = self.header.frame_id
00126 length = len(_x)
00127 buff.write(struct.pack('<I%ss'%length, length, _x))
00128 buff.write(_struct_b.pack(self.mesh.type))
00129 length = len(self.mesh.dimensions)
00130 buff.write(_struct_I.pack(length))
00131 pattern = '<%sd'%length
00132 buff.write(struct.pack(pattern, *self.mesh.dimensions))
00133 length = len(self.mesh.triangles)
00134 buff.write(_struct_I.pack(length))
00135 pattern = '<%si'%length
00136 buff.write(struct.pack(pattern, *self.mesh.triangles))
00137 length = len(self.mesh.vertices)
00138 buff.write(_struct_I.pack(length))
00139 for val1 in self.mesh.vertices:
00140 _x = val1
00141 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00142 except struct.error as se: self._check_types(se)
00143 except TypeError as te: self._check_types(te)
00144
00145 def deserialize(self, str):
00146 """
00147 unpack serialized message in str into this message instance
00148 @param str: byte array of serialized message
00149 @type str: str
00150 """
00151 try:
00152 if self.header is None:
00153 self.header = std_msgs.msg._Header.Header()
00154 if self.mesh is None:
00155 self.mesh = arm_navigation_msgs.msg.Shape()
00156 end = 0
00157 _x = self
00158 start = end
00159 end += 12
00160 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 start = end
00165 end += length
00166 self.header.frame_id = str[start:end]
00167 start = end
00168 end += 1
00169 (self.mesh.type,) = _struct_b.unpack(str[start:end])
00170 start = end
00171 end += 4
00172 (length,) = _struct_I.unpack(str[start:end])
00173 pattern = '<%sd'%length
00174 start = end
00175 end += struct.calcsize(pattern)
00176 self.mesh.dimensions = struct.unpack(pattern, str[start:end])
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 pattern = '<%si'%length
00181 start = end
00182 end += struct.calcsize(pattern)
00183 self.mesh.triangles = struct.unpack(pattern, str[start:end])
00184 start = end
00185 end += 4
00186 (length,) = _struct_I.unpack(str[start:end])
00187 self.mesh.vertices = []
00188 for i in range(0, length):
00189 val1 = geometry_msgs.msg.Point()
00190 _x = val1
00191 start = end
00192 end += 24
00193 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00194 self.mesh.vertices.append(val1)
00195 return self
00196 except struct.error as e:
00197 raise roslib.message.DeserializationError(e)
00198
00199
00200 def serialize_numpy(self, buff, numpy):
00201 """
00202 serialize message with numpy array types into buffer
00203 @param buff: buffer
00204 @type buff: StringIO
00205 @param numpy: numpy python module
00206 @type numpy module
00207 """
00208 try:
00209 _x = self
00210 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00211 _x = self.header.frame_id
00212 length = len(_x)
00213 buff.write(struct.pack('<I%ss'%length, length, _x))
00214 buff.write(_struct_b.pack(self.mesh.type))
00215 length = len(self.mesh.dimensions)
00216 buff.write(_struct_I.pack(length))
00217 pattern = '<%sd'%length
00218 buff.write(self.mesh.dimensions.tostring())
00219 length = len(self.mesh.triangles)
00220 buff.write(_struct_I.pack(length))
00221 pattern = '<%si'%length
00222 buff.write(self.mesh.triangles.tostring())
00223 length = len(self.mesh.vertices)
00224 buff.write(_struct_I.pack(length))
00225 for val1 in self.mesh.vertices:
00226 _x = val1
00227 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00228 except struct.error as se: self._check_types(se)
00229 except TypeError as te: self._check_types(te)
00230
00231 def deserialize_numpy(self, str, numpy):
00232 """
00233 unpack serialized message in str into this message instance using numpy for array types
00234 @param str: byte array of serialized message
00235 @type str: str
00236 @param numpy: numpy python module
00237 @type numpy: module
00238 """
00239 try:
00240 if self.header is None:
00241 self.header = std_msgs.msg._Header.Header()
00242 if self.mesh is None:
00243 self.mesh = arm_navigation_msgs.msg.Shape()
00244 end = 0
00245 _x = self
00246 start = end
00247 end += 12
00248 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00249 start = end
00250 end += 4
00251 (length,) = _struct_I.unpack(str[start:end])
00252 start = end
00253 end += length
00254 self.header.frame_id = str[start:end]
00255 start = end
00256 end += 1
00257 (self.mesh.type,) = _struct_b.unpack(str[start:end])
00258 start = end
00259 end += 4
00260 (length,) = _struct_I.unpack(str[start:end])
00261 pattern = '<%sd'%length
00262 start = end
00263 end += struct.calcsize(pattern)
00264 self.mesh.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00265 start = end
00266 end += 4
00267 (length,) = _struct_I.unpack(str[start:end])
00268 pattern = '<%si'%length
00269 start = end
00270 end += struct.calcsize(pattern)
00271 self.mesh.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00272 start = end
00273 end += 4
00274 (length,) = _struct_I.unpack(str[start:end])
00275 self.mesh.vertices = []
00276 for i in range(0, length):
00277 val1 = geometry_msgs.msg.Point()
00278 _x = val1
00279 start = end
00280 end += 24
00281 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00282 self.mesh.vertices.append(val1)
00283 return self
00284 except struct.error as e:
00285 raise roslib.message.DeserializationError(e)
00286
00287 _struct_I = roslib.message.struct_I
00288 _struct_3I = struct.Struct("<3I")
00289 _struct_b = struct.Struct("<b")
00290 _struct_3d = struct.Struct("<3d")
00291 """autogenerated by genmsg_py from Estimate2DHullMeshResponse.msg. Do not edit."""
00292 import roslib.message
00293 import struct
00294
00295 import geometry_msgs.msg
00296
00297 class Estimate2DHullMeshResponse(roslib.message.Message):
00298 _md5sum = "00af134be58b0bb036eccab2a39f05f6"
00299 _type = "srs_env_model_percp/Estimate2DHullMeshResponse"
00300 _has_header = False
00301 _full_text = """
00302
00303
00304
00305 geometry_msgs/Polygon convexHull
00306
00307
00308
00309 ================================================================================
00310 MSG: geometry_msgs/Polygon
00311 #A specification of a polygon where the first and last points are assumed to be connected
00312 geometry_msgs/Point32[] points
00313
00314 ================================================================================
00315 MSG: geometry_msgs/Point32
00316 # This contains the position of a point in free space(with 32 bits of precision).
00317 # It is recommeded to use Point wherever possible instead of Point32.
00318 #
00319 # This recommendation is to promote interoperability.
00320 #
00321 # This message is designed to take up less space when sending
00322 # lots of points at once, as in the case of a PointCloud.
00323
00324 float32 x
00325 float32 y
00326 float32 z
00327 """
00328 __slots__ = ['convexHull']
00329 _slot_types = ['geometry_msgs/Polygon']
00330
00331 def __init__(self, *args, **kwds):
00332 """
00333 Constructor. Any message fields that are implicitly/explicitly
00334 set to None will be assigned a default value. The recommend
00335 use is keyword arguments as this is more robust to future message
00336 changes. You cannot mix in-order arguments and keyword arguments.
00337
00338 The available fields are:
00339 convexHull
00340
00341 @param args: complete set of field values, in .msg order
00342 @param kwds: use keyword arguments corresponding to message field names
00343 to set specific fields.
00344 """
00345 if args or kwds:
00346 super(Estimate2DHullMeshResponse, self).__init__(*args, **kwds)
00347
00348 if self.convexHull is None:
00349 self.convexHull = geometry_msgs.msg.Polygon()
00350 else:
00351 self.convexHull = geometry_msgs.msg.Polygon()
00352
00353 def _get_types(self):
00354 """
00355 internal API method
00356 """
00357 return self._slot_types
00358
00359 def serialize(self, buff):
00360 """
00361 serialize message into buffer
00362 @param buff: buffer
00363 @type buff: StringIO
00364 """
00365 try:
00366 length = len(self.convexHull.points)
00367 buff.write(_struct_I.pack(length))
00368 for val1 in self.convexHull.points:
00369 _x = val1
00370 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00371 except struct.error as se: self._check_types(se)
00372 except TypeError as te: self._check_types(te)
00373
00374 def deserialize(self, str):
00375 """
00376 unpack serialized message in str into this message instance
00377 @param str: byte array of serialized message
00378 @type str: str
00379 """
00380 try:
00381 if self.convexHull is None:
00382 self.convexHull = geometry_msgs.msg.Polygon()
00383 end = 0
00384 start = end
00385 end += 4
00386 (length,) = _struct_I.unpack(str[start:end])
00387 self.convexHull.points = []
00388 for i in range(0, length):
00389 val1 = geometry_msgs.msg.Point32()
00390 _x = val1
00391 start = end
00392 end += 12
00393 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00394 self.convexHull.points.append(val1)
00395 return self
00396 except struct.error as e:
00397 raise roslib.message.DeserializationError(e)
00398
00399
00400 def serialize_numpy(self, buff, numpy):
00401 """
00402 serialize message with numpy array types into buffer
00403 @param buff: buffer
00404 @type buff: StringIO
00405 @param numpy: numpy python module
00406 @type numpy module
00407 """
00408 try:
00409 length = len(self.convexHull.points)
00410 buff.write(_struct_I.pack(length))
00411 for val1 in self.convexHull.points:
00412 _x = val1
00413 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00414 except struct.error as se: self._check_types(se)
00415 except TypeError as te: self._check_types(te)
00416
00417 def deserialize_numpy(self, str, numpy):
00418 """
00419 unpack serialized message in str into this message instance using numpy for array types
00420 @param str: byte array of serialized message
00421 @type str: str
00422 @param numpy: numpy python module
00423 @type numpy: module
00424 """
00425 try:
00426 if self.convexHull is None:
00427 self.convexHull = geometry_msgs.msg.Polygon()
00428 end = 0
00429 start = end
00430 end += 4
00431 (length,) = _struct_I.unpack(str[start:end])
00432 self.convexHull.points = []
00433 for i in range(0, length):
00434 val1 = geometry_msgs.msg.Point32()
00435 _x = val1
00436 start = end
00437 end += 12
00438 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00439 self.convexHull.points.append(val1)
00440 return self
00441 except struct.error as e:
00442 raise roslib.message.DeserializationError(e)
00443
00444 _struct_I = roslib.message.struct_I
00445 _struct_3f = struct.Struct("<3f")
00446 class Estimate2DHullMesh(roslib.message.ServiceDefinition):
00447 _type = 'srs_env_model_percp/Estimate2DHullMesh'
00448 _md5sum = '6a2889ab927091c2a5c3e57dd5a07dda'
00449 _request_class = Estimate2DHullMeshRequest
00450 _response_class = Estimate2DHullMeshResponse