Browse Source

增加旋转矩形角点碰撞轨道的判断

zx 5 years ago
parent
commit
48afc414c3
4 changed files with 409 additions and 220 deletions
  1. 58 18
      verify/Verify_result.cpp
  2. 170 91
      verify/hardware_limit.pb.cc
  3. 173 105
      verify/hardware_limit.pb.h
  4. 8 6
      verify/hardware_limit.proto

+ 58 - 18
verify/Verify_result.cpp

@@ -55,33 +55,53 @@ Verify_result::Verify_result(Hardware_limit::Hardware_parameter parameter)
  */
 Error_manager Verify_result::verify(cv::RotatedRect rotate_rect,float height,bool verify_vertex)
 {
+    //-2300   3450
+    cv::Point2f t_corners[4];
+    rotate_rect.points(t_corners);
+
     //第一步,检验边界
-    float minx=m_hardware_parameter.min_x();
-    float maxx=m_hardware_parameter.max_x();
-    float miny=m_hardware_parameter.min_y();
-    float maxy=m_hardware_parameter.max_y();
+    float corner_min_y=m_hardware_parameter.corner_min_y();
+    float corner_max_y=m_hardware_parameter.corner_max_y();
+    float center_minx=m_hardware_parameter.center_min_x();
+    float center_maxx=m_hardware_parameter.center_max_x();
+    float center_miny=m_hardware_parameter.center_min_y();
+    float center_maxy=m_hardware_parameter.center_max_y();
     float center_x=rotate_rect.center.x;
     float center_y=rotate_rect.center.y;
     //左超界
-    if(center_x<minx)
+    if(center_x<center_minx)
     {
         return Error_manager(HARDWARE_LIMIT_CENTER_X_LEFT,NORMAL,"left limit");
     }
     //右超界
-    if(center_x>maxx)
+    if(center_x>center_maxx)
     {
         return Error_manager(HARDWARE_LIMIT_CENTER_X_RIGHT,NORMAL,"right limit");
     }
-    //超界
-    if(center_y>maxy)
+    //超界
+    if(center_y>center_maxy)
     {
         return Error_manager(HARDWARE_LIMIT_CENTER_Y_TOP,NORMAL,"top limit");
     }
-    //下超界
-    if(center_y>maxy)
+    for(int i=0;i<4;++i)
+    {
+        if(t_corners[i].y>corner_max_y)
+        {
+            return Error_manager(HARDWARE_LIMIT_CENTER_Y_TOP,NORMAL,"corner top limit");
+        }
+    }
+    //后超界
+    if(center_y<center_miny)
     {
         return Error_manager(HARDWARE_LIMIT_CENTER_Y_BOTTOM,NORMAL,"bottom limit");
     }
+    for(int i=0;i<4;++i)
+    {
+        if(t_corners[i].y<corner_min_y)
+        {
+            return Error_manager(HARDWARE_LIMIT_CENTER_Y_BOTTOM,NORMAL,"corner bottom limit");
+        }
+    }
     //第二步,检验高度
     if(height>m_hardware_parameter.height())
     {
@@ -168,25 +188,45 @@ Error_manager Verify_result::verify(cv::RotatedRect rotate_rect,int terminal_id,
 {
     display(rotate_rect,cv::Scalar(0,255,0));
 
+    cv::Point2f t_corners[4];
+    rotate_rect.points(t_corners);
     code=0x000000;
     //第一步,检验边界
-    float minx=m_hardware_parameter.min_x();
-    float maxx=m_hardware_parameter.max_x();
-    float miny=m_hardware_parameter.min_y();
-    float maxy=m_hardware_parameter.max_y();
+    float corner_min_y=m_hardware_parameter.corner_min_y();
+    float corner_max_y=m_hardware_parameter.corner_max_y();
+    float center_minx=m_hardware_parameter.center_min_x();
+    float center_maxx=m_hardware_parameter.center_max_x();
+    float center_miny=m_hardware_parameter.center_min_y();
+    float center_maxy=m_hardware_parameter.center_max_y();
     float center_x=rotate_rect.center.x;
     float center_y=rotate_rect.center.y;
 
-    //超界
-    if(center_y<miny)
+    //超界
+    if(center_y<center_miny)
     {
         code|=LIMIT_BACK_ERROR;
     }
-    //后超界
-    if(center_y>maxy)
+    for(int i=0;i<4;++i)
+    {
+        if(t_corners[i].y>corner_max_y)
+        {
+            code|=LIMIT_BACK_ERROR;
+        }
+    }
+    //前超界
+    if(center_y>center_maxy)
     {
         code|=LIMIT_FRONT_ERROR;
     }
+    for(int i=0;i<4;++i)
+    {
+        if(t_corners[i].y>corner_max_y)
+        {
+            code|=LIMIT_FRONT_ERROR;
+        }
+    }
+
+
     ////第二步,根据id,检验左右栏杆
     int left_id=terminal_id;
     int right_id=terminal_id+1;

+ 170 - 91
verify/hardware_limit.pb.cc

@@ -133,10 +133,12 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   ~0u,  // no _oneof_case_
   ~0u,  // no _weak_field_map_
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, railing_parameter_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, min_y_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, max_y_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, min_x_),
-  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, max_x_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, center_min_y_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, center_max_y_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, center_min_x_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, center_max_x_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, corner_min_y_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, corner_max_y_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, theta_range_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::Hardware_limit::Hardware_parameter, height_),
   ~0u,
@@ -144,13 +146,15 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   1,
   2,
   3,
-  ~0u,
   4,
+  5,
+  ~0u,
+  6,
 };
 static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 9, sizeof(::Hardware_limit::Railing)},
   { 13, 20, sizeof(::Hardware_limit::Theta_range)},
