1 """autogenerated by genpy from create_node/Turtle.msg. Do not edit."""
2 import sys
3 python3 = True if sys.hexversion > 0x03000000 else False
4 import genpy
5 import struct
6
7
9 _md5sum = "9d5c2dcd348ac8f76ce2a4307bd63a13"
10 _type = "create_node/Turtle"
11 _has_header = False
12 _full_text = """float32 linear
13 float32 angular
14 """
15 __slots__ = ['linear','angular']
16 _slot_types = ['float32','float32']
17
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(Turtle, self).__init__(*args, **kwds)
34
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
44 """
45 internal API method
46 """
47 return self._slot_types
48
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
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)
74
75
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
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)
103
104 _struct_I = genpy.struct_I
105 _struct_2f = struct.Struct("<2f")
106