Package eddiebot_node :: Package srv :: Module _SetEddiebotMode
[frames] | no frames]

Source Code for Module eddiebot_node.srv._SetEddiebotMode

  1  """autogenerated by genpy from eddiebot_node/SetEddiebotModeRequest.msg. Do not edit.""" 
  2  import sys 
  3  python3 = True if sys.hexversion > 0x03000000 else False 
  4  import genpy 
  5  import struct 
  6   
  7   
8 -class SetEddiebotModeRequest(genpy.Message):
9 _md5sum = "89b81386720be1cd0ce7a3953fcd1b19" 10 _type = "eddiebot_node/SetEddiebotModeRequest" 11 _has_header = False #flag to mark the presence of a Header object 12 _full_text = """uint8 mode 13 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(SetEddiebotModeRequest, 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(_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(_x)))) 54 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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,) = _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(_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(_x)))) 80 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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,) = _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 _struct_B = struct.Struct("<B") 99 """autogenerated by genpy from eddiebot_node/SetEddiebotModeResponse.msg. Do not edit.""" 100 import sys 101 python3 = True if sys.hexversion > 0x03000000 else False 102 import genpy 103 import struct 104 105
106 -class SetEddiebotModeResponse(genpy.Message):
107 _md5sum = "ef9db56bf4a60ce42049595d58c32b54" 108 _type = "eddiebot_node/SetEddiebotModeResponse" 109 _has_header = False #flag to mark the presence of a Header object 110 _full_text = """bool valid_mode 111 112 """ 113 __slots__ = ['valid_mode'] 114 _slot_types = ['bool'] 115
116 - def __init__(self, *args, **kwds):
117 """ 118 Constructor. Any message fields that are implicitly/explicitly 119 set to None will be assigned a default value. The recommend 120 use is keyword arguments as this is more robust to future message 121 changes. You cannot mix in-order arguments and keyword arguments. 122 123 The available fields are: 124 valid_mode 125 126 :param args: complete set of field values, in .msg order 127 :param kwds: use keyword arguments corresponding to message field names 128 to set specific fields. 129 """ 130 if args or kwds: 131 super(SetEddiebotModeResponse, self).__init__(*args, **kwds) 132 #message fields cannot be None, assign default values for those that are 133 if self.valid_mode is None: 134 self.valid_mode = False 135 else: 136 self.valid_mode = False
137
138 - def _get_types(self):
139 """ 140 internal API method 141 """ 142 return self._slot_types
143
144 - def serialize(self, buff):
145 """ 146 serialize message into buffer 147 :param buff: buffer, ``StringIO`` 148 """ 149 try: 150 buff.write(_struct_B.pack(self.valid_mode)) 151 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x)))) 152 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
153
154 - def deserialize(self, str):
155 """ 156 unpack serialized message in str into this message instance 157 :param str: byte array of serialized message, ``str`` 158 """ 159 try: 160 end = 0 161 start = end 162 end += 1 163 (self.valid_mode,) = _struct_B.unpack(str[start:end]) 164 self.valid_mode = bool(self.valid_mode) 165 return self 166 except struct.error as e: 167 raise genpy.DeserializationError(e) #most likely buffer underfill
168 169
170 - def serialize_numpy(self, buff, numpy):
171 """ 172 serialize message with numpy array types into buffer 173 :param buff: buffer, ``StringIO`` 174 :param numpy: numpy python module 175 """ 176 try: 177 buff.write(_struct_B.pack(self.valid_mode)) 178 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x)))) 179 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
180
181 - def deserialize_numpy(self, str, numpy):
182 """ 183 unpack serialized message in str into this message instance using numpy for array types 184 :param str: byte array of serialized message, ``str`` 185 :param numpy: numpy python module 186 """ 187 try: 188 end = 0 189 start = end 190 end += 1 191 (self.valid_mode,) = _struct_B.unpack(str[start:end]) 192 self.valid_mode = bool(self.valid_mode) 193 return self 194 except struct.error as e: 195 raise genpy.DeserializationError(e) #most likely buffer underfill
196 197 _struct_I = genpy.struct_I 198 _struct_B = struct.Struct("<B")
199 -class SetEddiebotMode(object):
200 _type = 'eddiebot_node/SetEddiebotMode' 201 _md5sum = '652c4fe00e931153f82f8af90f1da441' 202 _request_class = SetEddiebotModeRequest 203 _response_class = SetEddiebotModeResponse
204