-  { 22, 34, sizeof(::Hardware_limit::Hardware_parameter)},
+  { 22, 36, sizeof(::Hardware_limit::Hardware_parameter)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -185,15 +189,16 @@ void AddDescriptorsImpl() {
       "\n\007Railing\022\n\n\002pa\030\001 \002(\002\022\n\n\002pb\030\002 \002(\002\022\n\n\002pc\030"
       "\003 \002(\002\022\030\n\rrailing_width\030\004 \001(\002:\0010\"3\n\013Theta"
       "_range\022\021\n\tmin_theta\030\001 \002(\002\022\021\n\tmax_theta\030\002"
-      " \002(\002\"\306\001\n\022Hardware_parameter\0222\n\021railing_p"
+      " \002(\002\"\216\002\n\022Hardware_parameter\0222\n\021railing_p"
       "arameter\030\001 \003(\0132\027.Hardware_limit.Railing\022"
-      "\r\n\005min_y\030\002 \002(\002\022\r\n\005max_y\030\003 \002(\002\022\r\n\005min_x\030\004"
-      " \002(\002\022\r\n\005max_x\030\005 \002(\002\0220\n\013theta_range\030\006 \003(\013"
-      "2\033.Hardware_limit.Theta_range\022\016\n\006height\030"
-      "\007 \002(\002"
+      "\024\n\014center_min_y\030\002 \002(\002\022\024\n\014center_max_y\030\003 "
+      "\002(\002\022\024\n\014center_min_x\030\004 \002(\002\022\024\n\014center_max_"
+      "x\030\005 \002(\002\022\024\n\014corner_min_y\030\006 \002(\002\022\024\n\014corner_"
+      "max_y\030\007 \002(\002\0220\n\013theta_range\030\010 \003(\0132\033.Hardw"
+      "are_limit.Theta_range\022\016\n\006height\030\t \002(\002"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 365);
+      descriptor, 437);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "hardware_limit.proto", &protobuf_RegisterTypes);
 }
@@ -898,10 +903,12 @@ void Hardware_parameter::InitAsDefaultInstance() {
 }
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
 const int Hardware_parameter::kRailingParameterFieldNumber;
-const int Hardware_parameter::kMinYFieldNumber;
-const int Hardware_parameter::kMaxYFieldNumber;
-const int Hardware_parameter::kMinXFieldNumber;
-const int Hardware_parameter::kMaxXFieldNumber;
+const int Hardware_parameter::kCenterMinYFieldNumber;
+const int Hardware_parameter::kCenterMaxYFieldNumber;
+const int Hardware_parameter::kCenterMinXFieldNumber;
+const int Hardware_parameter::kCenterMaxXFieldNumber;
+const int Hardware_parameter::kCornerMinYFieldNumber;
+const int Hardware_parameter::kCornerMaxYFieldNumber;
 const int Hardware_parameter::kThetaRangeFieldNumber;
 const int Hardware_parameter::kHeightFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
@@ -922,17 +929,17 @@ Hardware_parameter::Hardware_parameter(const Hardware_parameter& from)
       railing_parameter_(from.railing_parameter_),
       theta_range_(from.theta_range_) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
