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