_Interval.py
Go to the documentation of this file.
00001 """autogenerated by genpy from calibration_msgs/Interval.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 genpy
00008 
00009 class Interval(genpy.Message):
00010   _md5sum = "ef8dc98e5cfe048db2cfb689ace74756"
00011   _type = "calibration_msgs/Interval"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """time start
00014 time end
00015 
00016 """
00017   __slots__ = ['start','end']
00018   _slot_types = ['time','time']
00019 
00020   def __init__(self, *args, **kwds):
00021     """
00022     Constructor. Any message fields that are implicitly/explicitly
00023     set to None will be assigned a default value. The recommend
00024     use is keyword arguments as this is more robust to future message
00025     changes.  You cannot mix in-order arguments and keyword arguments.
00026 
00027     The available fields are:
00028        start,end
00029 
00030     :param args: complete set of field values, in .msg order
00031     :param kwds: use keyword arguments corresponding to message field names
00032     to set specific fields.
00033     """
00034     if args or kwds:
00035       super(Interval, self).__init__(*args, **kwds)
00036       #message fields cannot be None, assign default values for those that are
00037       if self.start is None:
00038         self.start = genpy.Time()
00039       if self.end is None:
00040         self.end = genpy.Time()
00041     else:
00042       self.start = genpy.Time()
00043       self.end = genpy.Time()
00044 
00045   def _get_types(self):
00046     """
00047     internal API method
00048     """
00049     return self._slot_types
00050 
00051   def serialize(self, buff):
00052     """
00053     serialize message into buffer
00054     :param buff: buffer, ``StringIO``
00055     """
00056     try:
00057       _x = self
00058       buff.write(_struct_4I.pack(_x.start.secs, _x.start.nsecs, _x.end.secs, _x.end.nsecs))
00059     except struct.error as se: self._check_types(se)
00060     except TypeError as te: self._check_types(te)
00061 
00062   def deserialize(self, str):
00063     """
00064     unpack serialized message in str into this message instance
00065     :param str: byte array of serialized message, ``str``
00066     """
00067     try:
00068       if self.start is None:
00069         self.start = genpy.Time()
00070       if self.end is None:
00071         self.end = genpy.Time()
00072       end = 0
00073       _x = self
00074       start = end
00075       end += 16
00076       (_x.start.secs, _x.start.nsecs, _x.end.secs, _x.end.nsecs,) = _struct_4I.unpack(str[start:end])
00077       self.start.canon()
00078       self.end.canon()
00079       return self
00080     except struct.error as e:
00081       raise genpy.DeserializationError(e) #most likely buffer underfill
00082 
00083 
00084   def serialize_numpy(self, buff, numpy):
00085     """
00086     serialize message with numpy array types into buffer
00087     :param buff: buffer, ``StringIO``
00088     :param numpy: numpy python module
00089     """
00090     try:
00091       _x = self
00092       buff.write(_struct_4I.pack(_x.start.secs, _x.start.nsecs, _x.end.secs, _x.end.nsecs))
00093     except struct.error as se: self._check_types(se)
00094     except TypeError as te: self._check_types(te)
00095 
00096   def deserialize_numpy(self, str, numpy):
00097     """
00098     unpack serialized message in str into this message instance using numpy for array types
00099     :param str: byte array of serialized message, ``str``
00100     :param numpy: numpy python module
00101     """
00102     try:
00103       if self.start is None:
00104         self.start = genpy.Time()
00105       if self.end is None:
00106         self.end = genpy.Time()
00107       end = 0
00108       _x = self
00109       start = end
00110       end += 16
00111       (_x.start.secs, _x.start.nsecs, _x.end.secs, _x.end.nsecs,) = _struct_4I.unpack(str[start:end])
00112       self.start.canon()
00113       self.end.canon()
00114       return self
00115     except struct.error as e:
00116       raise genpy.DeserializationError(e) #most likely buffer underfill
00117 
00118 _struct_I = genpy.struct_I
00119 _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