Преглед на файлове

measure proto add ground status

yct преди 2 години
родител
ревизия
bc3158a63a
променени са 4 файла, в които са добавени 159 реда и са изтрити 56 реда
  1. 107 56
      message/measure_message.pb.cc
  2. 34 0
      message/measure_message.pb.h
  3. 1 0
      message/measure_message.proto
  4. 17 0
      system/system_executor.cpp

+ 107 - 56
message/measure_message.pb.cc

@@ -394,6 +394,7 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::measure_info, wheelbase_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::measure_info, front_theta_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::measure_info, border_stuta_),
+  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::measure_info, ground_status_),
   0,
   1,
   2,
@@ -403,6 +404,7 @@ const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUT
   6,
   7,
   8,
+  9,
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Cloud_coordinate, _has_bits_),
   GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::message::Cloud_coordinate, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -461,11 +463,11 @@ static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROT
   { 43, 51, sizeof(::message::Ground_detect_request_msg)},
   { 54, 64, sizeof(::message::Ground_detect_response_msg)},
   { 69, 84, sizeof(::message::Ground_status_msg)},
-  { 94, 108, sizeof(::message::measure_info)},
-  { 117, 125, sizeof(::message::Cloud_coordinate)},
-  { 128, 134, sizeof(::message::Cloud_type)},
-  { 135, 145, sizeof(::message::Locate_sift_request_msg)},
-  { 150, 161, sizeof(::message::Locate_sift_response_msg)},
+  { 94, 109, sizeof(::message::measure_info)},
+  { 119, 127, sizeof(::message::Cloud_coordinate)},
+  { 130, 136, sizeof(::message::Cloud_type)},
+  { 137, 147, sizeof(::message::Locate_sift_request_msg)},
+  { 152, 163, sizeof(::message::Locate_sift_response_msg)},
 };
 
 static ::google::protobuf::Message const * const file_default_instances[] = {
@@ -543,53 +545,54 @@ void AddDescriptorsImpl() {
       "round_statu\022\025\n\rborder_status\030\010 \002(\005\022-\n\rer"
       "ror_manager\030\t \002(\0132\026.message.Error_manage"
       "r\022(\n\005cloud\030\n \003(\0132\031.message.Cloud_coordin"
-      "ate\"\242\001\n\014measure_info\022\n\n\002cx\030\001 \002(\002\022\n\n\002cy\030\002"
+      "ate\"\271\001\n\014measure_info\022\n\n\002cx\030\001 \002(\002\022\n\n\002cy\030\002"
       " \002(\002\022\r\n\005theta\030\003 \002(\002\022\016\n\006length\030\004 \002(\002\022\r\n\005w"
       "idth\030\005 \002(\002\022\016\n\006height\030\006 \002(\002\022\021\n\twheelbase\030"
       "\007 \002(\002\022\023\n\013front_theta\030\010 \002(\002\022\024\n\014border_stu"
-      "ta\030\t \002(\005\"3\n\020Cloud_coordinate\022\t\n\001x\030\001 \002(\002\022"
-      "\t\n\001y\030\002 \002(\002\022\t\n\001z\030\003 \002(\002\"\032\n\nCloud_type\022\014\n\004t"
-      "ype\030\001 \002(\005\"\304\001\n\027Locate_sift_request_msg\022%\n"
-      "\tbase_info\030\001 \002(\0132\022.message.Base_info\022\023\n\013"
-      "command_key\030\002 \002(\t\022%\n\tid_struct\030\003 \002(\0132\022.m"
-      "essage.Id_struct\022\020\n\010lidar_id\030\004 \002(\005\0224\n\021cl"
-      "oud_coordinates\030\005 \003(\0132\031.message.Cloud_co"
-      "ordinate\"\347\001\n\030Locate_sift_response_msg\022%\n"
-      "\tbase_info\030\001 \002(\0132\022.message.Base_info\022\023\n\013"
-      "command_key\030\002 \002(\t\022%\n\tid_struct\030\003 \002(\0132\022.m"
-      "essage.Id_struct\022\020\n\010lidar_id\030\004 \002(\005\022\'\n\ncl"
-      "oud_type\030\005 \003(\0132\023.message.Cloud_type\022-\n\re"
-      "rror_manager\030\006 \002(\0132\026.message.Error_manag"
-      "er*\237\001\n\024Laser_manager_status\022\030\n\024LASER_MAN"
-      "AGER_UNKNOW\020\000\022\027\n\023LASER_MANAGER_READY\020\001\022\035"
-      "\n\031LASER_MANAGER_ISSUED_TASK\020\002\022\034\n\030LASER_M"
-      "ANAGER_WAIT_REPLY\020\003\022\027\n\023LASER_MANAGER_FAU"
-      "LT\020\004*U\n\013Laser_statu\022\024\n\020LASER_DISCONNECT\020"
-      "\000\022\017\n\013LASER_READY\020\001\022\016\n\nLASER_BUSY\020\002\022\017\n\013LA"
-      "SER_FAULT\020\003*\261\001\n\025Locate_manager_status\022\031\n"
-      "\025LOCATE_MANAGER_UNKNOW\020\000\022\030\n\024LOCATE_MANAG"
-      "ER_READY\020\001\022\027\n\023LOCATE_MANAGER_SIFT\020\002\022\026\n\022L"
-      "OCATE_MANAGER_CAR\020\003\022\030\n\024LOCATE_MANAGER_WH"
-      "EEL\020\004\022\030\n\024LOCATE_MANAGER_FAULT\020\005*\367\001\n\024Wanj"
-      "i_manager_status\022\031\n\025WANJI_MANAGER_UNKNOW"
-      "N\020\000\022\027\n\023WANJI_MANAGER_READY\020\001\022\026\n\022WANJI_MA"
-      "NAGER_BUSY\020\002\022\035\n\031WANJI_MANAGER_ISSUED_SCA"
-      "N\020\003\022\033\n\027WANJI_MANAGER_WAIT_SCAN\020\004\022\037\n\033WANJ"
-      "I_MANAGER_ISSUED_DETECT\020\005\022\035\n\031WANJI_MANAG"
-      "ER_WAIT_DETECT\020\006\022\027\n\023WANJI_MANAGER_FAULT\020"
-      "\n*\267\001\n\031Wanji_lidar_device_status\022\036\n\032WANJI"
-      "_LIDAR_DEVICE_UNKNOWN\020\000\022\034\n\030WANJI_LIDAR_D"
-      "EVICE_READY\020\001\022!\n\035WANJI_LIDAR_DEVICE_DISC"
-      "ONNECT\020\002\022\033\n\027WANJI_LIDAR_DEVICE_BUSY\020\003\022\034\n"
-      "\030WANJI_LIDAR_DEVICE_FAULT\020\n*{\n\024Region_wo"
-      "rker_status\022\031\n\025REGION_WORKER_UNKNOWN\020\000\022\027"
-      "\n\023REGION_WORKER_READY\020\001\022\026\n\022REGION_WORKER"
-      "_BUSY\020\002\022\027\n\023REGION_WORKER_FAULT\020\n*O\n\014Grou"
-      "nd_statu\022\013\n\007Nothing\020\000\022\t\n\005Noise\020\001\022\017\n\013Car_"
-      "correct\020\002\022\026\n\022Car_border_reached\020\003"
+      "ta\030\t \002(\005\022\025\n\rground_status\030\n \002(\005\"3\n\020Cloud"
+      "_coordinate\022\t\n\001x\030\001 \002(\002\022\t\n\001y\030\002 \002(\002\022\t\n\001z\030\003"
+      " \002(\002\"\032\n\nCloud_type\022\014\n\004type\030\001 \002(\005\"\304\001\n\027Loc"
+      "ate_sift_request_msg\022%\n\tbase_info\030\001 \002(\0132"
+      "\022.message.Base_info\022\023\n\013command_key\030\002 \002(\t"
+      "\022%\n\tid_struct\030\003 \002(\0132\022.message.Id_struct\022"
+      "\020\n\010lidar_id\030\004 \002(\005\0224\n\021cloud_coordinates\030\005"
+      " \003(\0132\031.message.Cloud_coordinate\"\347\001\n\030Loca"
+      "te_sift_response_msg\022%\n\tbase_info\030\001 \002(\0132"
+      "\022.message.Base_info\022\023\n\013command_key\030\002 \002(\t"
+      "\022%\n\tid_struct\030\003 \002(\0132\022.message.Id_struct\022"
+      "\020\n\010lidar_id\030\004 \002(\005\022\'\n\ncloud_type\030\005 \003(\0132\023."
+      "message.Cloud_type\022-\n\rerror_manager\030\006 \002("
+      "\0132\026.message.Error_manager*\237\001\n\024Laser_mana"
+      "ger_status\022\030\n\024LASER_MANAGER_UNKNOW\020\000\022\027\n\023"
+      "LASER_MANAGER_READY\020\001\022\035\n\031LASER_MANAGER_I"
+      "SSUED_TASK\020\002\022\034\n\030LASER_MANAGER_WAIT_REPLY"
+      "\020\003\022\027\n\023LASER_MANAGER_FAULT\020\004*U\n\013Laser_sta"
+      "tu\022\024\n\020LASER_DISCONNECT\020\000\022\017\n\013LASER_READY\020"
+      "\001\022\016\n\nLASER_BUSY\020\002\022\017\n\013LASER_FAULT\020\003*\261\001\n\025L"
+      "ocate_manager_status\022\031\n\025LOCATE_MANAGER_U"
+      "NKNOW\020\000\022\030\n\024LOCATE_MANAGER_READY\020\001\022\027\n\023LOC"
+      "ATE_MANAGER_SIFT\020\002\022\026\n\022LOCATE_MANAGER_CAR"
+      "\020\003\022\030\n\024LOCATE_MANAGER_WHEEL\020\004\022\030\n\024LOCATE_M"
+      "ANAGER_FAULT\020\005*\367\001\n\024Wanji_manager_status\022"
+      "\031\n\025WANJI_MANAGER_UNKNOWN\020\000\022\027\n\023WANJI_MANA"
+      "GER_READY\020\001\022\026\n\022WANJI_MANAGER_BUSY\020\002\022\035\n\031W"
+      "ANJI_MANAGER_ISSUED_SCAN\020\003\022\033\n\027WANJI_MANA"
+      "GER_WAIT_SCAN\020\004\022\037\n\033WANJI_MANAGER_ISSUED_"
+      "DETECT\020\005\022\035\n\031WANJI_MANAGER_WAIT_DETECT\020\006\022"
+      "\027\n\023WANJI_MANAGER_FAULT\020\n*\267\001\n\031Wanji_lidar"
+      "_device_status\022\036\n\032WANJI_LIDAR_DEVICE_UNK"
+      "NOWN\020\000\022\034\n\030WANJI_LIDAR_DEVICE_READY\020\001\022!\n\035"
+      "WANJI_LIDAR_DEVICE_DISCONNECT\020\002\022\033\n\027WANJI"
+      "_LIDAR_DEVICE_BUSY\020\003\022\034\n\030WANJI_LIDAR_DEVI"
+      "CE_FAULT\020\n*{\n\024Region_worker_status\022\031\n\025RE"
+      "GION_WORKER_UNKNOWN\020\000\022\027\n\023REGION_WORKER_R"
+      "EADY\020\001\022\026\n\022REGION_WORKER_BUSY\020\002\022\027\n\023REGION"
+      "_WORKER_FAULT\020\n*O\n\014Ground_statu\022\013\n\007Nothi"
+      "ng\020\000\022\t\n\005Noise\020\001\022\017\n\013Car_correct\020\002\022\026\n\022Car_"
+      "border_reached\020\003"
   };
   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
-      descriptor, 3353);
+      descriptor, 3376);
   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
     "measure_message.proto", &protobuf_RegisterTypes);
   ::protobuf_message_5fbase_2eproto::AddDescriptors();
