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


pr2_msgs
Author(s): Eric Berger and many others
autogenerated on Mon Jan 6 2014 11:34:07