_WorkspaceParameters.py
Go to the documentation of this file.
00001 """autogenerated by genpy from arm_navigation_msgs/WorkspaceParameters.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 arm_navigation_msgs.msg
00008 import geometry_msgs.msg
00009 import std_msgs.msg
00010 
00011 class WorkspaceParameters(genpy.Message):
00012   _md5sum = "1487490edff0df276863abf2cf221de5"
00013   _type = "arm_navigation_msgs/WorkspaceParameters"
00014   _has_header = False #flag to mark the presence of a Header object
00015   _full_text = """# This message contains a set of parameters useful in
00016 # setting up the workspace for planning
00017 arm_navigation_msgs/Shape  workspace_region_shape
00018 geometry_msgs/PoseStamped    workspace_region_pose
00019 
00020 
00021 ================================================================================
00022 MSG: arm_navigation_msgs/Shape
00023 byte SPHERE=0
00024 byte BOX=1
00025 byte CYLINDER=2
00026 byte MESH=3
00027 
00028 byte type
00029 
00030 
00031 #### define sphere, box, cylinder ####
00032 # the origin of each shape is considered at the shape's center
00033 
00034 # for sphere
00035 # radius := dimensions[0]
00036 
00037 # for cylinder
00038 # radius := dimensions[0]
00039 # length := dimensions[1]
00040 # the length is along the Z axis
00041 
00042 # for box
00043 # size_x := dimensions[0]
00044 # size_y := dimensions[1]
00045 # size_z := dimensions[2]
00046 float64[] dimensions
00047 
00048 
00049 #### define mesh ####
00050 
00051 # list of triangles; triangle k is defined by tre vertices located
00052 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]
00053 int32[] triangles
00054 geometry_msgs/Point[] vertices
00055 
00056 ================================================================================
00057 MSG: geometry_msgs/Point
00058 # This contains the position of a point in free space
00059 float64 x
00060 float64 y
00061 float64 z
00062 
00063 ================================================================================
00064 MSG: geometry_msgs/PoseStamped
00065 # A Pose with reference coordinate frame and timestamp
00066 Header header
00067 Pose pose
00068 
00069 ================================================================================
00070 MSG: std_msgs/Header
00071 # Standard metadata for higher-level stamped data types.
00072 # This is generally used to communicate timestamped data 
00073 # in a particular coordinate frame.
00074 # 
00075 # sequence ID: consecutively increasing ID 
00076 uint32 seq
00077 #Two-integer timestamp that is expressed as:
00078 # * stamp.secs: seconds (stamp_secs) since epoch
00079 # * stamp.nsecs: nanoseconds since stamp_secs
00080 # time-handling sugar is provided by the client library
00081 time stamp
00082 #Frame this data is associated with
00083 # 0: no frame
00084 # 1: global frame
00085 string frame_id
00086 
00087 ================================================================================
00088 MSG: geometry_msgs/Pose
00089 # A representation of pose in free space, composed of postion and orientation. 
00090 Point position
00091 Quaternion orientation
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   __slots__ = ['workspace_region_shape','workspace_region_pose']
00104   _slot_types = ['arm_navigation_msgs/Shape','geometry_msgs/PoseStamped']
00105 
00106   def __init__(self, *args, **kwds):
00107     """
00108     Constructor. Any message fields that are implicitly/explicitly
00109     set to None will be assigned a default value. The recommend
00110     use is keyword arguments as this is more robust to future message
00111     changes.  You cannot mix in-order arguments and keyword arguments.
00112 
00113     The available fields are:
00114        workspace_region_shape,workspace_region_pose
00115 
00116     :param args: complete set of field values, in .msg order
00117     :param kwds: use keyword arguments corresponding to message field names
00118     to set specific fields.
00119     """
00120     if args or kwds:
00121       super(WorkspaceParameters, self).__init__(*args, **kwds)
00122       #message fields cannot be None, assign default values for those that are
00123       if self.workspace_region_shape is None:
00124         self.workspace_region_shape = arm_navigation_msgs.msg.Shape()
00125       if self.workspace_region_pose is None:
00126         self.workspace_region_pose = geometry_msgs.msg.PoseStamped()
00127     else:
00128       self.workspace_region_shape = arm_navigation_msgs.msg.Shape()
00129       self.workspace_region_pose = geometry_msgs.msg.PoseStamped()
00130 
00131   def _get_types(self):
00132     """
00133     internal API method
00134     """
00135     return self._slot_types
00136 
00137   def serialize(self, buff):
00138     """
00139     serialize message into buffer
00140     :param buff: buffer, ``StringIO``
00141     """
00142     try:
00143       buff.write(_struct_b.pack(self.workspace_region_shape.type))
00144       length = len(self.workspace_region_shape.dimensions)
00145       buff.write(_struct_I.pack(length))
00146       pattern = '<%sd'%length
00147       buff.write(struct.pack(pattern, *self.workspace_region_shape.dimensions))
00148       length = len(self.workspace_region_shape.triangles)
00149       buff.write(_struct_I.pack(length))
00150       pattern = '<%si'%length
00151       buff.write(struct.pack(pattern, *self.workspace_region_shape.triangles))
00152       length = len(self.workspace_region_shape.vertices)
00153       buff.write(_struct_I.pack(length))
00154       for val1 in self.workspace_region_shape.vertices:
00155         _x = val1
00156         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00157       _x = self
00158       buff.write(_struct_3I.pack(_x.workspace_region_pose.header.seq, _x.workspace_region_pose.header.stamp.secs, _x.workspace_region_pose.header.stamp.nsecs))
00159       _x = self.workspace_region_pose.header.frame_id
00160       length = len(_x)
00161       if python3 or type(_x) == unicode:
00162         _x = _x.encode('utf-8')
00163         length = len(_x)
00164       buff.write(struct.pack('<I%ss'%length, length, _x))
00165       _x = self
00166       buff.write(_struct_7d.pack(_x.workspace_region_pose.pose.position.x, _x.workspace_region_pose.pose.position.y, _x.workspace_region_pose.pose.position.z, _x.workspace_region_pose.pose.orientation.x, _x.workspace_region_pose.pose.orientation.y, _x.workspace_region_pose.pose.orientation.z, _x.workspace_region_pose.pose.orientation.w))
00167     except struct.error as se: self._check_types(se)
00168     except TypeError as te: self._check_types(te)
00169 
00170   def deserialize(self, str):
00171     """
00172     unpack serialized message in str into this message instance
00173     :param str: byte array of serialized message, ``str``
00174     """
00175     try:
00176       if self.workspace_region_shape is None:
00177         self.workspace_region_shape = arm_navigation_msgs.msg.Shape()
00178       if self.workspace_region_pose is None:
00179         self.workspace_region_pose = geometry_msgs.msg.PoseStamped()
00180       end = 0
00181       start = end
00182       end += 1
00183       (self.workspace_region_shape.type,) = _struct_b.unpack(str[start:end])
00184       start = end
00185       end += 4
00186       (length,) = _struct_I.unpack(str[start:end])
00187       pattern = '<%sd'%length
00188       start = end
00189       end += struct.calcsize(pattern)
00190       self.workspace_region_shape.dimensions = struct.unpack(pattern, str[start:end])
00191       start = end
00192       end += 4
00193       (length,) = _struct_I.unpack(str[start:end])
00194       pattern = '<%si'%length
00195       start = end
00196       end += struct.calcsize(pattern)
00197       self.workspace_region_shape.triangles = struct.unpack(pattern, str[start:end])
00198       start = end
00199       end += 4
00200       (length,) = _struct_I.unpack(str[start:end])
00201       self.workspace_region_shape.vertices = []
00202       for i in range(0, length):
00203         val1 = geometry_msgs.msg.Point()
00204         _x = val1
00205         start = end
00206         end += 24
00207         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00208         self.workspace_region_shape.vertices.append(val1)
00209       _x = self
00210       start = end
00211       end += 12
00212       (_x.workspace_region_pose.header.seq, _x.workspace_region_pose.header.stamp.secs, _x.workspace_region_pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00213       start = end
00214       end += 4
00215       (length,) = _struct_I.unpack(str[start:end])
00216       start = end
00217       end += length
00218       if python3:
00219         self.workspace_region_pose.header.frame_id = str[start:end].decode('utf-8')
00220       else:
00221         self.workspace_region_pose.header.frame_id = str[start:end]
00222       _x = self
00223       start = end
00224       end += 56
00225       (_x.workspace_region_pose.pose.position.x, _x.workspace_region_pose.pose.position.y, _x.workspace_region_pose.pose.position.z, _x.workspace_region_pose.pose.orientation.x, _x.workspace_region_pose.pose.orientation.y, _x.workspace_region_pose.pose.orientation.z, _x.workspace_region_pose.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00226       return self
00227     except struct.error as e:
00228       raise genpy.DeserializationError(e) #most likely buffer underfill
00229 
00230 
00231   def serialize_numpy(self, buff, numpy):
00232     """
00233     serialize message with numpy array types into buffer
00234     :param buff: buffer, ``StringIO``
00235     :param numpy: numpy python module
00236     """
00237     try:
00238       buff.write(_struct_b.pack(self.workspace_region_shape.type))
00239       length = len(self.workspace_region_shape.dimensions)
00240       buff.write(_struct_I.pack(length))
00241       pattern = '<%sd'%length
00242       buff.write(self.workspace_region_shape.dimensions.tostring())
00243       length = len(self.workspace_region_shape.triangles)
00244       buff.write(_struct_I.pack(length))
00245       pattern = '<%si'%length
00246       buff.write(self.workspace_region_shape.triangles.tostring())
00247       length = len(self.workspace_region_shape.vertices)
00248       buff.write(_struct_I.pack(length))
00249       for val1 in self.workspace_region_shape.vertices:
00250         _x = val1
00251         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00252       _x = self
00253       buff.write(_struct_3I.pack(_x.workspace_region_pose.header.seq, _x.workspace_region_pose.header.stamp.secs, _x.workspace_region_pose.header.stamp.nsecs))
00254       _x = self.workspace_region_pose.header.frame_id
00255       length = len(_x)
00256       if python3 or type(_x) == unicode:
00257         _x = _x.encode('utf-8')
00258         length = len(_x)
00259       buff.write(struct.pack('<I%ss'%length, length, _x))
00260       _x = self
00261       buff.write(_struct_7d.pack(_x.workspace_region_pose.pose.position.x, _x.workspace_region_pose.pose.position.y, _x.workspace_region_pose.pose.position.z, _x.workspace_region_pose.pose.orientation.x, _x.workspace_region_pose.pose.orientation.y, _x.workspace_region_pose.pose.orientation.z, _x.workspace_region_pose.pose.orientation.w))
00262     except struct.error as se: self._check_types(se)
00263     except TypeError as te: self._check_types(te)
00264 
00265   def deserialize_numpy(self, str, numpy):
00266     """
00267     unpack serialized message in str into this message instance using numpy for array types
00268     :param str: byte array of serialized message, ``str``
00269     :param numpy: numpy python module
00270     """
00271     try:
00272       if self.workspace_region_shape is None:
00273         self.workspace_region_shape = arm_navigation_msgs.msg.Shape()
00274       if self.workspace_region_pose is None:
00275         self.workspace_region_pose = geometry_msgs.msg.PoseStamped()
00276       end = 0
00277       start = end
00278       end += 1
00279       (self.workspace_region_shape.type,) = _struct_b.unpack(str[start:end])
00280       start = end
00281       end += 4
00282       (length,) = _struct_I.unpack(str[start:end])
00283       pattern = '<%sd'%length
00284       start = end
00285       end += struct.calcsize(pattern)
00286       self.workspace_region_shape.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00287       start = end
00288       end += 4
00289       (length,) = _struct_I.unpack(str[start:end])
00290       pattern = '<%si'%length
00291       start = end
00292       end += struct.calcsize(pattern)
00293       self.workspace_region_shape.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00294       start = end
00295       end += 4
00296       (length,) = _struct_I.unpack(str[start:end])
00297       self.workspace_region_shape.vertices = []
00298       for i in range(0, length):
00299         val1 = geometry_msgs.msg.Point()
00300         _x = val1
00301         start = end
00302         end += 24
00303         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00304         self.workspace_region_shape.vertices.append(val1)
00305       _x = self
00306       start = end
00307       end += 12
00308       (_x.workspace_region_pose.header.seq, _x.workspace_region_pose.header.stamp.secs, _x.workspace_region_pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00309       start = end
00310       end += 4
00311       (length,) = _struct_I.unpack(str[start:end])
00312       start = end
00313       end += length
00314       if python3:
00315         self.workspace_region_pose.header.frame_id = str[start:end].decode('utf-8')
00316       else:
00317         self.workspace_region_pose.header.frame_id = str[start:end]
00318       _x = self
00319       start = end
00320       end += 56
00321       (_x.workspace_region_pose.pose.position.x, _x.workspace_region_pose.pose.position.y, _x.workspace_region_pose.pose.position.z, _x.workspace_region_pose.pose.orientation.x, _x.workspace_region_pose.pose.orientation.y, _x.workspace_region_pose.pose.orientation.z, _x.workspace_region_pose.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00322       return self
00323     except struct.error as e:
00324       raise genpy.DeserializationError(e) #most likely buffer underfill
00325 
00326 _struct_I = genpy.struct_I
00327 _struct_3I = struct.Struct("<3I")
00328 _struct_b = struct.Struct("<b")
00329 _struct_7d = struct.Struct("<7d")
00330 _struct_3d = struct.Struct("<3d")


arm_navigation_msgs
Author(s): Gil Jones
autogenerated on Mon Dec 2 2013 12:31:50