-  ::memcpy(&min_y_, &from.min_y_,
+  ::memcpy(&center_min_y_, &from.center_min_y_,
     static_cast<size_t>(reinterpret_cast<char*>(&height_) -
-    reinterpret_cast<char*>(&min_y_)) + sizeof(height_));
+    reinterpret_cast<char*>(&center_min_y_)) + sizeof(height_));
   // @@protoc_insertion_point(copy_constructor:Hardware_limit.Hardware_parameter)
 }
 
 void Hardware_parameter::SharedCtor() {
   _cached_size_ = 0;
-  ::memset(&min_y_, 0, static_cast<size_t>(
+  ::memset(&center_min_y_, 0, static_cast<size_t>(
       reinterpret_cast<char*>(&height_) -
-      reinterpret_cast<char*>(&min_y_)) + sizeof(height_));
+      reinterpret_cast<char*>(&center_min_y_)) + sizeof(height_));
 }
 
 Hardware_parameter::~Hardware_parameter() {
@@ -975,10 +982,10 @@ void Hardware_parameter::Clear() {
   railing_parameter_.Clear();
   theta_range_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 31u) {
-    ::memset(&min_y_, 0, static_cast<size_t>(
+  if (cached_has_bits & 127u) {
+    ::memset(&center_min_y_, 0, static_cast<size_t>(
         reinterpret_cast<char*>(&height_) -
-        reinterpret_cast<char*>(&min_y_)) + sizeof(height_));
+        reinterpret_cast<char*>(&center_min_y_)) + sizeof(height_));
   }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
@@ -1005,77 +1012,105 @@ bool Hardware_parameter::MergePartialFromCodedStream(
         break;
       }
 
-      // required float min_y = 2;
+      // required float center_min_y = 2;
       case 2: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(21u /* 21 & 0xFF */)) {
-          set_has_min_y();
+          set_has_center_min_y();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &min_y_)));
+                 input, &center_min_y_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // required float max_y = 3;
+      // required float center_max_y = 3;
       case 3: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(29u /* 29 & 0xFF */)) {
-          set_has_max_y();
+          set_has_center_max_y();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &max_y_)));
+                 input, &center_max_y_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // required float min_x = 4;
+      // required float center_min_x = 4;
       case 4: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(37u /* 37 & 0xFF */)) {
-          set_has_min_x();
+          set_has_center_min_x();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &min_x_)));
+                 input, &center_min_x_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // required float max_x = 5;
+      // required float center_max_x = 5;
       case 5: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(45u /* 45 & 0xFF */)) {
-          set_has_max_x();
+          set_has_center_max_x();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
-                 input, &max_x_)));
+                 input, &center_max_x_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // repeated .Hardware_limit.Theta_range theta_range = 6;
+      // required float corner_min_y = 6;
       case 6: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
-            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
-          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_theta_range()));
+            static_cast< ::google::protobuf::uint8>(53u /* 53 & 0xFF */)) {
+          set_has_corner_min_y();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
+                 input, &corner_min_y_)));
         } else {
           goto handle_unusual;
         }
         break;
       }
 
-      // required float height = 7;
+      // required float corner_max_y = 7;
       case 7: {
         if (static_cast< ::google::protobuf::uint8>(tag) ==
             static_cast< ::google::protobuf::uint8>(61u /* 61 & 0xFF */)) {
+          set_has_corner_max_y();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
+                 input, &corner_max_y_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // repeated .Hardware_limit.Theta_range theta_range = 8;
+      case 8: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, add_theta_range()));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
+      // required float height = 9;
+      case 9: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(77u /* 77 & 0xFF */)) {
           set_has_height();
           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                    float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
@@ -1120,36 +1155,46 @@ void Hardware_parameter::SerializeWithCachedSizes(
   }
 
   cached_has_bits = _has_bits_[0];
-  // required float min_y = 2;
+  // required float center_min_y = 2;
   if (cached_has_bits & 0x00000001u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->min_y(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->center_min_y(), output);
   }
 
-  // required float max_y = 3;
+  // required float center_max_y = 3;
   if (cached_has_bits & 0x00000002u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->max_y(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->center_max_y(), output);
   }
 
-  // required float min_x = 4;
+  // required float center_min_x = 4;
   if (cached_has_bits & 0x00000004u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->min_x(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->center_min_x(), output);
   }
 
-  // required float max_x = 5;
+  // required float center_max_x = 5;
   if (cached_has_bits & 0x00000008u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->max_x(), output);
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->center_max_x(), output);
+  }
+
+  // required float corner_min_y = 6;
+  if (cached_has_bits & 0x00000010u) {
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->corner_min_y(), output);
+  }
+
+  // required float corner_max_y = 7;
+  if (cached_has_bits & 0x00000020u) {
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->corner_max_y(), output);
   }
 
