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


pr2_object_manipulation_msgs
Author(s): Matei Ciocarlie
autogenerated on Fri Jan 3 2014 11:59:13