_AddNewWaypoint.py 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. # This Python file uses the following encoding: utf-8
  2. """autogenerated by genpy from waterplus_map_tools/AddNewWaypointRequest.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. import geometry_msgs.msg
  9. class AddNewWaypointRequest(genpy.Message):
  10. _md5sum = "177d54286ddeee12eba514054bddffd5"
  11. _type = "waterplus_map_tools/AddNewWaypointRequest"
  12. _has_header = False # flag to mark the presence of a Header object
  13. _full_text = """string name
  14. geometry_msgs/Pose pose
  15. ================================================================================
  16. MSG: geometry_msgs/Pose
  17. # A representation of pose in free space, composed of position and orientation.
  18. Point position
  19. Quaternion orientation
  20. ================================================================================
  21. MSG: geometry_msgs/Point
  22. # This contains the position of a point in free space
  23. float64 x
  24. float64 y
  25. float64 z
  26. ================================================================================
  27. MSG: geometry_msgs/Quaternion
  28. # This represents an orientation in free space in quaternion form.
  29. float64 x
  30. float64 y
  31. float64 z
  32. float64 w
  33. """
  34. __slots__ = ['name','pose']
  35. _slot_types = ['string','geometry_msgs/Pose']
  36. def __init__(self, *args, **kwds):
  37. """
  38. Constructor. Any message fields that are implicitly/explicitly
  39. set to None will be assigned a default value. The recommend
  40. use is keyword arguments as this is more robust to future message
  41. changes. You cannot mix in-order arguments and keyword arguments.
  42. The available fields are:
  43. name,pose
  44. :param args: complete set of field values, in .msg order
  45. :param kwds: use keyword arguments corresponding to message field names
  46. to set specific fields.
  47. """
  48. if args or kwds:
  49. super(AddNewWaypointRequest, self).__init__(*args, **kwds)
  50. # message fields cannot be None, assign default values for those that are
  51. if self.name is None:
  52. self.name = ''
  53. if self.pose is None:
  54. self.pose = geometry_msgs.msg.Pose()
  55. else:
  56. self.name = ''
  57. self.pose = geometry_msgs.msg.Pose()
  58. def _get_types(self):
  59. """
  60. internal API method
  61. """
  62. return self._slot_types
  63. def serialize(self, buff):
  64. """
  65. serialize message into buffer
  66. :param buff: buffer, ``StringIO``
  67. """
  68. try:
  69. _x = self.name
  70. length = len(_x)
  71. if python3 or type(_x) == unicode:
  72. _x = _x.encode('utf-8')
  73. length = len(_x)
  74. buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
  75. _x = self
  76. buff.write(_get_struct_7d().pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w))
  77. except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
  78. except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
  79. def deserialize(self, str):
  80. """
  81. unpack serialized message in str into this message instance
  82. :param str: byte array of serialized message, ``str``
  83. """
  84. if python3:
  85. codecs.lookup_error("rosmsg").msg_type = self._type
  86. try:
  87. if self.pose is None:
  88. self.pose = geometry_msgs.msg.Pose()
  89. end = 0
  90. start = end
  91. end += 4
  92. (length,) = _struct_I.unpack(str[start:end])
  93. start = end
  94. end += length
  95. if python3:
  96. self.name = str[start:end].decode('utf-8', 'rosmsg')
  97. else:
  98. self.name = str[start:end]
  99. _x = self
  100. start = end
  101. end += 56
  102. (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _get_struct_7d().unpack(str[start:end])
  103. return self
  104. except struct.error as e:
  105. raise genpy.DeserializationError(e) # most likely buffer underfill
  106. def serialize_numpy(self, buff, numpy):
  107. """
  108. serialize message with numpy array types into buffer
  109. :param buff: buffer, ``StringIO``
  110. :param numpy: numpy python module
  111. """
  112. try:
  113. _x = self.name
  114. length = len(_x)
  115. if python3 or type(_x) == unicode:
  116. _x = _x.encode('utf-8')
  117. length = len(_x)
  118. buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
  119. _x = self
  120. buff.write(_get_struct_7d().pack(_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w))
  121. except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
  122. except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
  123. def deserialize_numpy(self, str, numpy):
  124. """
  125. unpack serialized message in str into this message instance using numpy for array types
  126. :param str: byte array of serialized message, ``str``
  127. :param numpy: numpy python module
  128. """
  129. if python3:
  130. codecs.lookup_error("rosmsg").msg_type = self._type
  131. try:
  132. if self.pose is None:
  133. self.pose = geometry_msgs.msg.Pose()
  134. end = 0
  135. start = end
  136. end += 4
  137. (length,) = _struct_I.unpack(str[start:end])
  138. start = end
  139. end += length
  140. if python3:
  141. self.name = str[start:end].decode('utf-8', 'rosmsg')
  142. else:
  143. self.name = str[start:end]
  144. _x = self
  145. start = end
  146. end += 56
  147. (_x.pose.position.x, _x.pose.position.y, _x.pose.position.z, _x.pose.orientation.x, _x.pose.orientation.y, _x.pose.orientation.z, _x.pose.orientation.w,) = _get_struct_7d().unpack(str[start:end])
  148. return self
  149. except struct.error as e:
  150. raise genpy.DeserializationError(e) # most likely buffer underfill
  151. _struct_I = genpy.struct_I
  152. def _get_struct_I():
  153. global _struct_I
  154. return _struct_I
  155. _struct_7d = None
  156. def _get_struct_7d():
  157. global _struct_7d
  158. if _struct_7d is None:
  159. _struct_7d = struct.Struct("<7d")
  160. return _struct_7d
  161. # This Python file uses the following encoding: utf-8
  162. """autogenerated by genpy from waterplus_map_tools/AddNewWaypointResponse.msg. Do not edit."""
  163. import codecs
  164. import sys
  165. python3 = True if sys.hexversion > 0x03000000 else False
  166. import genpy
  167. import struct
  168. class AddNewWaypointResponse(genpy.Message):
  169. _md5sum = "eb13ac1f1354ccecb7941ee8fa2192e8"
  170. _type = "waterplus_map_tools/AddNewWaypointResponse"
  171. _has_header = False # flag to mark the presence of a Header object
  172. _full_text = """bool result
  173. """
  174. __slots__ = ['result']
  175. _slot_types = ['bool']
  176. def __init__(self, *args, **kwds):
  177. """
  178. Constructor. Any message fields that are implicitly/explicitly
  179. set to None will be assigned a default value. The recommend
  180. use is keyword arguments as this is more robust to future message
  181. changes. You cannot mix in-order arguments and keyword arguments.
  182. The available fields are:
  183. result
  184. :param args: complete set of field values, in .msg order
  185. :param kwds: use keyword arguments corresponding to message field names
  186. to set specific fields.
  187. """
  188. if args or kwds:
  189. super(AddNewWaypointResponse, self).__init__(*args, **kwds)
  190. # message fields cannot be None, assign default values for those that are
  191. if self.result is None:
  192. self.result = False
  193. else:
  194. self.result = False
  195. def _get_types(self):
  196. """
  197. internal API method
  198. """
  199. return self._slot_types
  200. def serialize(self, buff):
  201. """
  202. serialize message into buffer
  203. :param buff: buffer, ``StringIO``
  204. """
  205. try:
  206. _x = self.result
  207. buff.write(_get_struct_B().pack(_x))
  208. except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
  209. except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
  210. def deserialize(self, str):
  211. """
  212. unpack serialized message in str into this message instance
  213. :param str: byte array of serialized message, ``str``
  214. """
  215. if python3:
  216. codecs.lookup_error("rosmsg").msg_type = self._type
  217. try:
  218. end = 0
  219. start = end
  220. end += 1
  221. (self.result,) = _get_struct_B().unpack(str[start:end])
  222. self.result = bool(self.result)
  223. return self
  224. except struct.error as e:
  225. raise genpy.DeserializationError(e) # most likely buffer underfill
  226. def serialize_numpy(self, buff, numpy):
  227. """
  228. serialize message with numpy array types into buffer
  229. :param buff: buffer, ``StringIO``
  230. :param numpy: numpy python module
  231. """
  232. try:
  233. _x = self.result
  234. buff.write(_get_struct_B().pack(_x))
  235. except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
  236. except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
  237. def deserialize_numpy(self, str, numpy):
  238. """
  239. unpack serialized message in str into this message instance using numpy for array types
  240. :param str: byte array of serialized message, ``str``
  241. :param numpy: numpy python module
  242. """
  243. if python3:
  244. codecs.lookup_error("rosmsg").msg_type = self._type
  245. try:
  246. end = 0
  247. start = end
  248. end += 1
  249. (self.result,) = _get_struct_B().unpack(str[start:end])
  250. self.result = bool(self.result)
  251. return self
  252. except struct.error as e:
  253. raise genpy.DeserializationError(e) # most likely buffer underfill
  254. _struct_I = genpy.struct_I
  255. def _get_struct_I():
  256. global _struct_I
  257. return _struct_I
  258. _struct_B = None
  259. def _get_struct_B():
  260. global _struct_B
  261. if _struct_B is None:
  262. _struct_B = struct.Struct("<B")
  263. return _struct_B
  264. class AddNewWaypoint(object):
  265. _type = 'waterplus_map_tools/AddNewWaypoint'
  266. _md5sum = '6948a8f076727d2b3b462b6ca2b31b5f'
  267. _request_class = AddNewWaypointRequest
  268. _response_class = AddNewWaypointResponse