-  // repeated .Hardware_limit.Theta_range theta_range = 6;
+  // repeated .Hardware_limit.Theta_range theta_range = 8;
   for (unsigned int i = 0,
       n = static_cast<unsigned int>(this->theta_range_size()); i < n; i++) {
     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
-      6, this->theta_range(static_cast<int>(i)), output);
+      8, this->theta_range(static_cast<int>(i)), output);
   }
 
-  // required float height = 7;
-  if (cached_has_bits & 0x00000010u) {
-    ::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->height(), output);
+  // required float height = 9;
+  if (cached_has_bits & 0x00000040u) {
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->height(), output);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -1175,37 +1220,47 @@ void Hardware_parameter::SerializeWithCachedSizes(
   }
 
   cached_has_bits = _has_bits_[0];
-  // required float min_y = 2;
+  // required float center_min_y = 2;
   if (cached_has_bits & 0x00000001u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->min_y(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->center_min_y(), target);
   }
 
-  // required float max_y = 3;
+  // required float center_max_y = 3;
   if (cached_has_bits & 0x00000002u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->max_y(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->center_max_y(), target);
   }
 
-  // required float min_x = 4;
+  // required float center_min_x = 4;
   if (cached_has_bits & 0x00000004u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->min_x(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->center_min_x(), target);
   }
 
-  // required float max_x = 5;
+  // required float center_max_x = 5;
   if (cached_has_bits & 0x00000008u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->max_x(), target);
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->center_max_x(), target);
+  }
+
+  // required float corner_min_y = 6;
+  if (cached_has_bits & 0x00000010u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->corner_min_y(), target);
+  }
+
+  // required float corner_max_y = 7;
+  if (cached_has_bits & 0x00000020u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->corner_max_y(), target);
   }
 
-  // repeated .Hardware_limit.Theta_range theta_range = 6;
+  // repeated .Hardware_limit.Theta_range theta_range = 8;
   for (unsigned int i = 0,
       n = static_cast<unsigned int>(this->theta_range_size()); i < n; i++) {
     target = ::google::protobuf::internal::WireFormatLite::
       InternalWriteMessageToArray(
-        6, this->theta_range(static_cast<int>(i)), deterministic, target);
+        8, this->theta_range(static_cast<int>(i)), deterministic, target);
   }
 
