00001 """autogenerated by genpy from pr2_object_manipulation_msgs/GetGripperPoseResult.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 GetGripperPoseResult(genpy.Message):
00011 _md5sum = "376ba9325430425e1115a2f7597dc0e7"
00012 _type = "pr2_object_manipulation_msgs/GetGripperPoseResult"
00013 _has_header = False
00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015 # the returned gripper pose, assuming the user has clicked "accept"
00016 # if the user clicks "cancel" the action aborts
00017 geometry_msgs/PoseStamped gripper_pose
00018 float32 gripper_opening
00019
00020 ================================================================================
00021 MSG: geometry_msgs/PoseStamped
00022 # A Pose with reference coordinate frame and timestamp
00023 Header header
00024 Pose pose
00025
00026 ================================================================================
00027 MSG: std_msgs/Header
00028 # Standard metadata for higher-level stamped data types.
00029 # This is generally used to communicate timestamped data
00030 # in a particular coordinate frame.
00031 #
00032 # sequence ID: consecutively increasing ID
00033 uint32 seq
00034 #Two-integer timestamp that is expressed as:
00035 # * stamp.secs: seconds (stamp_secs) since epoch
00036 # * stamp.nsecs: nanoseconds since stamp_secs
00037 # time-handling sugar is provided by the client library
00038 time stamp
00039 #Frame this data is associated with
00040 # 0: no frame
00041 # 1: global frame
00042 string frame_id
00043
00044 ================================================================================
00045 MSG: geometry_msgs/Pose
00046 # A representation of pose in free space, composed of postion and orientation.
00047 Point position
00048 Quaternion orientation
00049
00050 ================================================================================
00051 MSG: geometry_msgs/Point
00052 # This contains the position of a point in free space
00053 float64 x
00054 float64 y
00055 float64 z
00056
00057 ================================================================================
00058 MSG: geometry_msgs/Quaternion
00059 # This represents an orientation in free space in quaternion form.
00060
00061 float64 x
00062 float64 y
00063 float64 z
00064 float64 w
00065
00066 """
00067 __slots__ = ['gripper_pose','gripper_opening']
00068 _slot_types = ['geometry_msgs/PoseStamped','float32']
00069
00070 def __init__(self, *args, **kwds):
00071 """
00072 Constructor. Any message fields that are implicitly/explicitly
00073 set to None will be assigned a default value. The recommend
00074 use is keyword arguments as this is more robust to future message
00075 changes. You cannot mix in-order arguments and keyword arguments.
00076
00077 The available fields are:
00078 gripper_pose,gripper_opening
00079
00080 :param args: complete set of field values, in .msg order
00081 :param kwds: use keyword arguments corresponding to message field names
00082 to set specific fields.
00083 """
00084 if args or kwds:
00085 super(GetGripperPoseResult, self).__init__(*args, **kwds)
00086
00087 if self.gripper_pose is None:
00088 self.gripper_pose = geometry_msgs.msg.PoseStamped()
00089 if self.gripper_opening is None:
00090 self.gripper_opening = 0.
00091 else:
00092 self.gripper_pose = geometry_msgs.msg.PoseStamped()
00093 self.gripper_opening = 0.
00094
00095 def _get_types(self):
00096 """
00097 internal API method
00098 """
00099 return self._slot_types
00100
00101 def serialize(self, buff):
00102 """
00103 serialize message into buffer
00104 :param buff: buffer, ``StringIO``
00105 """
00106 try:
00107 _x = self
00108 buff.write(_struct_3I.pack(_x.gripper_pose.header.seq, _x.gripper_pose.header.stamp.secs, _x.gripper_pose.header.stamp.nsecs))
00109 _x = self.gripper_pose.header.frame_id
00110 length = len(_x)
00111 if python3 or type(_x) == unicode:
00112 _x = _x.encode('utf-8')
00113 length = len(_x)
00114 buff.write(struct.pack('<I%ss'%length, length, _x))
00115 _x = self
00116 buff.write(_struct_7df.pack(_x.gripper_pose.pose.position.x, _x.gripper_pose.pose.position.y, _x.gripper_pose.pose.position.z, _x.gripper_pose.pose.orientation.x, _x.gripper_pose.pose.orientation.y, _x.gripper_pose.pose.orientation.z, _x.gripper_pose.pose.orientation.w, _x.gripper_opening))
00117 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00118 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00119
00120 def deserialize(self, str):
00121 """
00122 unpack serialized message in str into this message instance
00123 :param str: byte array of serialized message, ``str``
00124 """
00125 try:
00126 if self.gripper_pose is None:
00127 self.gripper_pose = geometry_msgs.msg.PoseStamped()
00128 end = 0
00129 _x = self
00130 start = end
00131 end += 12
00132 (_x.gripper_pose.header.seq, _x.gripper_pose.header.stamp.secs, _x.gripper_pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00133 start = end
00134 end += 4
00135 (length,) = _struct_I.unpack(str[start:end])
00136 start = end
00137 end += length
00138 if python3:
00139 self.gripper_pose.header.frame_id = str[start:end].decode('utf-8')
00140 else:
00141 self.gripper_pose.header.frame_id = str[start:end]
00142 _x = self
00143 start = end
00144 end += 60
00145 (_x.gripper_pose.pose.position.x, _x.gripper_pose.pose.position.y, _x.gripper_pose.pose.position.z, _x.gripper_pose.pose.orientation.x, _x.gripper_pose.pose.orientation.y, _x.gripper_pose.pose.orientation.z, _x.gripper_pose.pose.orientation.w, _x.gripper_opening,) = _struct_7df.unpack(str[start:end])
00146 return self
00147 except struct.error as e:
00148 raise genpy.DeserializationError(e)
00149
00150
00151 def serialize_numpy(self, buff, numpy):
00152 """
00153 serialize message with numpy array types into buffer
00154 :param buff: buffer, ``StringIO``
00155 :param numpy: numpy python module
00156 """
00157 try:
00158 _x = self
00159 buff.write(_struct_3I.pack(_x.gripper_pose.header.seq, _x.gripper_pose.header.stamp.secs, _x.gripper_pose.header.stamp.nsecs))
00160 _x = self.gripper_pose.header.frame_id
00161 length = len(_x)
00162 if python3 or type(_x) == unicode:
00163 _x = _x.encode('utf-8')
00164 length = len(_x)
00165 buff.write(struct.pack('<I%ss'%length, length, _x))
00166 _x = self
00167 buff.write(_struct_7df.pack(_x.gripper_pose.pose.position.x, _x.gripper_pose.pose.position.y, _x.gripper_pose.pose.position.z, _x.gripper_pose.pose.orientation.x, _x.gripper_pose.pose.orientation.y, _x.gripper_pose.pose.orientation.z, _x.gripper_pose.pose.orientation.w, _x.gripper_opening))
00168 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00169 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00170
00171 def deserialize_numpy(self, str, numpy):
00172 """
00173 unpack serialized message in str into this message instance using numpy for array types
00174 :param str: byte array of serialized message, ``str``
00175 :param numpy: numpy python module
00176 """
00177 try:
00178 if self.gripper_pose is None:
00179 self.gripper_pose = geometry_msgs.msg.PoseStamped()
00180 end = 0
00181 _x = self
00182 start = end
00183 end += 12
00184 (_x.gripper_pose.header.seq, _x.gripper_pose.header.stamp.secs, _x.gripper_pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00185 start = end
00186 end += 4
00187 (length,) = _struct_I.unpack(str[start:end])
00188 start = end
00189 end += length
00190 if python3:
00191 self.gripper_pose.header.frame_id = str[start:end].decode('utf-8')
00192 else:
00193 self.gripper_pose.header.frame_id = str[start:end]
00194 _x = self
00195 start = end
00196 end += 60
00197 (_x.gripper_pose.pose.position.x, _x.gripper_pose.pose.position.y, _x.gripper_pose.pose.position.z, _x.gripper_pose.pose.orientation.x, _x.gripper_pose.pose.orientation.y, _x.gripper_pose.pose.orientation.z, _x.gripper_pose.pose.orientation.w, _x.gripper_opening,) = _struct_7df.unpack(str[start:end])
00198 return self
00199 except struct.error as e:
00200 raise genpy.DeserializationError(e)
00201
00202 _struct_I = genpy.struct_I
00203 _struct_3I = struct.Struct("<3I")
00204 _struct_7df = struct.Struct("<7df")