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