Go to the documentation of this file.00001 """autogenerated by genpy from smach_msgs/SmachContainerInitialStatusCmd.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class SmachContainerInitialStatusCmd(genpy.Message):
00009 _md5sum = "45f8cf31fc29b829db77f23001f788d6"
00010 _type = "smach_msgs/SmachContainerInitialStatusCmd"
00011 _has_header = False
00012 _full_text = """# The path to the node in the server
00013 string path
00014
00015 # The desired initial state(s)
00016 string[] initial_states
00017
00018 # Initial values for the local user data of the state machine
00019 # A pickled user data structure
00020 string local_data
00021
00022 """
00023 __slots__ = ['path','initial_states','local_data']
00024 _slot_types = ['string','string[]','string']
00025
00026 def __init__(self, *args, **kwds):
00027 """
00028 Constructor. Any message fields that are implicitly/explicitly
00029 set to None will be assigned a default value. The recommend
00030 use is keyword arguments as this is more robust to future message
00031 changes. You cannot mix in-order arguments and keyword arguments.
00032
00033 The available fields are:
00034 path,initial_states,local_data
00035
00036 :param args: complete set of field values, in .msg order
00037 :param kwds: use keyword arguments corresponding to message field names
00038 to set specific fields.
00039 """
00040 if args or kwds:
00041 super(SmachContainerInitialStatusCmd, self).__init__(*args, **kwds)
00042
00043 if self.path is None:
00044 self.path = ''
00045 if self.initial_states is None:
00046 self.initial_states = []
00047 if self.local_data is None:
00048 self.local_data = ''
00049 else:
00050 self.path = ''
00051 self.initial_states = []
00052 self.local_data = ''
00053
00054 def _get_types(self):
00055 """
00056 internal API method
00057 """
00058 return self._slot_types
00059
00060 def serialize(self, buff):
00061 """
00062 serialize message into buffer
00063 :param buff: buffer, ``StringIO``
00064 """
00065 try:
00066 _x = self.path
00067 length = len(_x)
00068 if python3 or type(_x) == unicode:
00069 _x = _x.encode('utf-8')
00070 length = len(_x)
00071 buff.write(struct.pack('<I%ss'%length, length, _x))
00072 length = len(self.initial_states)
00073 buff.write(_struct_I.pack(length))
00074 for val1 in self.initial_states:
00075 length = len(val1)
00076 if python3 or type(val1) == unicode:
00077 val1 = val1.encode('utf-8')
00078 length = len(val1)
00079 buff.write(struct.pack('<I%ss'%length, length, val1))
00080 _x = self.local_data
00081 length = len(_x)
00082 if python3 or type(_x) == unicode:
00083 _x = _x.encode('utf-8')
00084 length = len(_x)
00085 buff.write(struct.pack('<I%ss'%length, length, _x))
00086 except struct.error as se: self._check_types(se)
00087 except TypeError as te: self._check_types(te)
00088
00089 def deserialize(self, str):
00090 """
00091 unpack serialized message in str into this message instance
00092 :param str: byte array of serialized message, ``str``
00093 """
00094 try:
00095 end = 0
00096 start = end
00097 end += 4
00098 (length,) = _struct_I.unpack(str[start:end])
00099 start = end
00100 end += length
00101 if python3:
00102 self.path = str[start:end].decode('utf-8')
00103 else:
00104 self.path = str[start:end]
00105 start = end
00106 end += 4
00107 (length,) = _struct_I.unpack(str[start:end])
00108 self.initial_states = []
00109 for i in range(0, length):
00110 start = end
00111 end += 4
00112 (length,) = _struct_I.unpack(str[start:end])
00113 start = end
00114 end += length
00115 if python3:
00116 val1 = str[start:end].decode('utf-8')
00117 else:
00118 val1 = str[start:end]
00119 self.initial_states.append(val1)
00120 start = end
00121 end += 4
00122 (length,) = _struct_I.unpack(str[start:end])
00123 start = end
00124 end += length
00125 if python3:
00126 self.local_data = str[start:end].decode('utf-8')
00127 else:
00128 self.local_data = str[start:end]
00129 return self
00130 except struct.error as e:
00131 raise genpy.DeserializationError(e)
00132
00133
00134 def serialize_numpy(self, buff, numpy):
00135 """
00136 serialize message with numpy array types into buffer
00137 :param buff: buffer, ``StringIO``
00138 :param numpy: numpy python module
00139 """
00140 try:
00141 _x = self.path
00142 length = len(_x)
00143 if python3 or type(_x) == unicode:
00144 _x = _x.encode('utf-8')
00145 length = len(_x)
00146 buff.write(struct.pack('<I%ss'%length, length, _x))
00147 length = len(self.initial_states)
00148 buff.write(_struct_I.pack(length))
00149 for val1 in self.initial_states:
00150 length = len(val1)
00151 if python3 or type(val1) == unicode:
00152 val1 = val1.encode('utf-8')
00153 length = len(val1)
00154 buff.write(struct.pack('<I%ss'%length, length, val1))
00155 _x = self.local_data
00156 length = len(_x)
00157 if python3 or type(_x) == unicode:
00158 _x = _x.encode('utf-8')
00159 length = len(_x)
00160 buff.write(struct.pack('<I%ss'%length, length, _x))
00161 except struct.error as se: self._check_types(se)
00162 except TypeError as te: self._check_types(te)
00163
00164 def deserialize_numpy(self, str, numpy):
00165 """
00166 unpack serialized message in str into this message instance using numpy for array types
00167 :param str: byte array of serialized message, ``str``
00168 :param numpy: numpy python module
00169 """
00170 try:
00171 end = 0
00172 start = end
00173 end += 4
00174 (length,) = _struct_I.unpack(str[start:end])
00175 start = end
00176 end += length
00177 if python3:
00178 self.path = str[start:end].decode('utf-8')
00179 else:
00180 self.path = str[start:end]
00181 start = end
00182 end += 4
00183 (length,) = _struct_I.unpack(str[start:end])
00184 self.initial_states = []
00185 for i in range(0, length):
00186 start = end
00187 end += 4
00188 (length,) = _struct_I.unpack(str[start:end])
00189 start = end
00190 end += length
00191 if python3:
00192 val1 = str[start:end].decode('utf-8')
00193 else:
00194 val1 = str[start:end]
00195 self.initial_states.append(val1)
00196 start = end
00197 end += 4
00198 (length,) = _struct_I.unpack(str[start:end])
00199 start = end
00200 end += length
00201 if python3:
00202 self.local_data = str[start:end].decode('utf-8')
00203 else:
00204 self.local_data = str[start:end]
00205 return self
00206 except struct.error as e:
00207 raise genpy.DeserializationError(e)
00208
00209 _struct_I = genpy.struct_I