-  // required float height = 7;
-  if (cached_has_bits & 0x00000010u) {
-    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->height(), target);
+  // required float height = 9;
+  if (cached_has_bits & 0x00000040u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->height(), target);
   }
 
   if (_internal_metadata_.have_unknown_fields()) {
@@ -1220,28 +1275,38 @@ size_t Hardware_parameter::RequiredFieldsByteSizeFallback() const {
 // @@protoc_insertion_point(required_fields_byte_size_fallback_start:Hardware_limit.Hardware_parameter)
   size_t total_size = 0;
 
-  if (has_min_y()) {
-    // required float min_y = 2;
+  if (has_center_min_y()) {
+    // required float center_min_y = 2;
     total_size += 1 + 4;
   }
 
-  if (has_max_y()) {
-    // required float max_y = 3;
+  if (has_center_max_y()) {
+    // required float center_max_y = 3;
     total_size += 1 + 4;
   }
 
-  if (has_min_x()) {
-    // required float min_x = 4;
+  if (has_center_min_x()) {
+    // required float center_min_x = 4;
     total_size += 1 + 4;
   }
 
-  if (has_max_x()) {
-    // required float max_x = 5;
+  if (has_center_max_x()) {
+    // required float center_max_x = 5;
+    total_size += 1 + 4;
+  }
+
+  if (has_corner_min_y()) {
+    // required float corner_min_y = 6;
+    total_size += 1 + 4;
+  }
+
+  if (has_corner_max_y()) {
+    // required float corner_max_y = 7;
     total_size += 1 + 4;
   }
 
   if (has_height()) {
-    // required float height = 7;
+    // required float height = 9;
     total_size += 1 + 4;
   }
 
@@ -1256,20 +1321,26 @@ size_t Hardware_parameter::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  if (((_has_bits_[0] & 0x0000001f) ^ 0x0000001f) == 0) {  // All required fields are present.
-    // required float min_y = 2;
+  if (((_has_bits_[0] & 0x0000007f) ^ 0x0000007f) == 0) {  // All required fields are present.
+    // required float center_min_y = 2;
     total_size += 1 + 4;
 
-    // required float max_y = 3;
+    // required float center_max_y = 3;
     total_size += 1 + 4;
 
-    // required float min_x = 4;
+    // required float center_min_x = 4;
     total_size += 1 + 4;
 
-    // required float max_x = 5;
+    // required float center_max_x = 5;
     total_size += 1 + 4;
 
-    // required float height = 7;
+    // required float corner_min_y = 6;
+    total_size += 1 + 4;
+
+    // required float corner_max_y = 7;
+    total_size += 1 + 4;
+
+    // required float height = 9;
     total_size += 1 + 4;
 
   } else {
@@ -1286,7 +1357,7 @@ size_t Hardware_parameter::ByteSizeLong() const {
     }
   }
 
-  // repeated .Hardware_limit.Theta_range theta_range = 6;
+  // repeated .Hardware_limit.Theta_range theta_range = 8;
   {
     unsigned int count = static_cast<unsigned int>(this->theta_range_size());
     total_size += 1UL * count;
@@ -1329,20 +1400,26 @@ void Hardware_parameter::MergeFrom(const Hardware_parameter& from) {
   railing_parameter_.MergeFrom(from.railing_parameter_);
   theta_range_.MergeFrom(from.theta_range_);
   cached_has_bits = from._has_bits_[0];
-  if (cached_has_bits & 31u) {
+  if (cached_has_bits & 127u) {
     if (cached_has_bits & 0x00000001u) {
-      min_y_ = from.min_y_;
+      center_min_y_ = from.center_min_y_;
     }
     if (cached_has_bits & 0x00000002u) {
-      max_y_ = from.max_y_;
+      center_max_y_ = from.center_max_y_;
     }
     if (cached_has_bits & 0x00000004u) {
-      min_x_ = from.min_x_;
+      center_min_x_ = from.center_min_x_;
     }
     if (cached_has_bits & 0x00000008u) {
-      max_x_ = from.max_x_;
+      center_max_x_ = from.center_max_x_;
     }
     if (cached_has_bits & 0x00000010u) {
+      corner_min_y_ = from.corner_min_y_;
+    }
+    if (cached_has_bits & 0x00000020u) {
+      corner_max_y_ = from.corner_max_y_;
+    }
+    if (cached_has_bits & 0x00000040u) {
       height_ = from.height_;
     }
     _has_bits_[0] |= cached_has_bits;
@@ -1364,7 +1441,7 @@ void Hardware_parameter::CopyFrom(const Hardware_parameter& from) {
 }
 
 bool Hardware_parameter::IsInitialized() const {
-  if ((_has_bits_[0] & 0x0000001f) != 0x0000001f) return false;
+  if ((_has_bits_[0] & 0x0000007f) != 0x0000007f) return false;
   if (!::google::protobuf::internal::AllAreInitialized(this->railing_parameter())) return false;
   if (!::google::protobuf::internal::AllAreInitialized(this->theta_range())) return false;
   return true;
@@ -1378,10 +1455,12 @@ void Hardware_parameter::InternalSwap(Hardware_parameter* other) {
   using std::swap;
   railing_parameter_.InternalSwap(&other->railing_parameter_);
   theta_range_.InternalSwap(&other->theta_range_);
-  swap(min_y_, other->min_y_);
-  swap(max_y_, other->max_y_);
-  swap(min_x_, other->min_x_);
-  swap(max_x_, other->max_x_);
+  swap(center_min_y_, other->center_min_y_);
+  swap(center_max_y_, other->center_max_y_);
+  swap(center_min_x_, other->center_min_x_);
+  swap(center_max_x_, other->center_max_x_);
+  swap(corner_min_y_, other->corner_min_y_);
+  swap(corner_max_y_, other->corner_max_y_);
   swap(height_, other->height_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);

+ 173 - 105
verify/hardware_limit.pb.h

@@ -436,10 +436,10 @@ class Hardware_parameter : public ::google::protobuf::Message /* @@protoc_insert
   const ::google::protobuf::RepeatedPtrField< ::Hardware_limit::Railing >&
       railing_parameter() const;
 
-  // repeated .Hardware_limit.Theta_range theta_range = 6;
+  // repeated .Hardware_limit.Theta_range theta_range = 8;
   int theta_range_size() const;
   void clear_theta_range();
-  static const int kThetaRangeFieldNumber = 6;
+  static const int kThetaRangeFieldNumber = 8;
   const ::Hardware_limit::Theta_range& theta_range(int index) const;
   ::Hardware_limit::Theta_range* mutable_theta_range(int index);
   ::Hardware_limit::Theta_range* add_theta_range();
@@ -448,51 +448,69 @@ class Hardware_parameter : public ::google::protobuf::Message /* @@protoc_insert
   const ::google::protobuf::RepeatedPtrField< ::Hardware_limit::Theta_range >&
       theta_range() const;
 
-  // required float min_y = 2;
-  bool has_min_y() const;
-  void clear_min_y();
-  static const int kMinYFieldNumber = 2;
-  float min_y() const;
-  void set_min_y(float value);
-
-  // required float max_y = 3;
-  bool has_max_y() const;
-  void clear_max_y();
-  static const int kMaxYFieldNumber = 3;
-  float max_y() const;
-  void set_max_y(float value);
-
-  // required float min_x = 4;
-  bool has_min_x() const;
-  void clear_min_x();
-  static const int kMinXFieldNumber = 4;
-  float min_x() const;
-  void set_min_x(float value);
-
-  // required float max_x = 5;
-  bool has_max_x() const;
-  void clear_max_x();
-  static const int kMaxXFieldNumber = 5;
-  float max_x() const;
-  void set_max_x(float value);
-
-  // required float height = 7;
+  // required float center_min_y = 2;
+  bool has_center_min_y() const;
+  void clear_center_min_y();
+  static const int kCenterMinYFieldNumber = 2;
+  float center_min_y() const;
+  void set_center_min_y(float value);
+
+  // required float center_max_y = 3;
+  bool has_center_max_y() const;
+  void clear_center_max_y();
+  static const int kCenterMaxYFieldNumber = 3;
+  float center_max_y() const;
+  void set_center_max_y(float value);
+
+  // required float center_min_x = 4;
+  bool has_center_min_x() const;
+  void clear_center_min_x();
+  static const int kCenterMinXFieldNumber = 4;
+  float center_min_x() const;
+  void set_center_min_x(float value);
+
+  // required float center_max_x = 5;
+  bool has_center_max_x() const;
+  void clear_center_max_x();
+  static const int kCenterMaxXFieldNumber = 5;
+  float center_max_x() const;
+  void set_center_max_x(float value);
+
+  // required float corner_min_y = 6;
+  bool has_corner_min_y() const;
+  void clear_corner_min_y();
+  static const int kCornerMinYFieldNumber = 6;
+  float corner_min_y() const;
+  void set_corner_min_y(float value);
+
+  // required float corner_max_y = 7;
+  bool has_corner_max_y() const;
+  void clear_corner_max_y();
+  static const int kCornerMaxYFieldNumber = 7;
+  float corner_max_y() const;
+  void set_corner_max_y(float value);
+
+  // required float height = 9;
   bool has_height() const;
   void clear_height();
-  static const int kHeightFieldNumber = 7;
+  static const int kHeightFieldNumber = 9;
   float height() const;
   void set_height(float value);
 
   // @@protoc_insertion_point(class_scope:Hardware_limit.Hardware_parameter)
  private:
-  void set_has_min_y();
-  void clear_has_min_y();
-  void set_has_max_y();
-  void clear_has_max_y();
-  void set_has_min_x();
-  void clear_has_min_x();
-  void set_has_max_x();
-  void clear_has_max_x();
+  void set_has_center_min_y();
+  void clear_has_center_min_y();
+  void set_has_center_max_y();
+  void clear_has_center_max_y();
+  void set_has_center_min_x();
+  void clear_has_center_min_x();
+  void set_has_center_max_x();
+  void clear_has_center_max_x();
+  void set_has_corner_min_y();
+  void clear_has_corner_min_y();
+  void set_has_corner_max_y();
+  void clear_has_corner_max_y();
   void set_has_height();
   void clear_has_height();
 
@@ -504,10 +522,12 @@ class Hardware_parameter : public ::google::protobuf::Message /* @@protoc_insert
   mutable int _cached_size_;
   ::google::protobuf::RepeatedPtrField< ::Hardware_limit::Railing > railing_parameter_;
   ::google::protobuf::RepeatedPtrField< ::Hardware_limit::Theta_range > theta_range_;
-  float min_y_;
-  float max_y_;
-  float min_x_;
-  float max_x_;
+  float center_min_y_;
+  float center_max_y_;
+  float center_min_x_;
+  float center_max_x_;
+  float corner_min_y_;
+  float corner_max_y_;
   float height_;
   friend struct ::protobuf_hardware_5flimit_2eproto::TableStruct;
   friend void ::protobuf_hardware_5flimit_2eproto::InitDefaultsHardware_parameterImpl();
@@ -705,103 +725,151 @@ Hardware_parameter::railing_parameter() const {
   return railing_parameter_;
 }
 
-// required float min_y = 2;
-inline bool Hardware_parameter::has_min_y() const {
+// required float center_min_y = 2;
+inline bool Hardware_parameter::has_center_min_y() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
-inline void Hardware_parameter::set_has_min_y() {
+inline void Hardware_parameter::set_has_center_min_y() {
   _has_bits_[0] |= 0x00000001u;
 }
-inline void Hardware_parameter::clear_has_min_y() {
+inline void Hardware_parameter::clear_has_center_min_y() {
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void Hardware_parameter::clear_min_y() {
-  min_y_ = 0;
-  clear_has_min_y();
+inline void Hardware_parameter::clear_center_min_y() {
+  center_min_y_ = 0;
+  clear_has_center_min_y();
 }
-inline float Hardware_parameter::min_y() const {
-  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.min_y)
-  return min_y_;
+inline float Hardware_parameter::center_min_y() const {
+  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.center_min_y)
+  return center_min_y_;
 }
-inline void Hardware_parameter::set_min_y(float value) {
-  set_has_min_y();
-  min_y_ = value;
-  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.min_y)
+inline void Hardware_parameter::set_center_min_y(float value) {
+  set_has_center_min_y();
+  center_min_y_ = value;
+  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.center_min_y)
 }
 
-// required float max_y = 3;
-inline bool Hardware_parameter::has_max_y() const {
+// required float center_max_y = 3;
+inline bool Hardware_parameter::has_center_max_y() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
-inline void Hardware_parameter::set_has_max_y() {
+inline void Hardware_parameter::set_has_center_max_y() {
   _has_bits_[0] |= 0x00000002u;
 }
-inline void Hardware_parameter::clear_has_max_y() {
+inline void Hardware_parameter::clear_has_center_max_y() {
   _has_bits_[0] &= ~0x00000002u;
 }
-inline void Hardware_parameter::clear_max_y() {
-  max_y_ = 0;
-  clear_has_max_y();
+inline void Hardware_parameter::clear_center_max_y() {
+  center_max_y_ = 0;
+  clear_has_center_max_y();
 }
-inline float Hardware_parameter::max_y() const {
-  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.max_y)
-  return max_y_;
+inline float Hardware_parameter::center_max_y() const {
+  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.center_max_y)
+  return center_max_y_;
 }
-inline void Hardware_parameter::set_max_y(float value) {
-  set_has_max_y();
-  max_y_ = value;
-  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.max_y)
+inline void Hardware_parameter::set_center_max_y(float value) {
+  set_has_center_max_y();
+  center_max_y_ = value;
+  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.center_max_y)
 }
 
-// required float min_x = 4;
-inline bool Hardware_parameter::has_min_x() const {
+// required float center_min_x = 4;
+inline bool Hardware_parameter::has_center_min_x() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
-inline void Hardware_parameter::set_has_min_x() {
+inline void Hardware_parameter::set_has_center_min_x() {
   _has_bits_[0] |= 0x00000004u;
 }
-inline void Hardware_parameter::clear_has_min_x() {
+inline void Hardware_parameter::clear_has_center_min_x() {
   _has_bits_[0] &= ~0x00000004u;
 }
-inline void Hardware_parameter::clear_min_x() {
-  min_x_ = 0;
-  clear_has_min_x();
+inline void Hardware_parameter::clear_center_min_x() {
+  center_min_x_ = 0;
+  clear_has_center_min_x();
 }
-inline float Hardware_parameter::min_x() const {
-  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.min_x)
-  return min_x_;
+inline float Hardware_parameter::center_min_x() const {
+  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.center_min_x)
+  return center_min_x_;
 }
-inline void Hardware_parameter::set_min_x(float value) {
-  set_has_min_x();
-  min_x_ = value;
-  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.min_x)
+inline void Hardware_parameter::set_center_min_x(float value) {
+  set_has_center_min_x();
+  center_min_x_ = value;
+  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.center_min_x)
 }
 
-// required float max_x = 5;
-inline bool Hardware_parameter::has_max_x() const {
+// required float center_max_x = 5;
+inline bool Hardware_parameter::has_center_max_x() const {
   return (_has_bits_[0] & 0x00000008u) != 0;
 }
-inline void Hardware_parameter::set_has_max_x() {
+inline void Hardware_parameter::set_has_center_max_x() {
   _has_bits_[0] |= 0x00000008u;
 }
-inline void Hardware_parameter::clear_has_max_x() {
+inline void Hardware_parameter::clear_has_center_max_x() {
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void Hardware_parameter::clear_max_x() {
-  max_x_ = 0;
-  clear_has_max_x();
+inline void Hardware_parameter::clear_center_max_x() {
+  center_max_x_ = 0;
+  clear_has_center_max_x();
 }
-inline float Hardware_parameter::max_x() const {
-  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.max_x)
-  return max_x_;
+inline float Hardware_parameter::center_max_x() const {
+  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.center_max_x)
+  return center_max_x_;
 }
-inline void Hardware_parameter::set_max_x(float value) {
-  set_has_max_x();
-  max_x_ = value;
-  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.max_x)
+inline void Hardware_parameter::set_center_max_x(float value) {
+  set_has_center_max_x();
+  center_max_x_ = value;
+  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.center_max_x)
 }
 
-// repeated .Hardware_limit.Theta_range theta_range = 6;
+// required float corner_min_y = 6;
+inline bool Hardware_parameter::has_corner_min_y() const {
+  return (_has_bits_[0] & 0x00000010u) != 0;
+}
+inline void Hardware_parameter::set_has_corner_min_y() {
+  _has_bits_[0] |= 0x00000010u;
+}
+inline void Hardware_parameter::clear_has_corner_min_y() {
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline void Hardware_parameter::clear_corner_min_y() {
+  corner_min_y_ = 0;
+  clear_has_corner_min_y();
+}
+inline float Hardware_parameter::corner_min_y() const {
+  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.corner_min_y)
+  return corner_min_y_;
+}
+inline void Hardware_parameter::set_corner_min_y(float value) {
+  set_has_corner_min_y();
+  corner_min_y_ = value;
+  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.corner_min_y)
+}
+
+// required float corner_max_y = 7;
+inline bool Hardware_parameter::has_corner_max_y() const {
+  return (_has_bits_[0] & 0x00000020u) != 0;
+}
+inline void Hardware_parameter::set_has_corner_max_y() {
+  _has_bits_[0] |= 0x00000020u;
+}
+inline void Hardware_parameter::clear_has_corner_max_y() {
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline void Hardware_parameter::clear_corner_max_y() {
+  corner_max_y_ = 0;
+  clear_has_corner_max_y();
+}
+inline float Hardware_parameter::corner_max_y() const {
+  // @@protoc_insertion_point(field_get:Hardware_limit.Hardware_parameter.corner_max_y)
+  return corner_max_y_;
+}
+inline void Hardware_parameter::set_corner_max_y(float value) {
+  set_has_corner_max_y();
+  corner_max_y_ = value;
+  // @@protoc_insertion_point(field_set:Hardware_limit.Hardware_parameter.corner_max_y)
+}
+
+// repeated .Hardware_limit.Theta_range theta_range = 8;
 inline int Hardware_parameter::theta_range_size() const {
   return theta_range_.size();
 }
@@ -831,15 +899,15 @@ Hardware_parameter::theta_range() const {
   return theta_range_;
 }
 
-// required float height = 7;
+// required float height = 9;
 inline bool Hardware_parameter::has_height() const {
-  return (_has_bits_[0] & 0x00000010u) != 0;
+  return (_has_bits_[0] & 0x00000040u) != 0;
 }
 inline void Hardware_parameter::set_has_height() {
-  _has_bits_[0] |= 0x00000010u;
+  _has_bits_[0] |= 0x00000040u;
 }
 inline void Hardware_parameter::clear_has_height() {
-  _has_bits_[0] &= ~0x00000010u;
+  _has_bits_[0] &= ~0x00000040u;
 }
 inline void Hardware_parameter::clear_height() {
   height_ = 0;

+ 8 - 6
verify/hardware_limit.proto

@@ -19,10 +19,12 @@ message Theta_range
 message Hardware_parameter
 {
     repeated Railing railing_parameter=1;
-    required float min_y=2;
-    required float max_y=3;
-    required float min_x=4;
-    required float max_x=5;
-    repeated Theta_range theta_range=6;
-    required float height=7;
+    required float center_min_y=2;
+    required float center_max_y=3;
+    required float center_min_x=4;
+    required float center_max_x=5;
+    required float corner_min_y=6;
+    required float corner_max_y=7;
+    repeated Theta_range theta_range=8;
+    required float height=9;
 }