$search
00001 """autogenerated by genmsg_py from TestGripperPoseActionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import pr2_object_manipulation_msgs.msg 00006 import geometry_msgs.msg 00007 import roslib.rostime 00008 import actionlib_msgs.msg 00009 import std_msgs.msg 00010 00011 class TestGripperPoseActionGoal(roslib.message.Message): 00012 _md5sum = "5067ef535f5d5fdf77165ddaf937546c" 00013 _type = "pr2_object_manipulation_msgs/TestGripperPoseActionGoal" 00014 _has_header = True #flag to mark the presence of a Header object 00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00016 00017 Header header 00018 actionlib_msgs/GoalID goal_id 00019 TestGripperPoseGoal goal 00020 00021 ================================================================================ 00022 MSG: std_msgs/Header 00023 # Standard metadata for higher-level stamped data types. 00024 # This is generally used to communicate timestamped data 00025 # in a particular coordinate frame. 00026 # 00027 # sequence ID: consecutively increasing ID 00028 uint32 seq 00029 #Two-integer timestamp that is expressed as: 00030 # * stamp.secs: seconds (stamp_secs) since epoch 00031 # * stamp.nsecs: nanoseconds since stamp_secs 00032 # time-handling sugar is provided by the client library 00033 time stamp 00034 #Frame this data is associated with 00035 # 0: no frame 00036 # 1: global frame 00037 string frame_id 00038 00039 ================================================================================ 00040 MSG: actionlib_msgs/GoalID 00041 # The stamp should store the time at which this goal was requested. 00042 # It is used by an action server when it tries to preempt all 00043 # goals that were requested before a certain time 00044 time stamp 00045 00046 # The id provides a way to associate feedback and 00047 # result message with specific goal requests. The id 00048 # specified must be unique. 00049 string id 00050 00051 00052 ================================================================================ 00053 MSG: pr2_object_manipulation_msgs/TestGripperPoseGoal 00054 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00055 geometry_msgs/PoseStamped[] gripper_poses 00056 float32[] gripper_openings 00057 00058 ================================================================================ 00059 MSG: geometry_msgs/PoseStamped 00060 # A Pose with reference coordinate frame and timestamp 00061 Header header 00062 Pose pose 00063 00064 ================================================================================ 00065 MSG: geometry_msgs/Pose 00066 # A representation of pose in free space, composed of postion and orientation. 00067 Point position 00068 Quaternion orientation 00069 00070 ================================================================================ 00071 MSG: geometry_msgs/Point 00072 # This contains the position of a point in free space 00073 float64 x 00074 float64 y 00075 float64 z 00076 00077 ================================================================================ 00078 MSG: geometry_msgs/Quaternion 00079 # This represents an orientation in free space in quaternion form. 00080 00081 float64 x 00082 float64 y 00083 float64 z 00084 float64 w 00085 00086 """ 00087 __slots__ = ['header','goal_id','goal'] 00088 _slot_types = ['Header','actionlib_msgs/GoalID','pr2_object_manipulation_msgs/TestGripperPoseGoal'] 00089 00090 def __init__(self, *args, **kwds): 00091 """ 00092 Constructor. Any message fields that are implicitly/explicitly 00093 set to None will be assigned a default value. The recommend 00094 use is keyword arguments as this is more robust to future message 00095 changes. You cannot mix in-order arguments and keyword arguments. 00096 00097 The available fields are: 00098 header,goal_id,goal 00099 00100 @param args: complete set of field values, in .msg order 00101 @param kwds: use keyword arguments corresponding to message field names 00102 to set specific fields. 00103 """ 00104 if args or kwds: 00105 super(TestGripperPoseActionGoal, self).__init__(*args, **kwds) 00106 #message fields cannot be None, assign default values for those that are 00107 if self.header is None: 00108 self.header = std_msgs.msg._Header.Header() 00109 if self.goal_id is None: 00110 self.goal_id = actionlib_msgs.msg.GoalID() 00111 if self.goal is None: 00112 self.goal = pr2_object_manipulation_msgs.msg.TestGripperPoseGoal() 00113 else: 00114 self.header = std_msgs.msg._Header.Header() 00115 self.goal_id = actionlib_msgs.msg.GoalID() 00116 self.goal = pr2_object_manipulation_msgs.msg.TestGripperPoseGoal() 00117 00118 def _get_types(self): 00119 """ 00120 internal API method 00121 """ 00122 return self._slot_types 00123 00124 def serialize(self, buff): 00125 """ 00126 serialize message into buffer 00127 @param buff: buffer 00128 @type buff: StringIO 00129 """ 00130 try: 00131 _x = self 00132 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00133 _x = self.header.frame_id 00134 length = len(_x) 00135 buff.write(struct.pack('<I%ss'%length, length, _x)) 00136 _x = self 00137 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00138 _x = self.goal_id.id 00139 length = len(_x) 00140 buff.write(struct.pack('<I%ss'%length, length, _x)) 00141 length = len(self.goal.gripper_poses) 00142 buff.write(_struct_I.pack(length)) 00143 for val1 in self.goal.gripper_poses: 00144 _v1 = val1.header 00145 buff.write(_struct_I.pack(_v1.seq)) 00146 _v2 = _v1.stamp 00147 _x = _v2 00148 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00149 _x = _v1.frame_id 00150 length = len(_x) 00151 buff.write(struct.pack('<I%ss'%length, length, _x)) 00152 _v3 = val1.pose 00153 _v4 = _v3.position 00154 _x = _v4 00155 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00156 _v5 = _v3.orientation 00157 _x = _v5 00158 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00159 length = len(self.goal.gripper_openings) 00160 buff.write(_struct_I.pack(length)) 00161 pattern = '<%sf'%length 00162 buff.write(struct.pack(pattern, *self.goal.gripper_openings)) 00163 except struct.error as se: self._check_types(se) 00164 except TypeError as 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.header is None: 00174 self.header = std_msgs.msg._Header.Header() 00175 if self.goal_id is None: 00176 self.goal_id = actionlib_msgs.msg.GoalID() 00177 if self.goal is None: 00178 self.goal = pr2_object_manipulation_msgs.msg.TestGripperPoseGoal() 00179 end = 0 00180 _x = self 00181 start = end 00182 end += 12 00183 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00184 start = end 00185 end += 4 00186 (length,) = _struct_I.unpack(str[start:end]) 00187 start = end 00188 end += length 00189 self.header.frame_id = str[start:end] 00190 _x = self 00191 start = end 00192 end += 8 00193 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00194 start = end 00195 end += 4 00196 (length,) = _struct_I.unpack(str[start:end]) 00197 start = end 00198 end += length 00199 self.goal_id.id = str[start:end] 00200 start = end 00201 end += 4 00202 (length,) = _struct_I.unpack(str[start:end]) 00203 self.goal.gripper_poses = [] 00204 for i in range(0, length): 00205 val1 = geometry_msgs.msg.PoseStamped() 00206 _v6 = val1.header 00207 start = end 00208 end += 4 00209 (_v6.seq,) = _struct_I.unpack(str[start:end]) 00210 _v7 = _v6.stamp 00211 _x = _v7 00212 start = end 00213 end += 8 00214 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00215 start = end 00216 end += 4 00217 (length,) = _struct_I.unpack(str[start:end]) 00218 start = end 00219 end += length 00220 _v6.frame_id = str[start:end] 00221 _v8 = val1.pose 00222 _v9 = _v8.position 00223 _x = _v9 00224 start = end 00225 end += 24 00226 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00227 _v10 = _v8.orientation 00228 _x = _v10 00229 start = end 00230 end += 32 00231 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00232 self.goal.gripper_poses.append(val1) 00233 start = end 00234 end += 4 00235 (length,) = _struct_I.unpack(str[start:end]) 00236 pattern = '<%sf'%length 00237 start = end 00238 end += struct.calcsize(pattern) 00239 self.goal.gripper_openings = struct.unpack(pattern, str[start:end]) 00240 return self 00241 except struct.error as e: 00242 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00243 00244 00245 def serialize_numpy(self, buff, numpy): 00246 """ 00247 serialize message with numpy array types into buffer 00248 @param buff: buffer 00249 @type buff: StringIO 00250 @param numpy: numpy python module 00251 @type numpy module 00252 """ 00253 try: 00254 _x = self 00255 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00256 _x = self.header.frame_id 00257 length = len(_x) 00258 buff.write(struct.pack('<I%ss'%length, length, _x)) 00259 _x = self 00260 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs)) 00261 _x = self.goal_id.id 00262 length = len(_x) 00263 buff.write(struct.pack('<I%ss'%length, length, _x)) 00264 length = len(self.goal.gripper_poses) 00265 buff.write(_struct_I.pack(length)) 00266 for val1 in self.goal.gripper_poses: 00267 _v11 = val1.header 00268 buff.write(_struct_I.pack(_v11.seq)) 00269 _v12 = _v11.stamp 00270 _x = _v12 00271 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00272 _x = _v11.frame_id 00273 length = len(_x) 00274 buff.write(struct.pack('<I%ss'%length, length, _x)) 00275 _v13 = val1.pose 00276 _v14 = _v13.position 00277 _x = _v14 00278 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00279 _v15 = _v13.orientation 00280 _x = _v15 00281 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00282 length = len(self.goal.gripper_openings) 00283 buff.write(_struct_I.pack(length)) 00284 pattern = '<%sf'%length 00285 buff.write(self.goal.gripper_openings.tostring()) 00286 except struct.error as se: self._check_types(se) 00287 except TypeError as te: self._check_types(te) 00288 00289 def deserialize_numpy(self, str, numpy): 00290 """ 00291 unpack serialized message in str into this message instance using numpy for array types 00292 @param str: byte array of serialized message 00293 @type str: str 00294 @param numpy: numpy python module 00295 @type numpy: module 00296 """ 00297 try: 00298 if self.header is None: 00299 self.header = std_msgs.msg._Header.Header() 00300 if self.goal_id is None: 00301 self.goal_id = actionlib_msgs.msg.GoalID() 00302 if self.goal is None: 00303 self.goal = pr2_object_manipulation_msgs.msg.TestGripperPoseGoal() 00304 end = 0 00305 _x = self 00306 start = end 00307 end += 12 00308 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00309 start = end 00310 end += 4 00311 (length,) = _struct_I.unpack(str[start:end]) 00312 start = end 00313 end += length 00314 self.header.frame_id = str[start:end] 00315 _x = self 00316 start = end 00317 end += 8 00318 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00319 start = end 00320 end += 4 00321 (length,) = _struct_I.unpack(str[start:end]) 00322 start = end 00323 end += length 00324 self.goal_id.id = str[start:end] 00325 start = end 00326 end += 4 00327 (length,) = _struct_I.unpack(str[start:end]) 00328 self.goal.gripper_poses = [] 00329 for i in range(0, length): 00330 val1 = geometry_msgs.msg.PoseStamped() 00331 _v16 = val1.header 00332 start = end 00333 end += 4 00334 (_v16.seq,) = _struct_I.unpack(str[start:end]) 00335 _v17 = _v16.stamp 00336 _x = _v17 00337 start = end 00338 end += 8 00339 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00340 start = end 00341 end += 4 00342 (length,) = _struct_I.unpack(str[start:end]) 00343 start = end 00344 end += length 00345 _v16.frame_id = str[start:end] 00346 _v18 = val1.pose 00347 _v19 = _v18.position 00348 _x = _v19 00349 start = end 00350 end += 24 00351 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00352 _v20 = _v18.orientation 00353 _x = _v20 00354 start = end 00355 end += 32 00356 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00357 self.goal.gripper_poses.append(val1) 00358 start = end 00359 end += 4 00360 (length,) = _struct_I.unpack(str[start:end]) 00361 pattern = '<%sf'%length 00362 start = end 00363 end += struct.calcsize(pattern) 00364 self.goal.gripper_openings = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00365 return self 00366 except struct.error as e: 00367 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00368 00369 _struct_I = roslib.message.struct_I 00370 _struct_4d = struct.Struct("<4d") 00371 _struct_3I = struct.Struct("<3I") 00372 _struct_2I = struct.Struct("<2I") 00373 _struct_3d = struct.Struct("<3d")