00001 """autogenerated by genpy from pr2_object_manipulation_msgs/ImageClick.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 std_msgs.msg
00010
00011 class ImageClick(genpy.Message):
00012 _md5sum = "6549d856fa5d392f2ffbeaf0a2f80931"
00013 _type = "pr2_object_manipulation_msgs/ImageClick"
00014 _has_header = False
00015 _full_text = """# Info about a user click on an image
00016
00017 # The ray in 3d space resulting from the click
00018 Ray ray
00019
00020 # The frame_if of the camera that the click was in
00021 string camera_frame_id
00022 ================================================================================
00023 MSG: pr2_object_manipulation_msgs/Ray
00024 # Represents a ray through space.
00025 # Could probably move to a more general location
00026
00027 Header header
00028
00029 # the origin of the ray
00030 geometry_msgs/Point origin
00031
00032 # the direction of the ray
00033 geometry_msgs/Vector3 direction
00034 ================================================================================
00035 MSG: std_msgs/Header
00036 # Standard metadata for higher-level stamped data types.
00037 # This is generally used to communicate timestamped data
00038 # in a particular coordinate frame.
00039 #
00040 # sequence ID: consecutively increasing ID
00041 uint32 seq
00042 #Two-integer timestamp that is expressed as:
00043 # * stamp.secs: seconds (stamp_secs) since epoch
00044 # * stamp.nsecs: nanoseconds since stamp_secs
00045 # time-handling sugar is provided by the client library
00046 time stamp
00047 #Frame this data is associated with
00048 # 0: no frame
00049 # 1: global frame
00050 string frame_id
00051
00052 ================================================================================
00053 MSG: geometry_msgs/Point
00054 # This contains the position of a point in free space
00055 float64 x
00056 float64 y
00057 float64 z
00058
00059 ================================================================================
00060 MSG: geometry_msgs/Vector3
00061 # This represents a vector in free space.
00062
00063 float64 x
00064 float64 y
00065 float64 z
00066 """
00067 __slots__ = ['ray','camera_frame_id']
00068 _slot_types = ['pr2_object_manipulation_msgs/Ray','string']
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 ray,camera_frame_id
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(ImageClick, self).__init__(*args, **kwds)
00086
00087 if self.ray is None:
00088 self.ray = pr2_object_manipulation_msgs.msg.Ray()
00089 if self.camera_frame_id is None:
00090 self.camera_frame_id = ''
00091 else:
00092 self.ray = pr2_object_manipulation_msgs.msg.Ray()
00093 self.camera_frame_id = ''
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.ray.header.seq, _x.ray.header.stamp.secs, _x.ray.header.stamp.nsecs))
00109 _x = self.ray.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_6d.pack(_x.ray.origin.x, _x.ray.origin.y, _x.ray.origin.z, _x.ray.direction.x, _x.ray.direction.y, _x.ray.direction.z))
00117 _x = self.camera_frame_id
00118 length = len(_x)
00119 if python3 or type(_x) == unicode:
00120 _x = _x.encode('utf-8')
00121 length = len(_x)
00122 buff.write(struct.pack('<I%ss'%length, length, _x))
00123 except struct.error as se: self._check_types(se)
00124 except TypeError as te: self._check_types(te)
00125
00126 def deserialize(self, str):
00127 """
00128 unpack serialized message in str into this message instance
00129 :param str: byte array of serialized message, ``str``
00130 """
00131 try:
00132 if self.ray is None:
00133 self.ray = pr2_object_manipulation_msgs.msg.Ray()
00134 end = 0
00135 _x = self
00136 start = end
00137 end += 12
00138 (_x.ray.header.seq, _x.ray.header.stamp.secs, _x.ray.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00139 start = end
00140 end += 4
00141 (length,) = _struct_I.unpack(str[start:end])
00142 start = end
00143 end += length
00144 if python3:
00145 self.ray.header.frame_id = str[start:end].decode('utf-8')
00146 else:
00147 self.ray.header.frame_id = str[start:end]
00148 _x = self
00149 start = end
00150 end += 48
00151 (_x.ray.origin.x, _x.ray.origin.y, _x.ray.origin.z, _x.ray.direction.x, _x.ray.direction.y, _x.ray.direction.z,) = _struct_6d.unpack(str[start:end])
00152 start = end
00153 end += 4
00154 (length,) = _struct_I.unpack(str[start:end])
00155 start = end
00156 end += length
00157 if python3:
00158 self.camera_frame_id = str[start:end].decode('utf-8')
00159 else:
00160 self.camera_frame_id = str[start:end]
00161 return self
00162 except struct.error as e:
00163 raise genpy.DeserializationError(e)
00164
00165
00166 def serialize_numpy(self, buff, numpy):
00167 """
00168 serialize message with numpy array types into buffer
00169 :param buff: buffer, ``StringIO``
00170 :param numpy: numpy python module
00171 """
00172 try:
00173 _x = self
00174 buff.write(_struct_3I.pack(_x.ray.header.seq, _x.ray.header.stamp.secs, _x.ray.header.stamp.nsecs))
00175 _x = self.ray.header.frame_id
00176 length = len(_x)
00177 if python3 or type(_x) == unicode:
00178 _x = _x.encode('utf-8')
00179 length = len(_x)
00180 buff.write(struct.pack('<I%ss'%length, length, _x))
00181 _x = self
00182 buff.write(_struct_6d.pack(_x.ray.origin.x, _x.ray.origin.y, _x.ray.origin.z, _x.ray.direction.x, _x.ray.direction.y, _x.ray.direction.z))
00183 _x = self.camera_frame_id
00184 length = len(_x)
00185 if python3 or type(_x) == unicode:
00186 _x = _x.encode('utf-8')
00187 length = len(_x)
00188 buff.write(struct.pack('<I%ss'%length, length, _x))
00189 except struct.error as se: self._check_types(se)
00190 except TypeError as te: self._check_types(te)
00191
00192 def deserialize_numpy(self, str, numpy):
00193 """
00194 unpack serialized message in str into this message instance using numpy for array types
00195 :param str: byte array of serialized message, ``str``
00196 :param numpy: numpy python module
00197 """
00198 try:
00199 if self.ray is None:
00200 self.ray = pr2_object_manipulation_msgs.msg.Ray()
00201 end = 0
00202 _x = self
00203 start = end
00204 end += 12
00205 (_x.ray.header.seq, _x.ray.header.stamp.secs, _x.ray.header.stamp.nsecs,) = _struct_3I.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.ray.header.frame_id = str[start:end].decode('utf-8')
00213 else:
00214 self.ray.header.frame_id = str[start:end]
00215 _x = self
00216 start = end
00217 end += 48
00218 (_x.ray.origin.x, _x.ray.origin.y, _x.ray.origin.z, _x.ray.direction.x, _x.ray.direction.y, _x.ray.direction.z,) = _struct_6d.unpack(str[start:end])
00219 start = end
00220 end += 4
00221 (length,) = _struct_I.unpack(str[start:end])
00222 start = end
00223 end += length
00224 if python3:
00225 self.camera_frame_id = str[start:end].decode('utf-8')
00226 else:
00227 self.camera_frame_id = str[start:end]
00228 return self
00229 except struct.error as e:
00230 raise genpy.DeserializationError(e)
00231
00232 _struct_I = genpy.struct_I
00233 _struct_3I = struct.Struct("<3I")
00234 _struct_6d = struct.Struct("<6d")