00001 """autogenerated by genpy from telekyb_msgs/Behavior.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 Behavior(genpy.Message):
00010 _md5sum = "c07cc78ced021dda3f94e8bfcaf99488"
00011 _type = "telekyb_msgs/Behavior"
00012 _has_header = True
00013 _full_text = """#
00014 # Copyright 2011 Antonio Franchi and Martin Riedel
00015 #
00016 # This file is part of TeleKyb.
00017 #
00018 # TeleKyb is free software: you can redistribute it and/or modify
00019 # it under the terms of the GNU General Public License as published by
00020 # the Free Software Foundation, either version 3 of the License, or
00021 # (at your option) any later version.
00022 #
00023 # TeleKyb is distributed in the hope that it will be useful,
00024 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00026 # GNU General Public License for more details.
00027 #
00028 # You should have received a copy of the GNU General Public License
00029 # along with TeleKyb. If not, see <http://www.gnu.org/licenses/>.
00030
00031 # Message to Inform Client of Behavior Changes.
00032 Header header
00033
00034 uint64 behaviorID
00035 string behaviorName
00036
00037 ================================================================================
00038 MSG: std_msgs/Header
00039 # Standard metadata for higher-level stamped data types.
00040 # This is generally used to communicate timestamped data
00041 # in a particular coordinate frame.
00042 #
00043 # sequence ID: consecutively increasing ID
00044 uint32 seq
00045 #Two-integer timestamp that is expressed as:
00046 # * stamp.secs: seconds (stamp_secs) since epoch
00047 # * stamp.nsecs: nanoseconds since stamp_secs
00048 # time-handling sugar is provided by the client library
00049 time stamp
00050 #Frame this data is associated with
00051 # 0: no frame
00052 # 1: global frame
00053 string frame_id
00054
00055 """
00056 __slots__ = ['header','behaviorID','behaviorName']
00057 _slot_types = ['std_msgs/Header','uint64','string']
00058
00059 def __init__(self, *args, **kwds):
00060 """
00061 Constructor. Any message fields that are implicitly/explicitly
00062 set to None will be assigned a default value. The recommend
00063 use is keyword arguments as this is more robust to future message
00064 changes. You cannot mix in-order arguments and keyword arguments.
00065
00066 The available fields are:
00067 header,behaviorID,behaviorName
00068
00069 :param args: complete set of field values, in .msg order
00070 :param kwds: use keyword arguments corresponding to message field names
00071 to set specific fields.
00072 """
00073 if args or kwds:
00074 super(Behavior, self).__init__(*args, **kwds)
00075
00076 if self.header is None:
00077 self.header = std_msgs.msg.Header()
00078 if self.behaviorID is None:
00079 self.behaviorID = 0
00080 if self.behaviorName is None:
00081 self.behaviorName = ''
00082 else:
00083 self.header = std_msgs.msg.Header()
00084 self.behaviorID = 0
00085 self.behaviorName = ''
00086
00087 def _get_types(self):
00088 """
00089 internal API method
00090 """
00091 return self._slot_types
00092
00093 def serialize(self, buff):
00094 """
00095 serialize message into buffer
00096 :param buff: buffer, ``StringIO``
00097 """
00098 try:
00099 _x = self
00100 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00101 _x = self.header.frame_id
00102 length = len(_x)
00103 if python3 or type(_x) == unicode:
00104 _x = _x.encode('utf-8')
00105 length = len(_x)
00106 buff.write(struct.pack('<I%ss'%length, length, _x))
00107 buff.write(_struct_Q.pack(self.behaviorID))
00108 _x = self.behaviorName
00109 length = len(_x)
00110 if python3 or type(_x) == unicode:
00111 _x = _x.encode('utf-8')
00112 length = len(_x)
00113 buff.write(struct.pack('<I%ss'%length, length, _x))
00114 except struct.error as se: self._check_types(se)
00115 except TypeError as te: self._check_types(te)
00116
00117 def deserialize(self, str):
00118 """
00119 unpack serialized message in str into this message instance
00120 :param str: byte array of serialized message, ``str``
00121 """
00122 try:
00123 if self.header is None:
00124 self.header = std_msgs.msg.Header()
00125 end = 0
00126 _x = self
00127 start = end
00128 end += 12
00129 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00130 start = end
00131 end += 4
00132 (length,) = _struct_I.unpack(str[start:end])
00133 start = end
00134 end += length
00135 if python3:
00136 self.header.frame_id = str[start:end].decode('utf-8')
00137 else:
00138 self.header.frame_id = str[start:end]
00139 start = end
00140 end += 8
00141 (self.behaviorID,) = _struct_Q.unpack(str[start:end])
00142 start = end
00143 end += 4
00144 (length,) = _struct_I.unpack(str[start:end])
00145 start = end
00146 end += length
00147 if python3:
00148 self.behaviorName = str[start:end].decode('utf-8')
00149 else:
00150 self.behaviorName = str[start:end]
00151 return self
00152 except struct.error as e:
00153 raise genpy.DeserializationError(e)
00154
00155
00156 def serialize_numpy(self, buff, numpy):
00157 """
00158 serialize message with numpy array types into buffer
00159 :param buff: buffer, ``StringIO``
00160 :param numpy: numpy python module
00161 """
00162 try:
00163 _x = self
00164 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00165 _x = self.header.frame_id
00166 length = len(_x)
00167 if python3 or type(_x) == unicode:
00168 _x = _x.encode('utf-8')
00169 length = len(_x)
00170 buff.write(struct.pack('<I%ss'%length, length, _x))
00171 buff.write(_struct_Q.pack(self.behaviorID))
00172 _x = self.behaviorName
00173 length = len(_x)
00174 if python3 or type(_x) == unicode:
00175 _x = _x.encode('utf-8')
00176 length = len(_x)
00177 buff.write(struct.pack('<I%ss'%length, length, _x))
00178 except struct.error as se: self._check_types(se)
00179 except TypeError as te: self._check_types(te)
00180
00181 def deserialize_numpy(self, str, numpy):
00182 """
00183 unpack serialized message in str into this message instance using numpy for array types
00184 :param str: byte array of serialized message, ``str``
00185 :param numpy: numpy python module
00186 """
00187 try:
00188 if self.header is None:
00189 self.header = std_msgs.msg.Header()
00190 end = 0
00191 _x = self
00192 start = end
00193 end += 12
00194 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00195 start = end
00196 end += 4
00197 (length,) = _struct_I.unpack(str[start:end])
00198 start = end
00199 end += length
00200 if python3:
00201 self.header.frame_id = str[start:end].decode('utf-8')
00202 else:
00203 self.header.frame_id = str[start:end]
00204 start = end
00205 end += 8
00206 (self.behaviorID,) = _struct_Q.unpack(str[start:end])
00207 start = end
00208 end += 4
00209 (length,) = _struct_I.unpack(str[start:end])
00210 start = end
00211 end += length
00212 if python3:
00213 self.behaviorName = str[start:end].decode('utf-8')
00214 else:
00215 self.behaviorName = str[start:end]
00216 return self
00217 except struct.error as e:
00218 raise genpy.DeserializationError(e)
00219
00220 _struct_I = genpy.struct_I
00221 _struct_Q = struct.Struct("<Q")
00222 _struct_3I = struct.Struct("<3I")