_GetChargerByName.py 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. # This Python file uses the following encoding: utf-8
  2. """autogenerated by genpy from waterplus_map_tools/GetChargerByNameRequest.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 GetChargerByNameRequest(genpy.Message):
  9. _md5sum = "c1f3d28f1b044c871e6eff2e9fc3c667"
  10. _type = "waterplus_map_tools/GetChargerByNameRequest"
  11. _has_header = False # flag to mark the presence of a Header object
  12. _full_text = """string name
  13. """
  14. __slots__ = ['name']
  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. name
  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(GetChargerByNameRequest, self).__init__(*args, **kwds)
  30. # message fields cannot be None, assign default values for those that are
  31. if self.name is None:
  32. self.name = ''
  33. else:
  34. self.name = ''
  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.name
  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.name = str[start:end].decode('utf-8', 'rosmsg')
  70. else:
  71. self.name = 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.name
  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.name = str[start:end].decode('utf-8', 'rosmsg')
  107. else:
  108. self.name = 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/GetChargerByNameResponse.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. import geometry_msgs.msg
  124. class GetChargerByNameResponse(genpy.Message):
  125. _md5sum = "177d54286ddeee12eba514054bddffd5"
  126. _type = "waterplus_map_tools/GetChargerByNameResponse"
  127. _has_header = False # flag to mark the presence of a Header object
  128. _full_text = """string name
  129. geometry_msgs/Pose pose
  130. ================================================================================
  131. MSG: geometry_msgs/Pose
  132. # A representation of pose in free space, composed of position and orientation.
  133. Point position
  134. Quaternion orientation
  135. ================================================================================
  136. MSG: geometry_msgs/Point
  137. # This contains the position of a point in free space
  138. float64 x
  139. float64 y
  140. float64 z
  141. ================================================================================
  142. MSG: geometry_msgs/Quaternion
  143. # This represents an orientation in free space in quaternion form.
  144. float64 x
  145. float64 y
  146. float64 z
  147. float64 w
  148. """
  149. __slots__ = ['name','pose']
  150. _slot_types = ['string','geometry_msgs/Pose']
  151. def __init__(self, *args, **kwds):
  152. """
  153. Constructor. Any message fields that are implicitly/explicitly
  154. set to None will be assigned a default value. The recommend
  155. use is keyword arguments as this is more robust to future message
  156. changes. You cannot mix in-order arguments and keyword arguments.
  157. The available fields are:
  158. name,pose
  159. :param args: complete set of field values, in .msg order
  160. :param kwds: use keyword arguments corresponding to message field names
  161. to set specific fields.
  162. """
  163. if args or kwds:
  164. super(GetChargerByNameResponse, self).__init__(*args, **kwds)
  165. # message fields cannot be None, assign default values for those that are
  166. if self.name is None:
  167. self.name = ''
  168. if self.pose is None:
  169. self.pose = geometry_msgs.msg.Pose()
  170. else:
  171. self.name = ''
  172. self.pose = geometry_msgs.msg.Pose()
  173. def _get_types(self):
  174. """
  175. internal API method
  176. """
  177. return self._slot_types
  178. def serialize(self, buff):
  179. """
  180. serialize message into buffer
  181. :param buff: buffer, ``StringIO``
  182. """
  183. try:
  184. _x = self.name
  185. length = len(_x)
  186. if python3 or type(_x) == unicode:
  187. _x = _x.encode('utf-8')
  188. length = len(_x)
  189. buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
  190. _x = self
  191. 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))
  192. except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
  193. except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
  194. def deserialize(self, str):
  195. """
  196. unpack serialized message in str into this message instance
  197. :param str: byte array of serialized message, ``str``
  198. """
  199. if python3:
  200. codecs.lookup_error("rosmsg").msg_type = self._type
  201. try:
  202. if self.pose is None:
  203. self.pose = geometry_msgs.msg.Pose()
  204. end = 0
  205. start = end
  206. end += 4
  207. (length,) = _struct_I.unpack(str[start:end])
  208. start = end
  209. end += length
  210. if python3:
  211. self.name = str[start:end].decode('utf-8', 'rosmsg')
  212. else:
  213. self.name = str[start:end]
  214. _x = self
  215. start = end
  216. end += 56
  217. (_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])
  218. return self
  219. except struct.error as e:
  220. raise genpy.DeserializationError(e) # most likely buffer underfill
  221. def serialize_numpy(self, buff, numpy):
  222. """
  223. serialize message with numpy array types into buffer
  224. :param buff: buffer, ``StringIO``
  225. :param numpy: numpy python module
  226. """
  227. try:
  228. _x = self.name
  229. length = len(_x)
  230. if python3 or type(_x) == unicode:
  231. _x = _x.encode('utf-8')
  232. length = len(_x)
  233. buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
  234. _x = self
  235. 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))
  236. except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
  237. except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
  238. def deserialize_numpy(self, str, numpy):
  239. """
  240. unpack serialized message in str into this message instance using numpy for array types
  241. :param str: byte array of serialized message, ``str``
  242. :param numpy: numpy python module
  243. """
  244. if python3:
  245. codecs.lookup_error("rosmsg").msg_type = self._type
  246. try:
  247. if self.pose is None:
  248. self.pose = geometry_msgs.msg.Pose()
  249. end = 0
  250. start = end
  251. end += 4
  252. (length,) = _struct_I.unpack(str[start:end])
  253. start = end
  254. end += length
  255. if python3:
  256. self.name = str[start:end].decode('utf-8', 'rosmsg')
  257. else:
  258. self.name = str[start:end]
  259. _x = self
  260. start = end
  261. end += 56
  262. (_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])
  263. return self
  264. except struct.error as e:
  265. raise genpy.DeserializationError(e) # most likely buffer underfill
  266. _struct_I = genpy.struct_I
  267. def _get_struct_I():
  268. global _struct_I
  269. return _struct_I
  270. _struct_7d = None
  271. def _get_struct_7d():
  272. global _struct_7d
  273. if _struct_7d is None:
  274. _struct_7d = struct.Struct("<7d")
  275. return _struct_7d
  276. class GetChargerByName(object):
  277. _type = 'waterplus_map_tools/GetChargerByName'
  278. _md5sum = '5164dc1f215ac8183cbe49b46c7ff40e'
  279. _request_class = GetChargerByNameRequest
  280. _response_class = GetChargerByNameResponse