AddNewWaypoint.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. // Auto-generated. Do not edit!
  2. // (in-package waterplus_map_tools.srv)
  3. "use strict";
  4. const _serializer = _ros_msg_utils.Serialize;
  5. const _arraySerializer = _serializer.Array;
  6. const _deserializer = _ros_msg_utils.Deserialize;
  7. const _arrayDeserializer = _deserializer.Array;
  8. const _finder = _ros_msg_utils.Find;
  9. const _getByteLength = _ros_msg_utils.getByteLength;
  10. let geometry_msgs = _finder('geometry_msgs');
  11. //-----------------------------------------------------------
  12. //-----------------------------------------------------------
  13. class AddNewWaypointRequest {
  14. constructor(initObj={}) {
  15. if (initObj === null) {
  16. // initObj === null is a special case for deserialization where we don't initialize fields
  17. this.name = null;
  18. this.pose = null;
  19. }
  20. else {
  21. if (initObj.hasOwnProperty('name')) {
  22. this.name = initObj.name
  23. }
  24. else {
  25. this.name = '';
  26. }
  27. if (initObj.hasOwnProperty('pose')) {
  28. this.pose = initObj.pose
  29. }
  30. else {
  31. this.pose = new geometry_msgs.msg.Pose();
  32. }
  33. }
  34. }
  35. static serialize(obj, buffer, bufferOffset) {
  36. // Serializes a message object of type AddNewWaypointRequest
  37. // Serialize message field [name]
  38. bufferOffset = _serializer.string(obj.name, buffer, bufferOffset);
  39. // Serialize message field [pose]
  40. bufferOffset = geometry_msgs.msg.Pose.serialize(obj.pose, buffer, bufferOffset);
  41. return bufferOffset;
  42. }
  43. static deserialize(buffer, bufferOffset=[0]) {
  44. //deserializes a message object of type AddNewWaypointRequest
  45. let len;
  46. let data = new AddNewWaypointRequest(null);
  47. // Deserialize message field [name]
  48. data.name = _deserializer.string(buffer, bufferOffset);
  49. // Deserialize message field [pose]
  50. data.pose = geometry_msgs.msg.Pose.deserialize(buffer, bufferOffset);
  51. return data;
  52. }
  53. static getMessageSize(object) {
  54. let length = 0;
  55. length += _getByteLength(object.name);
  56. return length + 60;
  57. }
  58. static datatype() {
  59. // Returns string type for a service object
  60. return 'waterplus_map_tools/AddNewWaypointRequest';
  61. }
  62. static md5sum() {
  63. //Returns md5sum for a message object
  64. return '177d54286ddeee12eba514054bddffd5';
  65. }
  66. static messageDefinition() {
  67. // Returns full string definition for message
  68. return `
  69. string name
  70. geometry_msgs/Pose pose
  71. ================================================================================
  72. MSG: geometry_msgs/Pose
  73. # A representation of pose in free space, composed of position and orientation.
  74. Point position
  75. Quaternion orientation
  76. ================================================================================
  77. MSG: geometry_msgs/Point
  78. # This contains the position of a point in free space
  79. float64 x
  80. float64 y
  81. float64 z
  82. ================================================================================
  83. MSG: geometry_msgs/Quaternion
  84. # This represents an orientation in free space in quaternion form.
  85. float64 x
  86. float64 y
  87. float64 z
  88. float64 w
  89. `;
  90. }
  91. static Resolve(msg) {
  92. // deep-construct a valid message object instance of whatever was passed in
  93. if (typeof msg !== 'object' || msg === null) {
  94. msg = {};
  95. }
  96. const resolved = new AddNewWaypointRequest(null);
  97. if (msg.name !== undefined) {
  98. resolved.name = msg.name;
  99. }
  100. else {
  101. resolved.name = ''
  102. }
  103. if (msg.pose !== undefined) {
  104. resolved.pose = geometry_msgs.msg.Pose.Resolve(msg.pose)
  105. }
  106. else {
  107. resolved.pose = new geometry_msgs.msg.Pose()
  108. }
  109. return resolved;
  110. }
  111. };
  112. class AddNewWaypointResponse {
  113. constructor(initObj={}) {
  114. if (initObj === null) {
  115. // initObj === null is a special case for deserialization where we don't initialize fields
  116. this.result = null;
  117. }
  118. else {
  119. if (initObj.hasOwnProperty('result')) {
  120. this.result = initObj.result
  121. }
  122. else {
  123. this.result = false;
  124. }
  125. }
  126. }
  127. static serialize(obj, buffer, bufferOffset) {
  128. // Serializes a message object of type AddNewWaypointResponse
  129. // Serialize message field [result]
  130. bufferOffset = _serializer.bool(obj.result, buffer, bufferOffset);
  131. return bufferOffset;
  132. }
  133. static deserialize(buffer, bufferOffset=[0]) {
  134. //deserializes a message object of type AddNewWaypointResponse
  135. let len;
  136. let data = new AddNewWaypointResponse(null);
  137. // Deserialize message field [result]
  138. data.result = _deserializer.bool(buffer, bufferOffset);
  139. return data;
  140. }
  141. static getMessageSize(object) {
  142. return 1;
  143. }
  144. static datatype() {
  145. // Returns string type for a service object
  146. return 'waterplus_map_tools/AddNewWaypointResponse';
  147. }
  148. static md5sum() {
  149. //Returns md5sum for a message object
  150. return 'eb13ac1f1354ccecb7941ee8fa2192e8';
  151. }
  152. static messageDefinition() {
  153. // Returns full string definition for message
  154. return `
  155. bool result
  156. `;
  157. }
  158. static Resolve(msg) {
  159. // deep-construct a valid message object instance of whatever was passed in
  160. if (typeof msg !== 'object' || msg === null) {
  161. msg = {};
  162. }
  163. const resolved = new AddNewWaypointResponse(null);
  164. if (msg.result !== undefined) {
  165. resolved.result = msg.result;
  166. }
  167. else {
  168. resolved.result = false
  169. }
  170. return resolved;
  171. }
  172. };
  173. module.exports = {
  174. Request: AddNewWaypointRequest,
  175. Response: AddNewWaypointResponse,
  176. md5sum() { return '6948a8f076727d2b3b462b6ca2b31b5f'; },
  177. datatype() { return 'waterplus_map_tools/AddNewWaypoint'; }
  178. };