@@ -3826,6 +3829,7 @@ const int measure_info::kHeightFieldNumber;
 const int measure_info::kWheelbaseFieldNumber;
 const int measure_info::kFrontThetaFieldNumber;
 const int measure_info::kBorderStutaFieldNumber;
+const int measure_info::kGroundStatusFieldNumber;
 #endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
 
 measure_info::measure_info()
@@ -3841,15 +3845,15 @@ measure_info::measure_info(const measure_info& from)
       _has_bits_(from._has_bits_) {
   _internal_metadata_.MergeFrom(from._internal_metadata_);
   ::memcpy(&cx_, &from.cx_,
-    static_cast<size_t>(reinterpret_cast<char*>(&border_stuta_) -
-    reinterpret_cast<char*>(&cx_)) + sizeof(border_stuta_));
+    static_cast<size_t>(reinterpret_cast<char*>(&ground_status_) -
+    reinterpret_cast<char*>(&cx_)) + sizeof(ground_status_));
   // @@protoc_insertion_point(copy_constructor:message.measure_info)
 }
 
 void measure_info::SharedCtor() {
   ::memset(&cx_, 0, static_cast<size_t>(
-      reinterpret_cast<char*>(&border_stuta_) -
-      reinterpret_cast<char*>(&cx_)) + sizeof(border_stuta_));
+      reinterpret_cast<char*>(&ground_status_) -
+      reinterpret_cast<char*>(&cx_)) + sizeof(ground_status_));
 }
 
 measure_info::~measure_info() {
@@ -3886,7 +3890,11 @@ void measure_info::Clear() {
         reinterpret_cast<char*>(&front_theta_) -
         reinterpret_cast<char*>(&cx_)) + sizeof(front_theta_));
   }
