_RotatedRectStamped.py
Go to the documentation of this file.
00001 """autogenerated by genpy from jsk_perception/RotatedRectStamped.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 jsk_perception.msg
00008 import std_msgs.msg
00009 
00010 class RotatedRectStamped(genpy.Message):
00011   _md5sum = "0260299b5425567e14c7b295b58829e9"
00012   _type = "jsk_perception/RotatedRectStamped"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 RotatedRect rect
00016 
00017 ================================================================================
00018 MSG: std_msgs/Header
00019 # Standard metadata for higher-level stamped data types.
00020 # This is generally used to communicate timestamped data 
00021 # in a particular coordinate frame.
00022 # 
00023 # sequence ID: consecutively increasing ID 
00024 uint32 seq
00025 #Two-integer timestamp that is expressed as:
00026 # * stamp.secs: seconds (stamp_secs) since epoch
00027 # * stamp.nsecs: nanoseconds since stamp_secs
00028 # time-handling sugar is provided by the client library
00029 time stamp
00030 #Frame this data is associated with
00031 # 0: no frame
00032 # 1: global frame
00033 string frame_id
00034 
00035 ================================================================================
00036 MSG: jsk_perception/RotatedRect
00037 float64 x
00038 float64 y
00039 float64 width
00040 float64 height
00041 float64 angle # degree
00042 
00043 """
00044   __slots__ = ['header','rect']
00045   _slot_types = ['std_msgs/Header','jsk_perception/RotatedRect']
00046 
00047   def __init__(self, *args, **kwds):
00048     """
00049     Constructor. Any message fields that are implicitly/explicitly
00050     set to None will be assigned a default value. The recommend
00051     use is keyword arguments as this is more robust to future message
00052     changes.  You cannot mix in-order arguments and keyword arguments.
00053 
00054     The available fields are:
00055        header,rect
00056 
00057     :param args: complete set of field values, in .msg order
00058     :param kwds: use keyword arguments corresponding to message field names
00059     to set specific fields.
00060     """
00061     if args or kwds:
00062       super(RotatedRectStamped, self).__init__(*args, **kwds)
00063       #message fields cannot be None, assign default values for those that are
00064       if self.header is None:
00065         self.header = std_msgs.msg.Header()
00066       if self.rect is None:
00067         self.rect = jsk_perception.msg.RotatedRect()
00068     else:
00069       self.header = std_msgs.msg.Header()
00070       self.rect = jsk_perception.msg.RotatedRect()
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, ``StringIO``
00082     """
00083     try:
00084       _x = self
00085       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00086       _x = self.header.frame_id
00087       length = len(_x)
00088       if python3 or type(_x) == unicode:
00089         _x = _x.encode('utf-8')
00090         length = len(_x)
00091       buff.write(struct.pack('<I%ss'%length, length, _x))
00092       _x = self
00093       buff.write(_struct_5d.pack(_x.rect.x, _x.rect.y, _x.rect.width, _x.rect.height, _x.rect.angle))
00094     except struct.error as se: self._check_types(se)
00095     except TypeError as te: self._check_types(te)
00096 
00097   def deserialize(self, str):
00098     """
00099     unpack serialized message in str into this message instance
00100     :param str: byte array of serialized message, ``str``
00101     """
00102     try:
00103       if self.header is None:
00104         self.header = std_msgs.msg.Header()
00105       if self.rect is None:
00106         self.rect = jsk_perception.msg.RotatedRect()
00107       end = 0
00108       _x = self
00109       start = end
00110       end += 12
00111       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00112       start = end
00113       end += 4
00114       (length,) = _struct_I.unpack(str[start:end])
00115       start = end
00116       end += length
00117       if python3:
00118         self.header.frame_id = str[start:end].decode('utf-8')
00119       else:
00120         self.header.frame_id = str[start:end]
00121       _x = self
00122       start = end
00123       end += 40
00124       (_x.rect.x, _x.rect.y, _x.rect.width, _x.rect.height, _x.rect.angle,) = _struct_5d.unpack(str[start:end])
00125       return self
00126     except struct.error as e:
00127       raise genpy.DeserializationError(e) #most likely buffer underfill
00128 
00129 
00130   def serialize_numpy(self, buff, numpy):
00131     """
00132     serialize message with numpy array types into buffer
00133     :param buff: buffer, ``StringIO``
00134     :param numpy: numpy python module
00135     """
00136     try:
00137       _x = self
00138       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00139       _x = self.header.frame_id
00140       length = len(_x)
00141       if python3 or type(_x) == unicode:
00142         _x = _x.encode('utf-8')
00143         length = len(_x)
00144       buff.write(struct.pack('<I%ss'%length, length, _x))
00145       _x = self
00146       buff.write(_struct_5d.pack(_x.rect.x, _x.rect.y, _x.rect.width, _x.rect.height, _x.rect.angle))
00147     except struct.error as se: self._check_types(se)
00148     except TypeError as te: self._check_types(te)
00149 
00150   def deserialize_numpy(self, str, numpy):
00151     """
00152     unpack serialized message in str into this message instance using numpy for array types
00153     :param str: byte array of serialized message, ``str``
00154     :param numpy: numpy python module
00155     """
00156     try:
00157       if self.header is None:
00158         self.header = std_msgs.msg.Header()
00159       if self.rect is None:
00160         self.rect = jsk_perception.msg.RotatedRect()
00161       end = 0
00162       _x = self
00163       start = end
00164       end += 12
00165       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00166       start = end
00167       end += 4
00168       (length,) = _struct_I.unpack(str[start:end])
00169       start = end
00170       end += length
00171       if python3:
00172         self.header.frame_id = str[start:end].decode('utf-8')
00173       else:
00174         self.header.frame_id = str[start:end]
00175       _x = self
00176       start = end
00177       end += 40
00178       (_x.rect.x, _x.rect.y, _x.rect.width, _x.rect.height, _x.rect.angle,) = _struct_5d.unpack(str[start:end])
00179       return self
00180     except struct.error as e:
00181       raise genpy.DeserializationError(e) #most likely buffer underfill
00182 
00183 _struct_I = genpy.struct_I
00184 _struct_5d = struct.Struct("<5d")
00185 _struct_3I = struct.Struct("<3I")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


jsk_perception
Author(s): Manabu Saito
autogenerated on Sat Mar 23 2013 18:21:31