Package eddiebot_node :: Package msg :: Module _Eddie
[frames] | no frames]

Source Code for Module eddiebot_node.msg._Eddie

  1  """autogenerated by genpy from eddiebot_node/Eddie.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 Eddie(genpy.Message):
9 _md5sum = "9d5c2dcd348ac8f76ce2a4307bd63a13" 10 _type = "eddiebot_node/Eddie" 11 _has_header = False #flag to mark the presence of a Header object 12 _full_text = """float32 linear 13 float32 angular 14 """ 15 __slots__ = ['linear','angular'] 16 _slot_types = ['float32','float32'] 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 linear,angular 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(Eddie, self).__init__(*args, **kwds) 34 #message fields cannot be None, assign default values for those that are 35 if self.linear is None: 36 self.linear = 0. 37 if self.angular is None: 38 self.angular = 0. 39 else: 40 self.linear = 0. 41 self.angular = 0.
42
43 - def _get_types(self):
44 """ 45 internal API method 46 """ 47 return self._slot_types
48
49 - def serialize(self, buff):
50 """ 51 serialize message into buffer 52 :param buff: buffer, ``StringIO`` 53 """ 54 try: 55 _x = self 56 buff.write(_struct_2f.pack(_x.linear, _x.angular)) 57 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x)))) 58 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
59
60 - def deserialize(self, str):
61 """ 62 unpack serialized message in str into this message instance 63 :param str: byte array of serialized message, ``str`` 64 """ 65 try: 66 end = 0 67 _x = self 68 start = end 69 end += 8 70 (_x.linear, _x.angular,) = _struct_2f.unpack(str[start:end]) 71 return self 72 except struct.error as e: 73 raise genpy.DeserializationError(e) #most likely buffer underfill
74 75
76 - def serialize_numpy(self, buff, numpy):
77 """ 78 serialize message with numpy array types into buffer 79 :param buff: buffer, ``StringIO`` 80 :param numpy: numpy python module 81 """ 82 try: 83 _x = self 84 buff.write(_struct_2f.pack(_x.linear, _x.angular)) 85 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x)))) 86 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
87
88 - def deserialize_numpy(self, str, numpy):
89 """ 90 unpack serialized message in str into this message instance using numpy for array types 91 :param str: byte array of serialized message, ``str`` 92 :param numpy: numpy python module 93 """ 94 try: 95 end = 0 96 _x = self 97 start = end 98 end += 8 99 (_x.linear, _x.angular,) = _struct_2f.unpack(str[start:end]) 100 return self 101 except struct.error as e: 102 raise genpy.DeserializationError(e) #most likely buffer underfill
103 104 _struct_I = genpy.struct_I 105 _struct_2f = struct.Struct("<2f") 106