-  border_stuta_ = 0;
+  if (cached_has_bits & 768u) {
+    ::memset(&border_stuta_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&ground_status_) -
+        reinterpret_cast<char*>(&border_stuta_)) + sizeof(ground_status_));
+  }
   _has_bits_.Clear();
   _internal_metadata_.Clear();
 }
@@ -4027,6 +4035,20 @@ bool measure_info::MergePartialFromCodedStream(
         break;
       }
 
+      // required int32 ground_status = 10;
+      case 10: {
+        if (static_cast< ::google::protobuf::uint8>(tag) ==
+            static_cast< ::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
+          set_has_ground_status();
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &ground_status_)));
+        } else {
+          goto handle_unusual;
+        }
+        break;
+      }
+
       default: {
       handle_unusual:
         if (tag == 0) {
@@ -4099,6 +4121,11 @@ void measure_info::SerializeWithCachedSizes(
     ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->border_stuta(), output);
   }
 
+  // required int32 ground_status = 10;
+  if (cached_has_bits & 0x00000200u) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(10, this->ground_status(), output);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
         _internal_metadata_.unknown_fields(), output);
@@ -4159,6 +4186,11 @@ void measure_info::SerializeWithCachedSizes(
     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->border_stuta(), target);
   }
 
+  // required int32 ground_status = 10;
+  if (cached_has_bits & 0x00000200u) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(10, this->ground_status(), target);
+  }
+
   if (_internal_metadata_.have_unknown_fields()) {
     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields(), target);
