_GetNumOfWaypoints.py 6.9 KB

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