00001 """autogenerated by genpy from checkerboard_detector2/Object6DPose.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
00009 class Object6DPose(genpy.Message):
00010 _md5sum = "65607b2d0a73b752af8aa84bc03b757c"
00011 _type = "checkerboard_detector2/Object6DPose"
00012 _has_header = False
00013 _full_text = """# 6D pose of object
00014 geometry_msgs/Pose pose
00015
00016 # type of object, usually contains the filename of the object that allows the receiving side to visualize it
00017 # can also be used as a unique type id
00018 string type
00019 uint32 id
00020 ================================================================================
00021 MSG: geometry_msgs/Pose
00022 # A representation of pose in free space, composed of postion and orientation.
00023 Point position
00024 Quaternion orientation
00025
00026 ================================================================================
00027 MSG: geometry_msgs/Point
00028 # This contains the position of a point in free space
00029 float64 x
00030 float64 y
00031 float64 z
00032
00033 ================================================================================
00034 MSG: geometry_msgs/Quaternion
00035 # This represents an orientation in free space in quaternion form.
00036
00037 float64 x
00038 float64 y
00039 float64 z
00040 float64 w
00041
00042 """
00043 __slots__ = ['pose','type','id']
00044 _slot_types = ['geometry_msgs/Pose','string','uint32']
00045
00046 def __init__(self, *args, **kwds):
00047 """
00048 Constructor. Any message fields that are implicitly/explicitly
00049 set to None will be assigned a default value. The recommend
00050 use is keyword arguments as this is more robust to future message
00051 changes. You cannot mix in-order arguments and keyword arguments.
00052
00053 The available fields are:
00054 pose,type,id
00055
00056 :param args: complete set of field values, in .msg order
00057 :param kwds: use keyword arguments corresponding to message field names
00058 to set specific fields.
00059 """
00060 if args or kwds:
00061 super(Object6DPose, self).__init__(*args, **kwds)
00062
00063 if self.pose is None:
00064 self.pose = geometry_msgs.msg.Pose()
00065 if self.type is None:
00066 self.type = ''
00067 if self.id is None:
00068 self.id = 0
00069 else:
00070 self.pose = geometry_msgs.msg.Pose()
00071 self.type = ''
00072 self.id = 0
00073
00074 def _get_types(self):
00075 """
00076 internal API method
00077 """
00078 return self._slot_types
00079
00080 def serialize(self, buff):
00081 """
00082 serialize message into buffer
00083 :param buff: buffer, ``StringIO``
00084 """
00085 try:
00086 _x = self
00087 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w))
00088 _x = self.type
00089 length = len(_x)
00090 if python3 or type(_x) == unicode:
00091 _x = _x.encode('utf-8')
00092 length = len(_x)
00093 buff.write(struct.pack('<I%ss'%length, length, _x))
00094 buff.write(_struct_I.pack(self.id))
00095 except struct.error as se: self._check_types(se)
00096 except TypeError as te: self._check_types(te)
00097
00098 def deserialize(self, str):
00099 """
00100 unpack serialized message in str into this message instance
00101 :param str: byte array of serialized message, ``str``
00102 """
00103 try:
00104 if self.pose is None:
00105 self.pose = geometry_msgs.msg.Pose()
00106 end = 0
00107 _x = self
00108 start = end
00109 end += 56
00110 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00111 start = end
00112 end += 4
00113 (length,) = _struct_I.unpack(str[start:end])
00114 start = end
00115 end += length
00116 if python3:
00117 self.type = str[start:end].decode('utf-8')
00118 else:
00119 self.type = str[start:end]
00120 start = end
00121 end += 4
00122 (self.id,) = _struct_I.unpack(str[start:end])
00123 return self
00124 except struct.error as e:
00125 raise genpy.DeserializationError(e)
00126
00127
00128 def serialize_numpy(self, buff, numpy):
00129 """
00130 serialize message with numpy array types into buffer
00131 :param buff: buffer, ``StringIO``
00132 :param numpy: numpy python module
00133 """
00134 try:
00135 _x = self
00136 buff.write(_struct_7d.pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w))
00137 _x = self.type
00138 length = len(_x)
00139 if python3 or type(_x) == unicode:
00140 _x = _x.encode('utf-8')
00141 length = len(_x)
00142 buff.write(struct.pack('<I%ss'%length, length, _x))
00143 buff.write(_struct_I.pack(self.id))
00144 except struct.error as se: self._check_types(se)
00145 except TypeError as te: self._check_types(te)
00146
00147 def deserialize_numpy(self, str, numpy):
00148 """
00149 unpack serialized message in str into this message instance using numpy for array types
00150 :param str: byte array of serialized message, ``str``
00151 :param numpy: numpy python module
00152 """
00153 try:
00154 if self.pose is None:
00155 self.pose = geometry_msgs.msg.Pose()
00156 end = 0
00157 _x = self
00158 start = end
00159 end += 56
00160 (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _struct_7d.unpack(str[start:end])
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 start = end
00165 end += length
00166 if python3:
00167 self.type = str[start:end].decode('utf-8')
00168 else:
00169 self.type = str[start:end]
00170 start = end
00171 end += 4
00172 (self.id,) = _struct_I.unpack(str[start:end])
00173 return self
00174 except struct.error as e:
00175 raise genpy.DeserializationError(e)
00176
00177 _struct_I = genpy.struct_I
00178 _struct_7d = struct.Struct("<7d")