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


calibration_msgs
Author(s): Vijay Pradeep
autogenerated on Thu Aug 15 2013 10:15:15