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