Package create_node :: Package srv :: Module _SetTurtlebotMode
[frames] | no frames]

Source Code for Module create_node.srv._SetTurtlebotMode

  1  # This Python file uses the following encoding: utf-8 
  2  """autogenerated by genpy from create_node/SetTurtlebotModeRequest.msg. Do not edit.""" 
  3  import sys 
  4  python3 = True if sys.hexversion > 0x03000000 else False 
  5  import genpy 
  6  import struct 
  7   
  8   
9 -class SetTurtlebotModeRequest(genpy.Message):
10 _md5sum = "89b81386720be1cd0ce7a3953fcd1b19" 11 _type = "create_node/SetTurtlebotModeRequest" 12 _has_header = False #flag to mark the presence of a Header object 13 _full_text = """uint8 mode 14 """ 15 __slots__ = ['mode'] 16 _slot_types = ['uint8'] 17
18 - def __init__(self, *args, **kwds):
19 """ 20 Constructor. Any message fields that are implicitly/explicitly 21 set to None will be assigned a default value. The recommend 22 use is keyword arguments as this is more robust to future message 23 changes. You cannot mix in-order arguments and keyword arguments. 24 25 The available fields are: 26 mode 27 28 :param args: complete set of field values, in .msg order 29 :param kwds: use keyword arguments corresponding to message field names 30 to set specific fields. 31 """ 32 if args or kwds: 33 super(SetTurtlebotModeRequest, self).__init__(*args, **kwds) 34 #message fields cannot be None, assign default values for those that are 35 if self.mode is None: 36 self.mode = 0 37 else: 38 self.mode = 0
39
40 - def _get_types(self):
41 """ 42 internal API method 43 """ 44 return self._slot_types
45
46 - def serialize(self, buff):
47 """ 48 serialize message into buffer 49 :param buff: buffer, ``StringIO`` 50 """ 51 try: 52 buff.write(_get_struct_B().pack(self.mode)) 53 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 54 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
55
56 - def deserialize(self, str):
57 """ 58 unpack serialized message in str into this message instance 59 :param str: byte array of serialized message, ``str`` 60 """ 61 try: 62 end = 0 63 start = end 64 end += 1 65 (self.mode,) = _get_struct_B().unpack(str[start:end]) 66 return self 67 except struct.error as e: 68 raise genpy.DeserializationError(e) #most likely buffer underfill
69 70
71 - def serialize_numpy(self, buff, numpy):
72 """ 73 serialize message with numpy array types into buffer 74 :param buff: buffer, ``StringIO`` 75 :param numpy: numpy python module 76 """ 77 try: 78 buff.write(_get_struct_B().pack(self.mode)) 79 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 80 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
81
82 - def deserialize_numpy(self, str, numpy):
83 """ 84 unpack serialized message in str into this message instance using numpy for array types 85 :param str: byte array of serialized message, ``str`` 86 :param numpy: numpy python module 87 """ 88 try: 89 end = 0 90 start = end 91 end += 1 92 (self.mode,) = _get_struct_B().unpack(str[start:end]) 93 return self 94 except struct.error as e: 95 raise genpy.DeserializationError(e) #most likely buffer underfill
96 97 _struct_I = genpy.struct_I
98 -def _get_struct_I():
99 global _struct_I 100 return _struct_I
101 _struct_B = None
102 -def _get_struct_B():
103 global _struct_B 104 if _struct_B is None: 105 _struct_B = struct.Struct("<B") 106 return _struct_B
107 # This Python file uses the following encoding: utf-8 108 """autogenerated by genpy from create_node/SetTurtlebotModeResponse.msg. Do not edit.""" 109 import sys 110 python3 = True if sys.hexversion > 0x03000000 else False 111 import genpy 112 import struct 113 114
115 -class SetTurtlebotModeResponse(genpy.Message):
116 _md5sum = "ef9db56bf4a60ce42049595d58c32b54" 117 _type = "create_node/SetTurtlebotModeResponse" 118 _has_header = False #flag to mark the presence of a Header object 119 _full_text = """bool valid_mode 120 """ 121 __slots__ = ['valid_mode'] 122 _slot_types = ['bool'] 123
124 - def __init__(self, *args, **kwds):
125 """ 126 Constructor. Any message fields that are implicitly/explicitly 127 set to None will be assigned a default value. The recommend 128 use is keyword arguments as this is more robust to future message 129 changes. You cannot mix in-order arguments and keyword arguments. 130 131 The available fields are: 132 valid_mode 133 134 :param args: complete set of field values, in .msg order 135 :param kwds: use keyword arguments corresponding to message field names 136 to set specific fields. 137 """ 138 if args or kwds: 139 super(SetTurtlebotModeResponse, self).__init__(*args, **kwds) 140 #message fields cannot be None, assign default values for those that are 141 if self.valid_mode is None: 142 self.valid_mode = False 143 else: 144 self.valid_mode = False
145
146 - def _get_types(self):
147 """ 148 internal API method 149 """ 150 return self._slot_types
151
152 - def serialize(self, buff):
153 """ 154 serialize message into buffer 155 :param buff: buffer, ``StringIO`` 156 """ 157 try: 158 buff.write(_get_struct_B().pack(self.valid_mode)) 159 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 160 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
161
162 - def deserialize(self, str):
163 """ 164 unpack serialized message in str into this message instance 165 :param str: byte array of serialized message, ``str`` 166 """ 167 try: 168 end = 0 169 start = end 170 end += 1 171 (self.valid_mode,) = _get_struct_B().unpack(str[start:end]) 172 self.valid_mode = bool(self.valid_mode) 173 return self 174 except struct.error as e: 175 raise genpy.DeserializationError(e) #most likely buffer underfill
176 177
178 - def serialize_numpy(self, buff, numpy):
179 """ 180 serialize message with numpy array types into buffer 181 :param buff: buffer, ``StringIO`` 182 :param numpy: numpy python module 183 """ 184 try: 185 buff.write(_get_struct_B().pack(self.valid_mode)) 186 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 187 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
188
189 - def deserialize_numpy(self, str, numpy):
190 """ 191 unpack serialized message in str into this message instance using numpy for array types 192 :param str: byte array of serialized message, ``str`` 193 :param numpy: numpy python module 194 """ 195 try: 196 end = 0 197 start = end 198 end += 1 199 (self.valid_mode,) = _get_struct_B().unpack(str[start:end]) 200 self.valid_mode = bool(self.valid_mode) 201 return self 202 except struct.error as e: 203 raise genpy.DeserializationError(e) #most likely buffer underfill
204 205 _struct_I = genpy.struct_I
206 -def _get_struct_I():
207 global _struct_I 208 return _struct_I
209 _struct_B = None
210 -def _get_struct_B():
211 global _struct_B 212 if _struct_B is None: 213 _struct_B = struct.Struct("<B") 214 return _struct_B
215 -class SetTurtlebotMode(object):
216 _type = 'create_node/SetTurtlebotMode' 217 _md5sum = '652c4fe00e931153f82f8af90f1da441' 218 _request_class = SetTurtlebotModeRequest 219 _response_class = SetTurtlebotModeResponse
220