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