text: // Auto-generated. Do not edit!
  
  // (in-package vision_msgs.msg)
  
  
  "use strict";
  
  const _serializer = _ros_msg_utils.Serialize;
  const _arraySerializer = _serializer.Array;
  const _deserializer = _ros_msg_utils.Deserialize;
  const _arrayDeserializer = _deserializer.Array;
  const _finder = _ros_msg_utils.Find;
  const _getByteLength = _ros_msg_utils.getByteLength;
  let geometry_msgs = _finder('geometry_msgs');
  
  //-----------------------------------------------------------
  
  class BoundingBox2D {
    constructor(initObj={}) {
      if (initObj === null) {
        // initObj === null is a special case for deserialization where we don't initialize fields
        this.center = null;
        this.size_x = null;
        this.size_y = null;
      }
      else {
        if (initObj.hasOwnProperty('center')) {
          this.center = initObj.center
        }
        else {
          this.center = new geometry_msgs.msg.Pose2D();
        }
        if (initObj.hasOwnProperty('size_x')) {
          this.size_x = initObj.size_x
        }
        else {
          this.size_x = 0.0;
        }
        if (initObj.hasOwnProperty('size_y')) {
          this.size_y = initObj.size_y
        }
        else {
          this.size_y = 0.0;
        }
      }
    }
  
    static serialize(obj, buffer, bufferOffset) {
      // Serializes a message object of type BoundingBox2D
      // Serialize message field [center]
      bufferOffset = geometry_msgs.msg.Pose2D.serialize(obj.center, buffer, bufferOffset);
      // Serialize message field [size_x]
      bufferOffset = _serializer.float64(obj.size_x, buffer, bufferOffset);
      // Serialize message field [size_y]
      bufferOffset = _serializer.float64(obj.size_y, buffer, bufferOffset);
      return bufferOffset;
    }
  
    static deserialize(buffer, bufferOffset=[0]) {
      //deserializes a message object of type BoundingBox2D
      let len;
      let data = new BoundingBox2D(null);
      // Deserialize message field [center]
      data.center = geometry_msgs.msg.Pose2D.deserialize(buffer, bufferOffset);
      // Deserialize message field [size_x]
      data.size_x = _deserializer.float64(buffer, bufferOffset);
      // Deserialize message field [size_y]
      data.size_y = _deserializer.float64(buffer, bufferOffset);
      return data;
    }
  
    static getMessageSize(object) {
      return 40;
    }
  
    static datatype() {
      // Returns string type for a message object
      return 'vision_msgs/BoundingBox2D';
    }
  
    static md5sum() {
      //Returns md5sum for a message object
      return '9ab41e2a4c8627735e5091a9abd68b02';
    }
  
    static messageDefinition() {
      // Returns full string definition for message
      return `
      # A 2D bounding box that can be rotated about its center.
      # All dimensions are in pixels, but represented using floating-point
      #   values to allow sub-pixel precision. If an exact pixel crop is required
      #   for a rotated bounding box, it can be calculated using Bresenham's line
      #   algorithm.
      
      # The 2D position (in pixels) and orientation of the bounding box center.
      geometry_msgs/Pose2D center
      
      # The size (in pixels) of the bounding box surrounding the object relative
      #   to the pose of its center.
      float64 size_x
      float64 size_y
      
      ================================================================================
      MSG: geometry_msgs/Pose2D
      # Deprecated
      # Please use the full 3D pose.
      
      # In general our recommendation is to use a full 3D representation of everything and for 2D specific applications make the appropriate projections into the plane for their calculations but optimally will preserve the 3D information during processing.
      
      # If we have parallel copies of 2D datatypes every UI and other pipeline will end up needing to have dual interfaces to plot everything. And you will end up with not being able to use 3D tools for 2D use cases even if they're completely valid, as you'd have to reimplement it with different inputs and outputs. It's not particularly hard to plot the 2D pose or compute the yaw error for the Pose message and there are already tools and libraries that can do this for you.
      
      
      # This expresses a position and orientation on a 2D manifold.
      
      float64 x
      float64 y
      float64 theta
      
      `;
    }
  
    static Resolve(msg) {
      // deep-construct a valid message object instance of whatever was passed in
      if (typeof msg !== 'object' || msg === null) {
        msg = {};
      }
      const resolved = new BoundingBox2D(null);
      if (msg.center !== undefined) {
        resolved.center = geometry_msgs.msg.Pose2D.Resolve(msg.center)
      }
      else {
        resolved.center = new geometry_msgs.msg.Pose2D()
      }
  
      if (msg.size_x !== undefined) {
        resolved.size_x = msg.size_x;
      }
      else {
        resolved.size_x = 0.0
      }
  
      if (msg.size_y !== undefined) {
        resolved.size_y = msg.size_y;
      }
      else {
        resolved.size_y = 0.0
      }
  
      return resolved;
      }
  };
  
  module.exports = BoundingBox2D;
  