00001 """autogenerated by genmsg_py from DatabaseModelPose.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import std_msgs.msg
00007
00008 class DatabaseModelPose(roslib.message.Message):
00009 _md5sum = "beaba6f402b294fa68e817f5f3930224"
00010 _type = "household_objects_database_msgs/DatabaseModelPose"
00011 _has_header = False
00012 _full_text = """# Informs that a specific model from the Model Database has been
00013 # identified at a certain location
00014
00015 # the database id of the model
00016 int32 model_id
00017
00018 # the pose that it can be found in
00019 geometry_msgs/PoseStamped pose
00020
00021 # a measure of the confidence level in this detection result
00022 float32 confidence
00023 ================================================================================
00024 MSG: geometry_msgs/PoseStamped
00025 # A Pose with reference coordinate frame and timestamp
00026 Header header
00027 Pose pose
00028
00029 ================================================================================
00030 MSG: std_msgs/Header
00031 # Standard metadata for higher-level stamped data types.
00032 # This is generally used to communicate timestamped data
00033 # in a particular coordinate frame.
00034 #
00035 # sequence ID: consecutively increasing ID
00036 uint32 seq
00037 #Two-integer timestamp that is expressed as:
00038 # * stamp.secs: seconds (stamp_secs) since epoch
00039 # * stamp.nsecs: nanoseconds since stamp_secs
00040 # time-handling sugar is provided by the client library
00041 time stamp
00042 #Frame this data is associated with
00043 # 0: no frame
00044 # 1: global frame
00045 string frame_id
00046
00047 ================================================================================
00048 MSG: geometry_msgs/Pose
00049 # A representation of pose in free space, composed of postion and orientation.
00050 Point position
00051 Quaternion orientation
00052
00053 ================================================================================
00054 MSG: geometry_msgs/Point
00055 # This contains the position of a point in free space
00056 float64 x
00057 float64 y
00058 float64 z
00059
00060 ================================================================================
00061 MSG: geometry_msgs/Quaternion
00062 # This represents an orientation in free space in quaternion form.
00063
00064 float64 x
00065 float64 y
00066 float64 z
00067 float64 w
00068
00069 """
00070 __slots__ = ['model_id','pose','confidence']
00071 _slot_types = ['int32','geometry_msgs/PoseStamped','float32']
00072
00073 def __init__(self, *args, **kwds):
00074 """
00075 Constructor. Any message fields that are implicitly/explicitly
00076 set to None will be assigned a default value. The recommend
00077 use is keyword arguments as this is more robust to future message
00078 changes. You cannot mix in-order arguments and keyword arguments.
00079
00080 The available fields are:
00081 model_id,pose,confidence
00082
00083 @param args: complete set of field values, in .msg order
00084 @param kwds: use keyword arguments corresponding to message field names
00085 to set specific fields.
00086 """
00087 if args or kwds:
00088 super(DatabaseModelPose, self).__init__(*args, **kwds)
00089
00090 if self.model_id is None:
00091 self.model_id = 0
00092 if self.pose is None:
00093 self.pose = geometry_msgs.msg.PoseStamped()
00094 if self.confidence is None:
00095 self.confidence = 0.
00096 else:
00097 self.model_id = 0
00098 self.pose = geometry_msgs.msg.PoseStamped()
00099 self.confidence = 0.
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
00111 @type buff: StringIO
00112 """
00113 try:
00114 _x = self
00115 buff.write(_struct_i3I.pack(_x.model_id, _x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00116 _x = self.pose.header.frame_id
00117 length = len(_x)
00118 buff.write(struct.pack('<I%ss'%length, length, _x))
00119 _x = self
00120 buff.write(_struct_7df.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.confidence))
00121 except struct.error, se: self._check_types(se)
00122 except TypeError, te: self._check_types(te)
00123
00124 def deserialize(self, str):
00125 """
00126 unpack serialized message in str into this message instance
00127 @param str: byte array of serialized message
00128 @type str: str
00129 """
00130 try:
00131 if self.pose is None:
00132 self.pose = geometry_msgs.msg.PoseStamped()
00133 end = 0
00134 _x = self
00135 start = end
00136 end += 16
00137 (_x.model_id, _x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end])
00138 start = end
00139 end += 4
00140 (length,) = _struct_I.unpack(str[start:end])
00141 start = end
00142 end += length
00143 self.pose.header.frame_id = str[start:end]
00144 _x = self
00145 start = end
00146 end += 60
00147 (_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.confidence,) = _struct_7df.unpack(str[start:end])
00148 return self
00149 except struct.error, e:
00150 raise roslib.message.DeserializationError(e)
00151
00152
00153 def serialize_numpy(self, buff, numpy):
00154 """
00155 serialize message with numpy array types into buffer
00156 @param buff: buffer
00157 @type buff: StringIO
00158 @param numpy: numpy python module
00159 @type numpy module
00160 """
00161 try:
00162 _x = self
00163 buff.write(_struct_i3I.pack(_x.model_id, _x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00164 _x = self.pose.header.frame_id
00165 length = len(_x)
00166 buff.write(struct.pack('<I%ss'%length, length, _x))
00167 _x = self
00168 buff.write(_struct_7df.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.confidence))
00169 except struct.error, se: self._check_types(se)
00170 except TypeError, te: self._check_types(te)
00171
00172 def deserialize_numpy(self, str, numpy):
00173 """
00174 unpack serialized message in str into this message instance using numpy for array types
00175 @param str: byte array of serialized message
00176 @type str: str
00177 @param numpy: numpy python module
00178 @type numpy: module
00179 """
00180 try:
00181 if self.pose is None:
00182 self.pose = geometry_msgs.msg.PoseStamped()
00183 end = 0
00184 _x = self
00185 start = end
00186 end += 16
00187 (_x.model_id, _x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end])
00188 start = end
00189 end += 4
00190 (length,) = _struct_I.unpack(str[start:end])
00191 start = end
00192 end += length
00193 self.pose.header.frame_id = str[start:end]
00194 _x = self
00195 start = end
00196 end += 60
00197 (_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.confidence,) = _struct_7df.unpack(str[start:end])
00198 return self
00199 except struct.error, e:
00200 raise roslib.message.DeserializationError(e)
00201
00202 _struct_I = roslib.message.struct_I
00203 _struct_i3I = struct.Struct("<i3I")
00204 _struct_7df = struct.Struct("<7df")