@@ -4218,6 +4250,13 @@ size_t measure_info::RequiredFieldsByteSizeFallback() const {
         this->border_stuta());
   }
 
+  if (has_ground_status()) {
+    // required int32 ground_status = 10;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::Int32Size(
+        this->ground_status());
+  }
+
   return total_size;
 }
 size_t measure_info::ByteSizeLong() const {
@@ -4229,7 +4268,7 @@ size_t measure_info::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         _internal_metadata_.unknown_fields());
   }
-  if (((_has_bits_[0] & 0x000001ff) ^ 0x000001ff) == 0) {  // All required fields are present.
+  if (((_has_bits_[0] & 0x000003ff) ^ 0x000003ff) == 0) {  // All required fields are present.
     // required float cx = 1;
     total_size += 1 + 4;
 
@@ -4259,6 +4298,11 @@ size_t measure_info::ByteSizeLong() const {
       ::google::protobuf::internal::WireFormatLite::Int32Size(
         this->border_stuta());
 
+    // required int32 ground_status = 10;
+    total_size += 1 +
+      ::google::protobuf::internal::WireFormatLite::Int32Size(
+        this->ground_status());
+
   } else {
     total_size += RequiredFieldsByteSizeFallback();
   }
@@ -4317,8 +4361,14 @@ void measure_info::MergeFrom(const measure_info& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
-  if (cached_has_bits & 0x00000100u) {
-    set_border_stuta(from.border_stuta());
+  if (cached_has_bits & 768u) {
+    if (cached_has_bits & 0x00000100u) {
+      border_stuta_ = from.border_stuta_;
+    }
+    if (cached_has_bits & 0x00000200u) {
+      ground_status_ = from.ground_status_;
+    }
+    _has_bits_[0] |= cached_has_bits;
   }
 }
 
@@ -4337,7 +4387,7 @@ void measure_info::CopyFrom(const measure_info& from) {
 }
 
 bool measure_info::IsInitialized() const {
-  if ((_has_bits_[0] & 0x000001ff) != 0x000001ff) return false;
+  if ((_has_bits_[0] & 0x000003ff) != 0x000003ff) return false;
   return true;
 }
 
@@ -4356,6 +4406,7 @@ void measure_info::InternalSwap(measure_info* other) {
   swap(wheelbase_, other->wheelbase_);
   swap(front_theta_, other->front_theta_);
   swap(border_stuta_, other->border_stuta_);
+  swap(ground_status_, other->ground_status_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   _internal_metadata_.Swap(&other->_internal_metadata_);
 }

+ 34 - 0
message/measure_message.pb.h

@@ -1507,6 +1507,13 @@ class measure_info : public ::google::protobuf::Message /* @@protoc_insertion_po
   ::google::protobuf::int32 border_stuta() const;
   void set_border_stuta(::google::protobuf::int32 value);
 
+  // required int32 ground_status = 10;
+  bool has_ground_status() const;
+  void clear_ground_status();
+  static const int kGroundStatusFieldNumber = 10;
+  ::google::protobuf::int32 ground_status() const;
+  void set_ground_status(::google::protobuf::int32 value);
+
   // @@protoc_insertion_point(class_scope:message.measure_info)
  private:
   void set_has_cx();
@@ -1527,6 +1534,8 @@ class measure_info : public ::google::protobuf::Message /* @@protoc_insertion_po
   void clear_has_front_theta();
   void set_has_border_stuta();
   void clear_has_border_stuta();
+  void set_has_ground_status();
+  void clear_has_ground_status();
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
@@ -1543,6 +1552,7 @@ class measure_info : public ::google::protobuf::Message /* @@protoc_insertion_po
   float wheelbase_;
   float front_theta_;
   ::google::protobuf::int32 border_stuta_;
+  ::google::protobuf::int32 ground_status_;
   friend struct ::protobuf_measure_5fmessage_2eproto::TableStruct;
 };
 // -------------------------------------------------------------------
@@ -3951,6 +3961,30 @@ inline void measure_info::set_border_stuta(::google::protobuf::int32 value) {
   // @@protoc_insertion_point(field_set:message.measure_info.border_stuta)
 }
 
+// required int32 ground_status = 10;
+inline bool measure_info::has_ground_status() const {
+  return (_has_bits_[0] & 0x00000200u) != 0;
+}
+inline void measure_info::set_has_ground_status() {
+  _has_bits_[0] |= 0x00000200u;
+}
+inline void measure_info::clear_has_ground_status() {
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline void measure_info::clear_ground_status() {
+  ground_status_ = 0;
+  clear_has_ground_status();
+}
+inline ::google::protobuf::int32 measure_info::ground_status() const {
+  // @@protoc_insertion_point(field_get:message.measure_info.ground_status)
+  return ground_status_;
+}
+inline void measure_info::set_ground_status(::google::protobuf::int32 value) {
+  set_has_ground_status();
+  ground_status_ = value;
+  // @@protoc_insertion_point(field_set:message.measure_info.ground_status)
+}
+
 // -------------------------------------------------------------------
 
 // Cloud_coordinate

+ 1 - 0
message/measure_message.proto

@@ -162,6 +162,7 @@ message measure_info {
   required float wheelbase=7;
   required float front_theta=8;
   required int32 border_stuta=9;
+  required int32 ground_status=10; // 电子围栏状态, 0 ok, 1 nothing, 2 noise, 3 border
 }
 
 //点云坐标

+ 17 - 0
system/system_executor.cpp

@@ -635,6 +635,23 @@ Error_manager System_executor::encapsulate_send_mq_status()
 			t_multi_measure_info_msg.set_wheelbase(t_car_wheel_information.car_wheel_base);
 			t_multi_measure_info_msg.set_front_theta(t_car_wheel_information.car_front_theta);
 			t_multi_measure_info_msg.set_border_stuta(t_car_wheel_information.range_status);
+			
+			auto t_ground_status = t_multi_status_msg.ground_status();
+			if(t_ground_status == message::Ground_statu::Car_correct)
+			{
+				t_multi_measure_info_msg.set_ground_status(0);
+			}else if(t_ground_status == message::Ground_statu::Nothing)
+			{
+				t_multi_measure_info_msg.set_ground_status(1);
+			}else if(t_ground_status == message::Ground_statu::Noise)
+			{
+				t_multi_measure_info_msg.set_ground_status(2);
+			}
+			else if(t_ground_status == message::Ground_statu::Car_border_reached)
+			{
+				t_multi_measure_info_msg.set_ground_status(3);
+			}
+			
 			std::string t_msg = t_multi_measure_info_msg.DebugString();
 			System_communication_mq::get_instance_references().encapsulate_status_msg(t_msg, 0);
 		}