$search
00001 """autogenerated by genmsg_py from GenerateGraspRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class GenerateGraspRequest(roslib.message.Message): 00007 _md5sum = "7ffa75655a6721d5c28cbaab0c7b2d37" 00008 _type = "graspit_ros_planning_msgs/GenerateGraspRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """ 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 int32 model_id 00021 00022 00023 float32 energy_low_threshold 00024 00025 00026 float32 energy_high_threshold 00027 00028 00029 bool reject_fingertip_collision 00030 00031 00032 bool request_tabletop 00033 00034 00035 string tabletop_file_name 00036 00037 """ 00038 __slots__ = ['model_id','energy_low_threshold','energy_high_threshold','reject_fingertip_collision','request_tabletop','tabletop_file_name'] 00039 _slot_types = ['int32','float32','float32','bool','bool','string'] 00040 00041 def __init__(self, *args, **kwds): 00042 """ 00043 Constructor. Any message fields that are implicitly/explicitly 00044 set to None will be assigned a default value. The recommend 00045 use is keyword arguments as this is more robust to future message 00046 changes. You cannot mix in-order arguments and keyword arguments. 00047 00048 The available fields are: 00049 model_id,energy_low_threshold,energy_high_threshold,reject_fingertip_collision,request_tabletop,tabletop_file_name 00050 00051 @param args: complete set of field values, in .msg order 00052 @param kwds: use keyword arguments corresponding to message field names 00053 to set specific fields. 00054 """ 00055 if args or kwds: 00056 super(GenerateGraspRequest, self).__init__(*args, **kwds) 00057 #message fields cannot be None, assign default values for those that are 00058 if self.model_id is None: 00059 self.model_id = 0 00060 if self.energy_low_threshold is None: 00061 self.energy_low_threshold = 0. 00062 if self.energy_high_threshold is None: 00063 self.energy_high_threshold = 0. 00064 if self.reject_fingertip_collision is None: 00065 self.reject_fingertip_collision = False 00066 if self.request_tabletop is None: 00067 self.request_tabletop = False 00068 if self.tabletop_file_name is None: 00069 self.tabletop_file_name = '' 00070 else: 00071 self.model_id = 0 00072 self.energy_low_threshold = 0. 00073 self.energy_high_threshold = 0. 00074 self.reject_fingertip_collision = False 00075 self.request_tabletop = False 00076 self.tabletop_file_name = '' 00077 00078 def _get_types(self): 00079 """ 00080 internal API method 00081 """ 00082 return self._slot_types 00083 00084 def serialize(self, buff): 00085 """ 00086 serialize message into buffer 00087 @param buff: buffer 00088 @type buff: StringIO 00089 """ 00090 try: 00091 _x = self 00092 buff.write(_struct_i2f2B.pack(_x.model_id, _x.energy_low_threshold, _x.energy_high_threshold, _x.reject_fingertip_collision, _x.request_tabletop)) 00093 _x = self.tabletop_file_name 00094 length = len(_x) 00095 buff.write(struct.pack('<I%ss'%length, length, _x)) 00096 except struct.error as se: self._check_types(se) 00097 except TypeError as te: self._check_types(te) 00098 00099 def deserialize(self, str): 00100 """ 00101 unpack serialized message in str into this message instance 00102 @param str: byte array of serialized message 00103 @type str: str 00104 """ 00105 try: 00106 end = 0 00107 _x = self 00108 start = end 00109 end += 14 00110 (_x.model_id, _x.energy_low_threshold, _x.energy_high_threshold, _x.reject_fingertip_collision, _x.request_tabletop,) = _struct_i2f2B.unpack(str[start:end]) 00111 self.reject_fingertip_collision = bool(self.reject_fingertip_collision) 00112 self.request_tabletop = bool(self.request_tabletop) 00113 start = end 00114 end += 4 00115 (length,) = _struct_I.unpack(str[start:end]) 00116 start = end 00117 end += length 00118 self.tabletop_file_name = str[start:end] 00119 return self 00120 except struct.error as e: 00121 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00122 00123 00124 def serialize_numpy(self, buff, numpy): 00125 """ 00126 serialize message with numpy array types into buffer 00127 @param buff: buffer 00128 @type buff: StringIO 00129 @param numpy: numpy python module 00130 @type numpy module 00131 """ 00132 try: 00133 _x = self 00134 buff.write(_struct_i2f2B.pack(_x.model_id, _x.energy_low_threshold, _x.energy_high_threshold, _x.reject_fingertip_collision, _x.request_tabletop)) 00135 _x = self.tabletop_file_name 00136 length = len(_x) 00137 buff.write(struct.pack('<I%ss'%length, length, _x)) 00138 except struct.error as se: self._check_types(se) 00139 except TypeError as te: self._check_types(te) 00140 00141 def deserialize_numpy(self, str, numpy): 00142 """ 00143 unpack serialized message in str into this message instance using numpy for array types 00144 @param str: byte array of serialized message 00145 @type str: str 00146 @param numpy: numpy python module 00147 @type numpy: module 00148 """ 00149 try: 00150 end = 0 00151 _x = self 00152 start = end 00153 end += 14 00154 (_x.model_id, _x.energy_low_threshold, _x.energy_high_threshold, _x.reject_fingertip_collision, _x.request_tabletop,) = _struct_i2f2B.unpack(str[start:end]) 00155 self.reject_fingertip_collision = bool(self.reject_fingertip_collision) 00156 self.request_tabletop = bool(self.request_tabletop) 00157 start = end 00158 end += 4 00159 (length,) = _struct_I.unpack(str[start:end]) 00160 start = end 00161 end += length 00162 self.tabletop_file_name = str[start:end] 00163 return self 00164 except struct.error as e: 00165 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00166 00167 _struct_I = roslib.message.struct_I 00168 _struct_i2f2B = struct.Struct("<i2f2B") 00169 """autogenerated by genmsg_py from GenerateGraspResponse.msg. Do not edit.""" 00170 import roslib.message 00171 import struct 00172 00173 import geometry_msgs.msg 00174 00175 class GenerateGraspResponse(roslib.message.Message): 00176 _md5sum = "886c12418c3c95650818d6b3a5f6511b" 00177 _type = "graspit_ros_planning_msgs/GenerateGraspResponse" 00178 _has_header = False #flag to mark the presence of a Header object 00179 _full_text = """ 00180 00181 int32 GENERATE_SUCCESS = 0 00182 int32 GENERATE_FAILURE = 1 00183 int32 result 00184 00185 00186 bool hand_object_collision 00187 00188 00189 geometry_msgs/Pose grasp_pose 00190 00191 00192 float32 grasp_joint_angle 00193 00194 00195 float32 grasp_energy 00196 00197 00198 float64 gripper_tabletop_clearance 00199 00200 00201 float64 gripper_object_distance 00202 00203 00204 00205 ================================================================================ 00206 MSG: geometry_msgs/Pose 00207 # A representation of pose in free space, composed of postion and orientation. 00208 Point position 00209 Quaternion orientation 00210 00211 ================================================================================ 00212 MSG: geometry_msgs/Point 00213 # This contains the position of a point in free space 00214 float64 x 00215 float64 y 00216 float64 z 00217 00218 ================================================================================ 00219 MSG: geometry_msgs/Quaternion 00220 # This represents an orientation in free space in quaternion form. 00221 00222 float64 x 00223 float64 y 00224 float64 z 00225 float64 w 00226 00227 """ 00228 # Pseudo-constants 00229 GENERATE_SUCCESS = 0 00230 GENERATE_FAILURE = 1 00231 00232 __slots__ = ['result','hand_object_collision','grasp_pose','grasp_joint_angle','grasp_energy','gripper_tabletop_clearance','gripper_object_distance'] 00233 _slot_types = ['int32','bool','geometry_msgs/Pose','float32','float32','float64','float64'] 00234 00235 def __init__(self, *args, **kwds): 00236 """ 00237 Constructor. Any message fields that are implicitly/explicitly 00238 set to None will be assigned a default value. The recommend 00239 use is keyword arguments as this is more robust to future message 00240 changes. You cannot mix in-order arguments and keyword arguments. 00241 00242 The available fields are: 00243 result,hand_object_collision,grasp_pose,grasp_joint_angle,grasp_energy,gripper_tabletop_clearance,gripper_object_distance 00244 00245 @param args: complete set of field values, in .msg order 00246 @param kwds: use keyword arguments corresponding to message field names 00247 to set specific fields. 00248 """ 00249 if args or kwds: 00250 super(GenerateGraspResponse, self).__init__(*args, **kwds) 00251 #message fields cannot be None, assign default values for those that are 00252 if self.result is None: 00253 self.result = 0 00254 if self.hand_object_collision is None: 00255 self.hand_object_collision = False 00256 if self.grasp_pose is None: 00257 self.grasp_pose = geometry_msgs.msg.Pose() 00258 if self.grasp_joint_angle is None: 00259 self.grasp_joint_angle = 0. 00260 if self.grasp_energy is None: 00261 self.grasp_energy = 0. 00262 if self.gripper_tabletop_clearance is None: 00263 self.gripper_tabletop_clearance = 0. 00264 if self.gripper_object_distance is None: 00265 self.gripper_object_distance = 0. 00266 else: 00267 self.result = 0 00268 self.hand_object_collision = False 00269 self.grasp_pose = geometry_msgs.msg.Pose() 00270 self.grasp_joint_angle = 0. 00271 self.grasp_energy = 0. 00272 self.gripper_tabletop_clearance = 0. 00273 self.gripper_object_distance = 0. 00274 00275 def _get_types(self): 00276 """ 00277 internal API method 00278 """ 00279 return self._slot_types 00280 00281 def serialize(self, buff): 00282 """ 00283 serialize message into buffer 00284 @param buff: buffer 00285 @type buff: StringIO 00286 """ 00287 try: 00288 _x = self 00289 buff.write(_struct_iB7d2f2d.pack(_x.result, _x.hand_object_collision, _x.grasp_pose.position.x, _x.grasp_pose.position.y, _x.grasp_pose.position.z, _x.grasp_pose.orientation.x, _x.grasp_pose.orientation.y, _x.grasp_pose.orientation.z, _x.grasp_pose.orientation.w, _x.grasp_joint_angle, _x.grasp_energy, _x.gripper_tabletop_clearance, _x.gripper_object_distance)) 00290 except struct.error as se: self._check_types(se) 00291 except TypeError as te: self._check_types(te) 00292 00293 def deserialize(self, str): 00294 """ 00295 unpack serialized message in str into this message instance 00296 @param str: byte array of serialized message 00297 @type str: str 00298 """ 00299 try: 00300 if self.grasp_pose is None: 00301 self.grasp_pose = geometry_msgs.msg.Pose() 00302 end = 0 00303 _x = self 00304 start = end 00305 end += 85 00306 (_x.result, _x.hand_object_collision, _x.grasp_pose.position.x, _x.grasp_pose.position.y, _x.grasp_pose.position.z, _x.grasp_pose.orientation.x, _x.grasp_pose.orientation.y, _x.grasp_pose.orientation.z, _x.grasp_pose.orientation.w, _x.grasp_joint_angle, _x.grasp_energy, _x.gripper_tabletop_clearance, _x.gripper_object_distance,) = _struct_iB7d2f2d.unpack(str[start:end]) 00307 self.hand_object_collision = bool(self.hand_object_collision) 00308 return self 00309 except struct.error as e: 00310 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00311 00312 00313 def serialize_numpy(self, buff, numpy): 00314 """ 00315 serialize message with numpy array types into buffer 00316 @param buff: buffer 00317 @type buff: StringIO 00318 @param numpy: numpy python module 00319 @type numpy module 00320 """ 00321 try: 00322 _x = self 00323 buff.write(_struct_iB7d2f2d.pack(_x.result, _x.hand_object_collision, _x.grasp_pose.position.x, _x.grasp_pose.position.y, _x.grasp_pose.position.z, _x.grasp_pose.orientation.x, _x.grasp_pose.orientation.y, _x.grasp_pose.orientation.z, _x.grasp_pose.orientation.w, _x.grasp_joint_angle, _x.grasp_energy, _x.gripper_tabletop_clearance, _x.gripper_object_distance)) 00324 except struct.error as se: self._check_types(se) 00325 except TypeError as te: self._check_types(te) 00326 00327 def deserialize_numpy(self, str, numpy): 00328 """ 00329 unpack serialized message in str into this message instance using numpy for array types 00330 @param str: byte array of serialized message 00331 @type str: str 00332 @param numpy: numpy python module 00333 @type numpy: module 00334 """ 00335 try: 00336 if self.grasp_pose is None: 00337 self.grasp_pose = geometry_msgs.msg.Pose() 00338 end = 0 00339 _x = self 00340 start = end 00341 end += 85 00342 (_x.result, _x.hand_object_collision, _x.grasp_pose.position.x, _x.grasp_pose.position.y, _x.grasp_pose.position.z, _x.grasp_pose.orientation.x, _x.grasp_pose.orientation.y, _x.grasp_pose.orientation.z, _x.grasp_pose.orientation.w, _x.grasp_joint_angle, _x.grasp_energy, _x.gripper_tabletop_clearance, _x.gripper_object_distance,) = _struct_iB7d2f2d.unpack(str[start:end]) 00343 self.hand_object_collision = bool(self.hand_object_collision) 00344 return self 00345 except struct.error as e: 00346 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00347 00348 _struct_I = roslib.message.struct_I 00349 _struct_iB7d2f2d = struct.Struct("<iB7d2f2d") 00350 class GenerateGrasp(roslib.message.ServiceDefinition): 00351 _type = 'graspit_ros_planning_msgs/GenerateGrasp' 00352 _md5sum = 'f1c3a9961097a13105ff34e75a3ade6f' 00353 _request_class = GenerateGraspRequest 00354 _response_class = GenerateGraspResponse