_SaveWaypoints.py 7.4 KB

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