00001 """autogenerated by genpy from tidyup_msgs/GraspableObject.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 GraspableObject(genpy.Message):
00011 _md5sum = "e0e939123ab1843b1e8dcff2df7a13a7"
00012 _type = "tidyup_msgs/GraspableObject"
00013 _has_header = False
00014 _full_text = """# an object that can be grasped in principle
00015 string name
00016 geometry_msgs/PoseStamped pose
00017 bool reachable_left_arm # if true, the object is reachable now to be grasped with the left_arm
00018 bool reachable_right_arm
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__ = ['name','pose','reachable_left_arm','reachable_right_arm']
00068 _slot_types = ['string','geometry_msgs/PoseStamped','bool','bool']
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 name,pose,reachable_left_arm,reachable_right_arm
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(GraspableObject, self).__init__(*args, **kwds)
00086
00087 if self.name is None:
00088 self.name = ''
00089 if self.pose is None:
00090 self.pose = geometry_msgs.msg.PoseStamped()
00091 if self.reachable_left_arm is None:
00092 self.reachable_left_arm = False
00093 if self.reachable_right_arm is None:
00094 self.reachable_right_arm = False
00095 else:
00096 self.name = ''
00097 self.pose = geometry_msgs.msg.PoseStamped()
00098 self.reachable_left_arm = False
00099 self.reachable_right_arm = False
00100
00101 def _get_types(self):
00102 """
00103 internal API method
00104 """
00105 return self._slot_types
00106
00107 def serialize(self, buff):
00108 """
00109 serialize message into buffer
00110 :param buff: buffer, ``StringIO``
00111 """
00112 try:
00113 _x = self.name
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 _x = self
00120 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00121 _x = self.pose.header.frame_id
00122 length = len(_x)
00123 if python3 or type(_x) == unicode:
00124 _x = _x.encode('utf-8')
00125 length = len(_x)
00126 buff.write(struct.pack('<I%ss'%length, length, _x))
00127 _x = self
00128 buff.write(_struct_7d2B.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.reachable_left_arm, _x.reachable_right_arm))
00129 except struct.error as se: self._check_types(se)
00130 except TypeError as te: self._check_types(te)
00131
00132 def deserialize(self, str):
00133 """
00134 unpack serialized message in str into this message instance
00135 :param str: byte array of serialized message, ``str``
00136 """
00137 try:
00138 if self.pose is None:
00139 self.pose = geometry_msgs.msg.PoseStamped()
00140 end = 0
00141 start = end
00142 end += 4
00143 (length,) = _struct_I.unpack(str[start:end])
00144 start = end
00145 end += length
00146 if python3:
00147 self.name = str[start:end].decode('utf-8')
00148 else:
00149 self.name = str[start:end]
00150 _x = self
00151 start = end
00152 end += 12
00153 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00154 start = end
00155 end += 4
00156 (length,) = _struct_I.unpack(str[start:end])
00157 start = end
00158 end += length
00159 if python3:
00160 self.pose.header.frame_id = str[start:end].decode('utf-8')
00161 else:
00162 self.pose.header.frame_id = str[start:end]
00163 _x = self
00164 start = end
00165 end += 58
00166 (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.reachable_left_arm, _x.reachable_right_arm,) = _struct_7d2B.unpack(str[start:end])
00167 self.reachable_left_arm = bool(self.reachable_left_arm)
00168 self.reachable_right_arm = bool(self.reachable_right_arm)
00169 return self
00170 except struct.error as e:
00171 raise genpy.DeserializationError(e)
00172
00173
00174 def serialize_numpy(self, buff, numpy):
00175 """
00176 serialize message with numpy array types into buffer
00177 :param buff: buffer, ``StringIO``
00178 :param numpy: numpy python module
00179 """
00180 try:
00181 _x = self.name
00182 length = len(_x)
00183 if python3 or type(_x) == unicode:
00184 _x = _x.encode('utf-8')
00185 length = len(_x)
00186 buff.write(struct.pack('<I%ss'%length, length, _x))
00187 _x = self
00188 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00189 _x = self.pose.header.frame_id
00190 length = len(_x)
00191 if python3 or type(_x) == unicode:
00192 _x = _x.encode('utf-8')
00193 length = len(_x)
00194 buff.write(struct.pack('<I%ss'%length, length, _x))
00195 _x = self
00196 buff.write(_struct_7d2B.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.reachable_left_arm, _x.reachable_right_arm))
00197 except struct.error as se: self._check_types(se)
00198 except TypeError as te: self._check_types(te)
00199
00200 def deserialize_numpy(self, str, numpy):
00201 """
00202 unpack serialized message in str into this message instance using numpy for array types
00203 :param str: byte array of serialized message, ``str``
00204 :param numpy: numpy python module
00205 """
00206 try:
00207 if self.pose is None:
00208 self.pose = geometry_msgs.msg.PoseStamped()
00209 end = 0
00210 start = end
00211 end += 4
00212 (length,) = _struct_I.unpack(str[start:end])
00213 start = end
00214 end += length
00215 if python3:
00216 self.name = str[start:end].decode('utf-8')
00217 else:
00218 self.name = str[start:end]
00219 _x = self
00220 start = end
00221 end += 12
00222 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00223 start = end
00224 end += 4
00225 (length,) = _struct_I.unpack(str[start:end])
00226 start = end
00227 end += length
00228 if python3:
00229 self.pose.header.frame_id = str[start:end].decode('utf-8')
00230 else:
00231 self.pose.header.frame_id = str[start:end]
00232 _x = self
00233 start = end
00234 end += 58
00235 (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.reachable_left_arm, _x.reachable_right_arm,) = _struct_7d2B.unpack(str[start:end])
00236 self.reachable_left_arm = bool(self.reachable_left_arm)
00237 self.reachable_right_arm = bool(self.reachable_right_arm)
00238 return self
00239 except struct.error as e:
00240 raise genpy.DeserializationError(e)
00241
00242 _struct_I = genpy.struct_I
00243 _struct_3I = struct.Struct("<3I")
00244 _struct_7d2B = struct.Struct("<7d2B")