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