_GetWaypointByIndex.py 10 KB

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