00001 """autogenerated by genpy from posedetection_msgs/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 = "f45579bd48fe31379d4bbde3b9a601c5"
00011 _type = "posedetection_msgs/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
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']
00044 _slot_types = ['geometry_msgs/Pose','string']
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
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 else:
00068 self.pose = geometry_msgs.msg.Pose()
00069 self.type = ''
00070
00071 def _get_types(self):
00072 """
00073 internal API method
00074 """
00075 return self._slot_types
00076
00077 def serialize(self, buff):
00078 """
00079 serialize message into buffer
00080 :param buff: buffer, ``StringIO``
00081 """
00082 try:
00083 _x = self
00084 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))
00085 _x = self.type
00086 length = len(_x)
00087 if python3 or type(_x) == unicode:
00088 _x = _x.encode('utf-8')
00089 length = len(_x)
00090 buff.write(struct.pack('<I%ss'%length, length, _x))
00091 except struct.error as se: self._check_types(se)
00092 except TypeError as te: self._check_types(te)
00093
00094 def deserialize(self, str):
00095 """
00096 unpack serialized message in str into this message instance
00097 :param str: byte array of serialized message, ``str``
00098 """
00099 try:
00100 if self.pose is None:
00101 self.pose = geometry_msgs.msg.Pose()
00102 end = 0
00103 _x = self
00104 start = end
00105 end += 56
00106 (_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])
00107 start = end
00108 end += 4
00109 (length,) = _struct_I.unpack(str[start:end])
00110 start = end
00111 end += length
00112 if python3:
00113 self.type = str[start:end].decode('utf-8')
00114 else:
00115 self.type = str[start:end]
00116 return self
00117 except struct.error as e:
00118 raise genpy.DeserializationError(e)
00119
00120
00121 def serialize_numpy(self, buff, numpy):
00122 """
00123 serialize message with numpy array types into buffer
00124 :param buff: buffer, ``StringIO``
00125 :param numpy: numpy python module
00126 """
00127 try:
00128 _x = self
00129 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))
00130 _x = self.type
00131 length = len(_x)
00132 if python3 or type(_x) == unicode:
00133 _x = _x.encode('utf-8')
00134 length = len(_x)
00135 buff.write(struct.pack('<I%ss'%length, length, _x))
00136 except struct.error as se: self._check_types(se)
00137 except TypeError as te: self._check_types(te)
00138
00139 def deserialize_numpy(self, str, numpy):
00140 """
00141 unpack serialized message in str into this message instance using numpy for array types
00142 :param str: byte array of serialized message, ``str``
00143 :param numpy: numpy python module
00144 """
00145 try:
00146 if self.pose is None:
00147 self.pose = geometry_msgs.msg.Pose()
00148 end = 0
00149 _x = self
00150 start = end
00151 end += 56
00152 (_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])
00153 start = end
00154 end += 4
00155 (length,) = _struct_I.unpack(str[start:end])
00156 start = end
00157 end += length
00158 if python3:
00159 self.type = str[start:end].decode('utf-8')
00160 else:
00161 self.type = str[start:end]
00162 return self
00163 except struct.error as e:
00164 raise genpy.DeserializationError(e)
00165
00166 _struct_I = genpy.struct_I
00167 _struct_7d = struct.Struct("<7d")