$search
00001 """autogenerated by genmsg_py from GraspAdjustGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 import sensor_msgs.msg 00008 00009 class GraspAdjustGoal(roslib.message.Message): 00010 _md5sum = "060fcd54eb8073631ee72fceac5fcf37" 00011 _type = "pr2_grasp_adjust/GraspAdjustGoal" 00012 _has_header = False #flag to mark the presence of a Header object 00013 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00014 #goal definition 00015 00016 sensor_msgs/PointCloud2 cloud 00017 geometry_msgs/PoseStamped pose_stamped 00018 bool use_orientation 00019 int32 seed_index 00020 uint8 search_mode 00021 00022 int32 GLOBAL_SEARCH = 0 00023 int32 LOCAL_SEARCH = 1 00024 int32 SINGLE_POSE = 2 00025 00026 00027 ================================================================================ 00028 MSG: sensor_msgs/PointCloud2 00029 # This message holds a collection of N-dimensional points, which may 00030 # contain additional information such as normals, intensity, etc. The 00031 # point data is stored as a binary blob, its layout described by the 00032 # contents of the "fields" array. 00033 00034 # The point cloud data may be organized 2d (image-like) or 1d 00035 # (unordered). Point clouds organized as 2d images may be produced by 00036 # camera depth sensors such as stereo or time-of-flight. 00037 00038 # Time of sensor data acquisition, and the coordinate frame ID (for 3d 00039 # points). 00040 Header header 00041 00042 # 2D structure of the point cloud. If the cloud is unordered, height is 00043 # 1 and width is the length of the point cloud. 00044 uint32 height 00045 uint32 width 00046 00047 # Describes the channels and their layout in the binary data blob. 00048 PointField[] fields 00049 00050 bool is_bigendian # Is this data bigendian? 00051 uint32 point_step # Length of a point in bytes 00052 uint32 row_step # Length of a row in bytes 00053 uint8[] data # Actual point data, size is (row_step*height) 00054 00055 bool is_dense # True if there are no invalid points 00056 00057 ================================================================================ 00058 MSG: std_msgs/Header 00059 # Standard metadata for higher-level stamped data types. 00060 # This is generally used to communicate timestamped data 00061 # in a particular coordinate frame. 00062 # 00063 # sequence ID: consecutively increasing ID 00064 uint32 seq 00065 #Two-integer timestamp that is expressed as: 00066 # * stamp.secs: seconds (stamp_secs) since epoch 00067 # * stamp.nsecs: nanoseconds since stamp_secs 00068 # time-handling sugar is provided by the client library 00069 time stamp 00070 #Frame this data is associated with 00071 # 0: no frame 00072 # 1: global frame 00073 string frame_id 00074 00075 ================================================================================ 00076 MSG: sensor_msgs/PointField 00077 # This message holds the description of one point entry in the 00078 # PointCloud2 message format. 00079 uint8 INT8 = 1 00080 uint8 UINT8 = 2 00081 uint8 INT16 = 3 00082 uint8 UINT16 = 4 00083 uint8 INT32 = 5 00084 uint8 UINT32 = 6 00085 uint8 FLOAT32 = 7 00086 uint8 FLOAT64 = 8 00087 00088 string name # Name of field 00089 uint32 offset # Offset from start of point struct 00090 uint8 datatype # Datatype enumeration, see above 00091 uint32 count # How many elements in the field 00092 00093 ================================================================================ 00094 MSG: geometry_msgs/PoseStamped 00095 # A Pose with reference coordinate frame and timestamp 00096 Header header 00097 Pose pose 00098 00099 ================================================================================ 00100 MSG: geometry_msgs/Pose 00101 # A representation of pose in free space, composed of postion and orientation. 00102 Point position 00103 Quaternion orientation 00104 00105 ================================================================================ 00106 MSG: geometry_msgs/Point 00107 # This contains the position of a point in free space 00108 float64 x 00109 float64 y 00110 float64 z 00111 00112 ================================================================================ 00113 MSG: geometry_msgs/Quaternion 00114 # This represents an orientation in free space in quaternion form. 00115 00116 float64 x 00117 float64 y 00118 float64 z 00119 float64 w 00120 00121 """ 00122 # Pseudo-constants 00123 GLOBAL_SEARCH = 0 00124 LOCAL_SEARCH = 1 00125 SINGLE_POSE = 2 00126 00127 __slots__ = ['cloud','pose_stamped','use_orientation','seed_index','search_mode'] 00128 _slot_types = ['sensor_msgs/PointCloud2','geometry_msgs/PoseStamped','bool','int32','uint8'] 00129 00130 def __init__(self, *args, **kwds): 00131 """ 00132 Constructor. Any message fields that are implicitly/explicitly 00133 set to None will be assigned a default value. The recommend 00134 use is keyword arguments as this is more robust to future message 00135 changes. You cannot mix in-order arguments and keyword arguments. 00136 00137 The available fields are: 00138 cloud,pose_stamped,use_orientation,seed_index,search_mode 00139 00140 @param args: complete set of field values, in .msg order 00141 @param kwds: use keyword arguments corresponding to message field names 00142 to set specific fields. 00143 """ 00144 if args or kwds: 00145 super(GraspAdjustGoal, self).__init__(*args, **kwds) 00146 #message fields cannot be None, assign default values for those that are 00147 if self.cloud is None: 00148 self.cloud = sensor_msgs.msg.PointCloud2() 00149 if self.pose_stamped is None: 00150 self.pose_stamped = geometry_msgs.msg.PoseStamped() 00151 if self.use_orientation is None: 00152 self.use_orientation = False 00153 if self.seed_index is None: 00154 self.seed_index = 0 00155 if self.search_mode is None: 00156 self.search_mode = 0 00157 else: 00158 self.cloud = sensor_msgs.msg.PointCloud2() 00159 self.pose_stamped = geometry_msgs.msg.PoseStamped() 00160 self.use_orientation = False 00161 self.seed_index = 0 00162 self.search_mode = 0 00163 00164 def _get_types(self): 00165 """ 00166 internal API method 00167 """ 00168 return self._slot_types 00169 00170 def serialize(self, buff): 00171 """ 00172 serialize message into buffer 00173 @param buff: buffer 00174 @type buff: StringIO 00175 """ 00176 try: 00177 _x = self 00178 buff.write(_struct_3I.pack(_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs)) 00179 _x = self.cloud.header.frame_id 00180 length = len(_x) 00181 buff.write(struct.pack('<I%ss'%length, length, _x)) 00182 _x = self 00183 buff.write(_struct_2I.pack(_x.cloud.height, _x.cloud.width)) 00184 length = len(self.cloud.fields) 00185 buff.write(_struct_I.pack(length)) 00186 for val1 in self.cloud.fields: 00187 _x = val1.name 00188 length = len(_x) 00189 buff.write(struct.pack('<I%ss'%length, length, _x)) 00190 _x = val1 00191 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00192 _x = self 00193 buff.write(_struct_B2I.pack(_x.cloud.is_bigendian, _x.cloud.point_step, _x.cloud.row_step)) 00194 _x = self.cloud.data 00195 length = len(_x) 00196 # - if encoded as a list instead, serialize as bytes instead of string 00197 if type(_x) in [list, tuple]: 00198 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00199 else: 00200 buff.write(struct.pack('<I%ss'%length, length, _x)) 00201 _x = self 00202 buff.write(_struct_B3I.pack(_x.cloud.is_dense, _x.pose_stamped.header.seq, _x.pose_stamped.header.stamp.secs, _x.pose_stamped.header.stamp.nsecs)) 00203 _x = self.pose_stamped.header.frame_id 00204 length = len(_x) 00205 buff.write(struct.pack('<I%ss'%length, length, _x)) 00206 _x = self 00207 buff.write(_struct_7dBiB.pack(_x.pose_stamped.pose.position.x, _x.pose_stamped.pose.position.y, _x.pose_stamped.pose.position.z, _x.pose_stamped.pose.orientation.x, _x.pose_stamped.pose.orientation.y, _x.pose_stamped.pose.orientation.z, _x.pose_stamped.pose.orientation.w, _x.use_orientation, _x.seed_index, _x.search_mode)) 00208 except struct.error as se: self._check_types(se) 00209 except TypeError as te: self._check_types(te) 00210 00211 def deserialize(self, str): 00212 """ 00213 unpack serialized message in str into this message instance 00214 @param str: byte array of serialized message 00215 @type str: str 00216 """ 00217 try: 00218 if self.cloud is None: 00219 self.cloud = sensor_msgs.msg.PointCloud2() 00220 if self.pose_stamped is None: 00221 self.pose_stamped = geometry_msgs.msg.PoseStamped() 00222 end = 0 00223 _x = self 00224 start = end 00225 end += 12 00226 (_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00227 start = end 00228 end += 4 00229 (length,) = _struct_I.unpack(str[start:end]) 00230 start = end 00231 end += length 00232 self.cloud.header.frame_id = str[start:end] 00233 _x = self 00234 start = end 00235 end += 8 00236 (_x.cloud.height, _x.cloud.width,) = _struct_2I.unpack(str[start:end]) 00237 start = end 00238 end += 4 00239 (length,) = _struct_I.unpack(str[start:end]) 00240 self.cloud.fields = [] 00241 for i in range(0, length): 00242 val1 = sensor_msgs.msg.PointField() 00243 start = end 00244 end += 4 00245 (length,) = _struct_I.unpack(str[start:end]) 00246 start = end 00247 end += length 00248 val1.name = str[start:end] 00249 _x = val1 00250 start = end 00251 end += 9 00252 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00253 self.cloud.fields.append(val1) 00254 _x = self 00255 start = end 00256 end += 9 00257 (_x.cloud.is_bigendian, _x.cloud.point_step, _x.cloud.row_step,) = _struct_B2I.unpack(str[start:end]) 00258 self.cloud.is_bigendian = bool(self.cloud.is_bigendian) 00259 start = end 00260 end += 4 00261 (length,) = _struct_I.unpack(str[start:end]) 00262 start = end 00263 end += length 00264 self.cloud.data = str[start:end] 00265 _x = self 00266 start = end 00267 end += 13 00268 (_x.cloud.is_dense, _x.pose_stamped.header.seq, _x.pose_stamped.header.stamp.secs, _x.pose_stamped.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end]) 00269 self.cloud.is_dense = bool(self.cloud.is_dense) 00270 start = end 00271 end += 4 00272 (length,) = _struct_I.unpack(str[start:end]) 00273 start = end 00274 end += length 00275 self.pose_stamped.header.frame_id = str[start:end] 00276 _x = self 00277 start = end 00278 end += 62 00279 (_x.pose_stamped.pose.position.x, _x.pose_stamped.pose.position.y, _x.pose_stamped.pose.position.z, _x.pose_stamped.pose.orientation.x, _x.pose_stamped.pose.orientation.y, _x.pose_stamped.pose.orientation.z, _x.pose_stamped.pose.orientation.w, _x.use_orientation, _x.seed_index, _x.search_mode,) = _struct_7dBiB.unpack(str[start:end]) 00280 self.use_orientation = bool(self.use_orientation) 00281 return self 00282 except struct.error as e: 00283 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00284 00285 00286 def serialize_numpy(self, buff, numpy): 00287 """ 00288 serialize message with numpy array types into buffer 00289 @param buff: buffer 00290 @type buff: StringIO 00291 @param numpy: numpy python module 00292 @type numpy module 00293 """ 00294 try: 00295 _x = self 00296 buff.write(_struct_3I.pack(_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs)) 00297 _x = self.cloud.header.frame_id 00298 length = len(_x) 00299 buff.write(struct.pack('<I%ss'%length, length, _x)) 00300 _x = self 00301 buff.write(_struct_2I.pack(_x.cloud.height, _x.cloud.width)) 00302 length = len(self.cloud.fields) 00303 buff.write(_struct_I.pack(length)) 00304 for val1 in self.cloud.fields: 00305 _x = val1.name 00306 length = len(_x) 00307 buff.write(struct.pack('<I%ss'%length, length, _x)) 00308 _x = val1 00309 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count)) 00310 _x = self 00311 buff.write(_struct_B2I.pack(_x.cloud.is_bigendian, _x.cloud.point_step, _x.cloud.row_step)) 00312 _x = self.cloud.data 00313 length = len(_x) 00314 # - if encoded as a list instead, serialize as bytes instead of string 00315 if type(_x) in [list, tuple]: 00316 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00317 else: 00318 buff.write(struct.pack('<I%ss'%length, length, _x)) 00319 _x = self 00320 buff.write(_struct_B3I.pack(_x.cloud.is_dense, _x.pose_stamped.header.seq, _x.pose_stamped.header.stamp.secs, _x.pose_stamped.header.stamp.nsecs)) 00321 _x = self.pose_stamped.header.frame_id 00322 length = len(_x) 00323 buff.write(struct.pack('<I%ss'%length, length, _x)) 00324 _x = self 00325 buff.write(_struct_7dBiB.pack(_x.pose_stamped.pose.position.x, _x.pose_stamped.pose.position.y, _x.pose_stamped.pose.position.z, _x.pose_stamped.pose.orientation.x, _x.pose_stamped.pose.orientation.y, _x.pose_stamped.pose.orientation.z, _x.pose_stamped.pose.orientation.w, _x.use_orientation, _x.seed_index, _x.search_mode)) 00326 except struct.error as se: self._check_types(se) 00327 except TypeError as te: self._check_types(te) 00328 00329 def deserialize_numpy(self, str, numpy): 00330 """ 00331 unpack serialized message in str into this message instance using numpy for array types 00332 @param str: byte array of serialized message 00333 @type str: str 00334 @param numpy: numpy python module 00335 @type numpy: module 00336 """ 00337 try: 00338 if self.cloud is None: 00339 self.cloud = sensor_msgs.msg.PointCloud2() 00340 if self.pose_stamped is None: 00341 self.pose_stamped = geometry_msgs.msg.PoseStamped() 00342 end = 0 00343 _x = self 00344 start = end 00345 end += 12 00346 (_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00347 start = end 00348 end += 4 00349 (length,) = _struct_I.unpack(str[start:end]) 00350 start = end 00351 end += length 00352 self.cloud.header.frame_id = str[start:end] 00353 _x = self 00354 start = end 00355 end += 8 00356 (_x.cloud.height, _x.cloud.width,) = _struct_2I.unpack(str[start:end]) 00357 start = end 00358 end += 4 00359 (length,) = _struct_I.unpack(str[start:end]) 00360 self.cloud.fields = [] 00361 for i in range(0, length): 00362 val1 = sensor_msgs.msg.PointField() 00363 start = end 00364 end += 4 00365 (length,) = _struct_I.unpack(str[start:end]) 00366 start = end 00367 end += length 00368 val1.name = str[start:end] 00369 _x = val1 00370 start = end 00371 end += 9 00372 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end]) 00373 self.cloud.fields.append(val1) 00374 _x = self 00375 start = end 00376 end += 9 00377 (_x.cloud.is_bigendian, _x.cloud.point_step, _x.cloud.row_step,) = _struct_B2I.unpack(str[start:end]) 00378 self.cloud.is_bigendian = bool(self.cloud.is_bigendian) 00379 start = end 00380 end += 4 00381 (length,) = _struct_I.unpack(str[start:end]) 00382 start = end 00383 end += length 00384 self.cloud.data = str[start:end] 00385 _x = self 00386 start = end 00387 end += 13 00388 (_x.cloud.is_dense, _x.pose_stamped.header.seq, _x.pose_stamped.header.stamp.secs, _x.pose_stamped.header.stamp.nsecs,) = _struct_B3I.unpack(str[start:end]) 00389 self.cloud.is_dense = bool(self.cloud.is_dense) 00390 start = end 00391 end += 4 00392 (length,) = _struct_I.unpack(str[start:end]) 00393 start = end 00394 end += length 00395 self.pose_stamped.header.frame_id = str[start:end] 00396 _x = self 00397 start = end 00398 end += 62 00399 (_x.pose_stamped.pose.position.x, _x.pose_stamped.pose.position.y, _x.pose_stamped.pose.position.z, _x.pose_stamped.pose.orientation.x, _x.pose_stamped.pose.orientation.y, _x.pose_stamped.pose.orientation.z, _x.pose_stamped.pose.orientation.w, _x.use_orientation, _x.seed_index, _x.search_mode,) = _struct_7dBiB.unpack(str[start:end]) 00400 self.use_orientation = bool(self.use_orientation) 00401 return self 00402 except struct.error as e: 00403 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00404 00405 _struct_I = roslib.message.struct_I 00406 _struct_IBI = struct.Struct("<IBI") 00407 _struct_3I = struct.Struct("<3I") 00408 _struct_B3I = struct.Struct("<B3I") 00409 _struct_B2I = struct.Struct("<B2I") 00410 _struct_7dBiB = struct.Struct("<7dBiB") 00411 _struct_2I = struct.Struct("<2I")