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