_TestGripperPoseGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_object_manipulation_msgs/TestGripperPoseGoal.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 geometry_msgs.msg
00008 import std_msgs.msg
00009 
00010 class TestGripperPoseGoal(genpy.Message):
00011   _md5sum = "60df11f60923975932351322d083f23d"
00012   _type = "pr2_object_manipulation_msgs/TestGripperPoseGoal"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015 geometry_msgs/PoseStamped[] gripper_poses
00016 float32[] gripper_openings
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__ = ['gripper_poses','gripper_openings']
00066   _slot_types = ['geometry_msgs/PoseStamped[]','float32[]']
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        gripper_poses,gripper_openings
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(TestGripperPoseGoal, self).__init__(*args, **kwds)
00084       #message fields cannot be None, assign default values for those that are
00085       if self.gripper_poses is None:
00086         self.gripper_poses = []
00087       if self.gripper_openings is None:
00088         self.gripper_openings = []
00089     else:
00090       self.gripper_poses = []
00091       self.gripper_openings = []
00092 
00093   def _get_types(self):
00094     """
00095     internal API method
00096     """
00097     return self._slot_types
00098 
00099   def serialize(self, buff):
00100     """
00101     serialize message into buffer
00102     :param buff: buffer, ``StringIO``
00103     """
00104     try:
00105       length = len(self.gripper_poses)
00106       buff.write(_struct_I.pack(length))
00107       for val1 in self.gripper_poses:
00108         _v1 = val1.header
00109         buff.write(_struct_I.pack(_v1.seq))
00110         _v2 = _v1.stamp
00111         _x = _v2
00112         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00113         _x = _v1.frame_id
00114         length = len(_x)
00115         if python3 or type(_x) == unicode:
00116           _x = _x.encode('utf-8')
00117           length = len(_x)
00118         buff.write(struct.pack('<I%ss'%length, length, _x))
00119         _v3 = val1.pose
00120         _v4 = _v3.position
00121         _x = _v4
00122         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00123         _v5 = _v3.orientation
00124         _x = _v5
00125         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00126       length = len(self.gripper_openings)
00127       buff.write(_struct_I.pack(length))
00128       pattern = '<%sf'%length
00129       buff.write(struct.pack(pattern, *self.gripper_openings))
00130     except struct.error as se: self._check_types(se)
00131     except TypeError as te: self._check_types(te)
00132 
00133   def deserialize(self, str):
00134     """
00135     unpack serialized message in str into this message instance
00136     :param str: byte array of serialized message, ``str``
00137     """
00138     try:
00139       if self.gripper_poses is None:
00140         self.gripper_poses = None
00141       end = 0
00142       start = end
00143       end += 4
00144       (length,) = _struct_I.unpack(str[start:end])
00145       self.gripper_poses = []
00146       for i in range(0, length):
00147         val1 = geometry_msgs.msg.PoseStamped()
00148         _v6 = val1.header
00149         start = end
00150         end += 4
00151         (_v6.seq,) = _struct_I.unpack(str[start:end])
00152         _v7 = _v6.stamp
00153         _x = _v7
00154         start = end
00155         end += 8
00156         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00157         start = end
00158         end += 4
00159         (length,) = _struct_I.unpack(str[start:end])
00160         start = end
00161         end += length
00162         if python3:
00163           _v6.frame_id = str[start:end].decode('utf-8')
00164         else:
00165           _v6.frame_id = str[start:end]
00166         _v8 = val1.pose
00167         _v9 = _v8.position
00168         _x = _v9
00169         start = end
00170         end += 24
00171         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00172         _v10 = _v8.orientation
00173         _x = _v10
00174         start = end
00175         end += 32
00176         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00177         self.gripper_poses.append(val1)
00178       start = end
00179       end += 4
00180       (length,) = _struct_I.unpack(str[start:end])
00181       pattern = '<%sf'%length
00182       start = end
00183       end += struct.calcsize(pattern)
00184       self.gripper_openings = struct.unpack(pattern, str[start:end])
00185       return self
00186     except struct.error as e:
00187       raise genpy.DeserializationError(e) #most likely buffer underfill
00188 
00189 
00190   def serialize_numpy(self, buff, numpy):
00191     """
00192     serialize message with numpy array types into buffer
00193     :param buff: buffer, ``StringIO``
00194     :param numpy: numpy python module
00195     """
00196     try:
00197       length = len(self.gripper_poses)
00198       buff.write(_struct_I.pack(length))
00199       for val1 in self.gripper_poses:
00200         _v11 = val1.header
00201         buff.write(_struct_I.pack(_v11.seq))
00202         _v12 = _v11.stamp
00203         _x = _v12
00204         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00205         _x = _v11.frame_id
00206         length = len(_x)
00207         if python3 or type(_x) == unicode:
00208           _x = _x.encode('utf-8')
00209           length = len(_x)
00210         buff.write(struct.pack('<I%ss'%length, length, _x))
00211         _v13 = val1.pose
00212         _v14 = _v13.position
00213         _x = _v14
00214         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00215         _v15 = _v13.orientation
00216         _x = _v15
00217         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00218       length = len(self.gripper_openings)
00219       buff.write(_struct_I.pack(length))
00220       pattern = '<%sf'%length
00221       buff.write(self.gripper_openings.tostring())
00222     except struct.error as se: self._check_types(se)
00223     except TypeError as te: self._check_types(te)
00224 
00225   def deserialize_numpy(self, str, numpy):
00226     """
00227     unpack serialized message in str into this message instance using numpy for array types
00228     :param str: byte array of serialized message, ``str``
00229     :param numpy: numpy python module
00230     """
00231     try:
00232       if self.gripper_poses is None:
00233         self.gripper_poses = None
00234       end = 0
00235       start = end
00236       end += 4
00237       (length,) = _struct_I.unpack(str[start:end])
00238       self.gripper_poses = []
00239       for i in range(0, length):
00240         val1 = geometry_msgs.msg.PoseStamped()
00241         _v16 = val1.header
00242         start = end
00243         end += 4
00244         (_v16.seq,) = _struct_I.unpack(str[start:end])
00245         _v17 = _v16.stamp
00246         _x = _v17
00247         start = end
00248         end += 8
00249         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00250         start = end
00251         end += 4
00252         (length,) = _struct_I.unpack(str[start:end])
00253         start = end
00254         end += length
00255         if python3:
00256           _v16.frame_id = str[start:end].decode('utf-8')
00257         else:
00258           _v16.frame_id = str[start:end]
00259         _v18 = val1.pose
00260         _v19 = _v18.position
00261         _x = _v19
00262         start = end
00263         end += 24
00264         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00265         _v20 = _v18.orientation
00266         _x = _v20
00267         start = end
00268         end += 32
00269         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00270         self.gripper_poses.append(val1)
00271       start = end
00272       end += 4
00273       (length,) = _struct_I.unpack(str[start:end])
00274       pattern = '<%sf'%length
00275       start = end
00276       end += struct.calcsize(pattern)
00277       self.gripper_openings = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00278       return self
00279     except struct.error as e:
00280       raise genpy.DeserializationError(e) #most likely buffer underfill
00281 
00282 _struct_I = genpy.struct_I
00283 _struct_4d = struct.Struct("<4d")
00284 _struct_2I = struct.Struct("<2I")
00285 _struct_3d = struct.Struct("<3d")


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