Przeglądaj źródła

增加测量状态消息发送

zx 4 lat temu
rodzic
commit
f8373f5877

+ 9 - 3
CMakeLists.txt

@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8.3)
-project(LidarMeasure)
+project(VLP16_measure)
 
 ## Compile as C++11, supported in ROS Kinetic and newer
 add_compile_options(-std=c++14)
@@ -17,8 +17,11 @@ set(CMAKE_CXX_FLAGS "-std=c++11 -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2")
 set(CMAKE_BUILD_TYPE "RELEASE")
 
 include_directories(
+        src
+        src/message
         src/tool
         src/error_code
+        src/communication
         /usr/local/include
         /usr/local/include/modbus
         /usr/local/include/snap7
@@ -29,12 +32,15 @@ include_directories(
 
 aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/tool TOOL_SRC )
 aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/error_code ERROR_SRC )
+aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/communication COMMUNICATION_SRC )
+aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/src/message MESSAGE_SRC )
 
 add_executable(vlp16_sample  src/vlp16_sample.cpp ${ERROR_SRC} ${TOOL_SRC}
-        src/vlp16.hpp src/ground_region.cpp
+        ${COMMUNICATION_SRC} ${MESSAGE_SRC}
+        src/vlp16.hpp src/ground_region.cpp src/publisher.cpp
         src/configure.pb.cc src/detect_wheel_ceres.cpp)
 target_link_libraries(vlp16_sample ${CERES_LIBRARIES} ${OpenCV_LIBS}
         ${GLOG_LIBRARIES} ${PCL_LIBRARIES} ${PROTOBUF_LIBRARIES}
-        /usr/local/lib/libgflags.a /)
+        /usr/local/lib/libgflags.a nnxx nanomsg)
 
 

+ 7 - 0
build/sys.prototxt

@@ -21,3 +21,10 @@ box
 	minz:-1
 	maxz:100
 }
+id:0
+
+communication_cfg
+{
+	ip:"192.168.2.179"
+	port:30005
+}

+ 2 - 0
proto.sh

@@ -1 +1,3 @@
 protoc -I=./src configure.proto --cpp_out=./src
+protoc -I=./src/message message_base.proto --cpp_out=./src/message
+protoc -I=./src/message ground_measure_msg.proto --cpp_out=./src/message

+ 618 - 0
src/communication/communication.pb.cc

@@ -0,0 +1,618 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: communication.proto
+
+#include "communication.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/reflection_ops.h>
+#include <google/protobuf/wire_format.h>
+// @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+extern PROTOBUF_INTERNAL_EXPORT_communication_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Communication_parameter_communication_2eproto;
+namespace Communication_proto {
+class Communication_parameterDefaultTypeInternal {
+ public:
+  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Communication_parameter> _instance;
+} _Communication_parameter_default_instance_;
+class Communication_parameter_allDefaultTypeInternal {
+ public:
+  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Communication_parameter_all> _instance;
+} _Communication_parameter_all_default_instance_;
+}  // namespace Communication_proto
+static void InitDefaultsscc_info_Communication_parameter_communication_2eproto() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  {
+    void* ptr = &::Communication_proto::_Communication_parameter_default_instance_;
+    new (ptr) ::Communication_proto::Communication_parameter();
+    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::Communication_proto::Communication_parameter::InitAsDefaultInstance();
+}
+
+::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Communication_parameter_communication_2eproto =
+    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Communication_parameter_communication_2eproto}, {}};
+
+static void InitDefaultsscc_info_Communication_parameter_all_communication_2eproto() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  {
+    void* ptr = &::Communication_proto::_Communication_parameter_all_default_instance_;
+    new (ptr) ::Communication_proto::Communication_parameter_all();
+    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::Communication_proto::Communication_parameter_all::InitAsDefaultInstance();
+}
+
+::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Communication_parameter_all_communication_2eproto =
+    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_Communication_parameter_all_communication_2eproto}, {
+      &scc_info_Communication_parameter_communication_2eproto.base,}};
+
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_communication_2eproto[2];
+static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_communication_2eproto = nullptr;
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_communication_2eproto = nullptr;
+
+const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_communication_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  PROTOBUF_FIELD_OFFSET(::Communication_proto::Communication_parameter, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::Communication_proto::Communication_parameter, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  PROTOBUF_FIELD_OFFSET(::Communication_proto::Communication_parameter, bind_string_),
+  PROTOBUF_FIELD_OFFSET(::Communication_proto::Communication_parameter, connect_string_vector_),
+  0,
+  ~0u,
+  PROTOBUF_FIELD_OFFSET(::Communication_proto::Communication_parameter_all, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::Communication_proto::Communication_parameter_all, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  PROTOBUF_FIELD_OFFSET(::Communication_proto::Communication_parameter_all, communication_parameters_),
+  0,
+};
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, 7, sizeof(::Communication_proto::Communication_parameter)},
+  { 9, 15, sizeof(::Communication_proto::Communication_parameter_all)},
+};
+
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::Communication_proto::_Communication_parameter_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::Communication_proto::_Communication_parameter_all_default_instance_),
+};
+
+const char descriptor_table_protodef_communication_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\023communication.proto\022\023Communication_pro"
+  "to\"M\n\027Communication_parameter\022\023\n\013bind_st"
+  "ring\030\001 \001(\t\022\035\n\025connect_string_vector\030\002 \003("
+  "\t\"m\n\033Communication_parameter_all\022N\n\030comm"
+  "unication_parameters\030\001 \001(\0132,.Communicati"
+  "on_proto.Communication_parameter"
+  ;
+static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_communication_2eproto_deps[1] = {
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_communication_2eproto_sccs[2] = {
+  &scc_info_Communication_parameter_communication_2eproto.base,
+  &scc_info_Communication_parameter_all_communication_2eproto.base,
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_communication_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_communication_2eproto = {
+  false, false, descriptor_table_protodef_communication_2eproto, "communication.proto", 232,
+  &descriptor_table_communication_2eproto_once, descriptor_table_communication_2eproto_sccs, descriptor_table_communication_2eproto_deps, 2, 0,
+  schemas, file_default_instances, TableStruct_communication_2eproto::offsets,
+  file_level_metadata_communication_2eproto, 2, file_level_enum_descriptors_communication_2eproto, file_level_service_descriptors_communication_2eproto,
+};
+
+// Force running AddDescriptors() at dynamic initialization time.
+static bool dynamic_init_dummy_communication_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_communication_2eproto)), true);
+namespace Communication_proto {
+
+// ===================================================================
+
+void Communication_parameter::InitAsDefaultInstance() {
+}
+class Communication_parameter::_Internal {
+ public:
+  using HasBits = decltype(std::declval<Communication_parameter>()._has_bits_);
+  static void set_has_bind_string(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+Communication_parameter::Communication_parameter(::PROTOBUF_NAMESPACE_ID::Arena* arena)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena),
+  connect_string_vector_(arena) {
+  SharedCtor();
+  RegisterArenaDtor(arena);
+  // @@protoc_insertion_point(arena_constructor:Communication_proto.Communication_parameter)
+}
+Communication_parameter::Communication_parameter(const Communication_parameter& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_),
+      connect_string_vector_(from.connect_string_vector_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  bind_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  if (from._internal_has_bind_string()) {
+    bind_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_bind_string(),
+      GetArena());
+  }
+  // @@protoc_insertion_point(copy_constructor:Communication_proto.Communication_parameter)
+}
+
+void Communication_parameter::SharedCtor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Communication_parameter_communication_2eproto.base);
+  bind_string_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+}
+
+Communication_parameter::~Communication_parameter() {
+  // @@protoc_insertion_point(destructor:Communication_proto.Communication_parameter)
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+void Communication_parameter::SharedDtor() {
+  GOOGLE_DCHECK(GetArena() == nullptr);
+  bind_string_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+}
+
+void Communication_parameter::ArenaDtor(void* object) {
+  Communication_parameter* _this = reinterpret_cast< Communication_parameter* >(object);
+  (void)_this;
+}
+void Communication_parameter::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void Communication_parameter::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
+const Communication_parameter& Communication_parameter::default_instance() {
+  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Communication_parameter_communication_2eproto.base);
+  return *internal_default_instance();
+}
+
+
+void Communication_parameter::Clear() {
+// @@protoc_insertion_point(message_clear_start:Communication_proto.Communication_parameter)
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  connect_string_vector_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    bind_string_.ClearNonDefaultToEmpty();
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* Communication_parameter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
+  while (!ctx->Done(&ptr)) {
+    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    CHK_(ptr);
+    switch (tag >> 3) {
+      // optional string bind_string = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+          auto str = _internal_mutable_bind_string();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "Communication_proto.Communication_parameter.bind_string");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      // repeated string connect_string_vector = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            auto str = _internal_add_connect_string_vector();
+            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            #ifndef NDEBUG
+            ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "Communication_proto.Communication_parameter.connect_string_vector");
+            #endif  // !NDEBUG
+            CHK_(ptr);
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
+        } else goto handle_unusual;
+        continue;
+      default: {
+      handle_unusual:
+        if ((tag & 7) == 4 || tag == 0) {
+          ctx->SetLastTag(tag);
+          goto success;
+        }
+        ptr = UnknownFieldParse(tag,
+            _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+            ptr, ctx);
+        CHK_(ptr != nullptr);
+        continue;
+      }
+    }  // switch
+  }  // while
+success:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto success;
+#undef CHK_
+}
+
+::PROTOBUF_NAMESPACE_ID::uint8* Communication_parameter::_InternalSerialize(
+    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:Communication_proto.Communication_parameter)
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // optional string bind_string = 1;
+  if (cached_has_bits & 0x00000001u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_bind_string().data(), static_cast<int>(this->_internal_bind_string().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "Communication_proto.Communication_parameter.bind_string");
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_bind_string(), target);
+  }
+
+  // repeated string connect_string_vector = 2;
+  for (int i = 0, n = this->_internal_connect_string_vector_size(); i < n; i++) {
+    const auto& s = this->_internal_connect_string_vector(i);
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      s.data(), static_cast<int>(s.length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "Communication_proto.Communication_parameter.connect_string_vector");
+    target = stream->WriteString(2, s, target);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:Communication_proto.Communication_parameter)
+  return target;
+}
+
+size_t Communication_parameter::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:Communication_proto.Communication_parameter)
+  size_t total_size = 0;
+
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // repeated string connect_string_vector = 2;
+  total_size += 1 *
+      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(connect_string_vector_.size());
+  for (int i = 0, n = connect_string_vector_.size(); i < n; i++) {
+    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+      connect_string_vector_.Get(i));
+  }
+
+  // optional string bind_string = 1;
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_bind_string());
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
+        _internal_metadata_, total_size, &_cached_size_);
+  }
+  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  SetCachedSize(cached_size);
+  return total_size;
+}
+
+void Communication_parameter::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:Communication_proto.Communication_parameter)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Communication_parameter* source =
+      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Communication_parameter>(
+          &from);
+  if (source == nullptr) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:Communication_proto.Communication_parameter)
+    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:Communication_proto.Communication_parameter)
+    MergeFrom(*source);
+  }
+}
+
+void Communication_parameter::MergeFrom(const Communication_parameter& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:Communication_proto.Communication_parameter)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  connect_string_vector_.MergeFrom(from.connect_string_vector_);
+  if (from._internal_has_bind_string()) {
+    _internal_set_bind_string(from._internal_bind_string());
+  }
+}
+
+void Communication_parameter::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:Communication_proto.Communication_parameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Communication_parameter::CopyFrom(const Communication_parameter& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:Communication_proto.Communication_parameter)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Communication_parameter::IsInitialized() const {
+  return true;
+}
+
+void Communication_parameter::InternalSwap(Communication_parameter* other) {
+  using std::swap;
+  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  connect_string_vector_.InternalSwap(&other->connect_string_vector_);
+  bind_string_.Swap(&other->bind_string_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata Communication_parameter::GetMetadata() const {
+  return GetMetadataStatic();
+}
+
+
+// ===================================================================
+
+void Communication_parameter_all::InitAsDefaultInstance() {
+  ::Communication_proto::_Communication_parameter_all_default_instance_._instance.get_mutable()->communication_parameters_ = const_cast< ::Communication_proto::Communication_parameter*>(
+      ::Communication_proto::Communication_parameter::internal_default_instance());
+}
+class Communication_parameter_all::_Internal {
+ public:
+  using HasBits = decltype(std::declval<Communication_parameter_all>()._has_bits_);
+  static const ::Communication_proto::Communication_parameter& communication_parameters(const Communication_parameter_all* msg);
+  static void set_has_communication_parameters(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+};
+
+const ::Communication_proto::Communication_parameter&
+Communication_parameter_all::_Internal::communication_parameters(const Communication_parameter_all* msg) {
+  return *msg->communication_parameters_;
+}
+Communication_parameter_all::Communication_parameter_all(::PROTOBUF_NAMESPACE_ID::Arena* arena)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
+  SharedCtor();
+  RegisterArenaDtor(arena);
+  // @@protoc_insertion_point(arena_constructor:Communication_proto.Communication_parameter_all)
+}
+Communication_parameter_all::Communication_parameter_all(const Communication_parameter_all& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_communication_parameters()) {
+    communication_parameters_ = new ::Communication_proto::Communication_parameter(*from.communication_parameters_);
+  } else {
+    communication_parameters_ = nullptr;
+  }
+  // @@protoc_insertion_point(copy_constructor:Communication_proto.Communication_parameter_all)
+}
+
+void Communication_parameter_all::SharedCtor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Communication_parameter_all_communication_2eproto.base);
+  communication_parameters_ = nullptr;
+}
+
+Communication_parameter_all::~Communication_parameter_all() {
+  // @@protoc_insertion_point(destructor:Communication_proto.Communication_parameter_all)
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+void Communication_parameter_all::SharedDtor() {
+  GOOGLE_DCHECK(GetArena() == nullptr);
+  if (this != internal_default_instance()) delete communication_parameters_;
+}
+
+void Communication_parameter_all::ArenaDtor(void* object) {
+  Communication_parameter_all* _this = reinterpret_cast< Communication_parameter_all* >(object);
+  (void)_this;
+}
+void Communication_parameter_all::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void Communication_parameter_all::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
+const Communication_parameter_all& Communication_parameter_all::default_instance() {
+  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Communication_parameter_all_communication_2eproto.base);
+  return *internal_default_instance();
+}
+
+
+void Communication_parameter_all::Clear() {
+// @@protoc_insertion_point(message_clear_start:Communication_proto.Communication_parameter_all)
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    GOOGLE_DCHECK(communication_parameters_ != nullptr);
+    communication_parameters_->Clear();
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* Communication_parameter_all::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
+  while (!ctx->Done(&ptr)) {
+    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    CHK_(ptr);
+    switch (tag >> 3) {
+      // optional .Communication_proto.Communication_parameter communication_parameters = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_communication_parameters(), ptr);
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      default: {
+      handle_unusual:
+        if ((tag & 7) == 4 || tag == 0) {
+          ctx->SetLastTag(tag);
+          goto success;
+        }
+        ptr = UnknownFieldParse(tag,
+            _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+            ptr, ctx);
+        CHK_(ptr != nullptr);
+        continue;
+      }
+    }  // switch
+  }  // while
+success:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto success;
+#undef CHK_
+}
+
+::PROTOBUF_NAMESPACE_ID::uint8* Communication_parameter_all::_InternalSerialize(
+    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:Communication_proto.Communication_parameter_all)
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // optional .Communication_proto.Communication_parameter communication_parameters = 1;
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::communication_parameters(this), target, stream);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:Communication_proto.Communication_parameter_all)
+  return target;
+}
+
+size_t Communication_parameter_all::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:Communication_proto.Communication_parameter_all)
+  size_t total_size = 0;
+
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // optional .Communication_proto.Communication_parameter communication_parameters = 1;
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *communication_parameters_);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
+        _internal_metadata_, total_size, &_cached_size_);
+  }
+  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  SetCachedSize(cached_size);
+  return total_size;
+}
+
+void Communication_parameter_all::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:Communication_proto.Communication_parameter_all)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Communication_parameter_all* source =
+      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Communication_parameter_all>(
+          &from);
+  if (source == nullptr) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:Communication_proto.Communication_parameter_all)
+    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:Communication_proto.Communication_parameter_all)
+    MergeFrom(*source);
+  }
+}
+
+void Communication_parameter_all::MergeFrom(const Communication_parameter_all& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:Communication_proto.Communication_parameter_all)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  if (from._internal_has_communication_parameters()) {
+    _internal_mutable_communication_parameters()->::Communication_proto::Communication_parameter::MergeFrom(from._internal_communication_parameters());
+  }
+}
+
+void Communication_parameter_all::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:Communication_proto.Communication_parameter_all)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Communication_parameter_all::CopyFrom(const Communication_parameter_all& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:Communication_proto.Communication_parameter_all)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Communication_parameter_all::IsInitialized() const {
+  return true;
+}
+
+void Communication_parameter_all::InternalSwap(Communication_parameter_all* other) {
+  using std::swap;
+  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  swap(communication_parameters_, other->communication_parameters_);
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata Communication_parameter_all::GetMetadata() const {
+  return GetMetadataStatic();
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+}  // namespace Communication_proto
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::Communication_proto::Communication_parameter* Arena::CreateMaybeMessage< ::Communication_proto::Communication_parameter >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::Communication_proto::Communication_parameter >(arena);
+}
+template<> PROTOBUF_NOINLINE ::Communication_proto::Communication_parameter_all* Arena::CreateMaybeMessage< ::Communication_proto::Communication_parameter_all >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::Communication_proto::Communication_parameter_all >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
+
+// @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>

+ 666 - 0
src/communication/communication.pb.h

@@ -0,0 +1,666 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: communication.proto
+
+#ifndef GOOGLE_PROTOBUF_INCLUDED_communication_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_communication_2eproto
+
+#include <limits>
+#include <string>
+
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3013000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers. Please update
+#error your headers.
+#endif
+#if 3013000 < PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers. Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/port_undef.inc>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/generated_message_table_driven.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/inlined_string_field.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
+#include <google/protobuf/extension_set.h>  // IWYU pragma: export
+#include <google/protobuf/unknown_field_set.h>
+// @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_communication_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
+
+// Internal implementation detail -- do not use these members.
+struct TableStruct_communication_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[2]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
+};
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_communication_2eproto;
+namespace Communication_proto {
+class Communication_parameter;
+class Communication_parameterDefaultTypeInternal;
+extern Communication_parameterDefaultTypeInternal _Communication_parameter_default_instance_;
+class Communication_parameter_all;
+class Communication_parameter_allDefaultTypeInternal;
+extern Communication_parameter_allDefaultTypeInternal _Communication_parameter_all_default_instance_;
+}  // namespace Communication_proto
+PROTOBUF_NAMESPACE_OPEN
+template<> ::Communication_proto::Communication_parameter* Arena::CreateMaybeMessage<::Communication_proto::Communication_parameter>(Arena*);
+template<> ::Communication_proto::Communication_parameter_all* Arena::CreateMaybeMessage<::Communication_proto::Communication_parameter_all>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
+namespace Communication_proto {
+
+// ===================================================================
+
+class Communication_parameter PROTOBUF_FINAL :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Communication_proto.Communication_parameter) */ {
+ public:
+  inline Communication_parameter() : Communication_parameter(nullptr) {}
+  virtual ~Communication_parameter();
+
+  Communication_parameter(const Communication_parameter& from);
+  Communication_parameter(Communication_parameter&& from) noexcept
+    : Communication_parameter() {
+    *this = ::std::move(from);
+  }
+
+  inline Communication_parameter& operator=(const Communication_parameter& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  inline Communication_parameter& operator=(Communication_parameter&& from) noexcept {
+    if (GetArena() == from.GetArena()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
+  }
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+  }
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return GetMetadataStatic().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return GetMetadataStatic().reflection;
+  }
+  static const Communication_parameter& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Communication_parameter* internal_default_instance() {
+    return reinterpret_cast<const Communication_parameter*>(
+               &_Communication_parameter_default_instance_);
+  }
+  static constexpr int kIndexInFileMessages =
+    0;
+
+  friend void swap(Communication_parameter& a, Communication_parameter& b) {
+    a.Swap(&b);
+  }
+  inline void Swap(Communication_parameter* other) {
+    if (other == this) return;
+    if (GetArena() == other->GetArena()) {
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(Communication_parameter* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    InternalSwap(other);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Communication_parameter* New() const final {
+    return CreateMaybeMessage<Communication_parameter>(nullptr);
+  }
+
+  Communication_parameter* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+    return CreateMaybeMessage<Communication_parameter>(arena);
+  }
+  void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+  void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+  void CopyFrom(const Communication_parameter& from);
+  void MergeFrom(const Communication_parameter& from);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
+      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
+  private:
+  inline void SharedCtor();
+  inline void SharedDtor();
+  void SetCachedSize(int size) const final;
+  void InternalSwap(Communication_parameter* other);
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "Communication_proto.Communication_parameter";
+  }
+  protected:
+  explicit Communication_parameter(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  public:
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
+  private:
+  static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
+    ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_communication_2eproto);
+    return ::descriptor_table_communication_2eproto.file_level_metadata[kIndexInFileMessages];
+  }
+
+  public:
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  enum : int {
+    kConnectStringVectorFieldNumber = 2,
+    kBindStringFieldNumber = 1,
+  };
+  // repeated string connect_string_vector = 2;
+  int connect_string_vector_size() const;
+  private:
+  int _internal_connect_string_vector_size() const;
+  public:
+  void clear_connect_string_vector();
+  const std::string& connect_string_vector(int index) const;
+  std::string* mutable_connect_string_vector(int index);
+  void set_connect_string_vector(int index, const std::string& value);
+  void set_connect_string_vector(int index, std::string&& value);
+  void set_connect_string_vector(int index, const char* value);
+  void set_connect_string_vector(int index, const char* value, size_t size);
+  std::string* add_connect_string_vector();
+  void add_connect_string_vector(const std::string& value);
+  void add_connect_string_vector(std::string&& value);
+  void add_connect_string_vector(const char* value);
+  void add_connect_string_vector(const char* value, size_t size);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& connect_string_vector() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_connect_string_vector();
+  private:
+  const std::string& _internal_connect_string_vector(int index) const;
+  std::string* _internal_add_connect_string_vector();
+  public:
+
+  // optional string bind_string = 1;
+  bool has_bind_string() const;
+  private:
+  bool _internal_has_bind_string() const;
+  public:
+  void clear_bind_string();
+  const std::string& bind_string() const;
+  void set_bind_string(const std::string& value);
+  void set_bind_string(std::string&& value);
+  void set_bind_string(const char* value);
+  void set_bind_string(const char* value, size_t size);
+  std::string* mutable_bind_string();
+  std::string* release_bind_string();
+  void set_allocated_bind_string(std::string* bind_string);
+  private:
+  const std::string& _internal_bind_string() const;
+  void _internal_set_bind_string(const std::string& value);
+  std::string* _internal_mutable_bind_string();
+  public:
+
+  // @@protoc_insertion_point(class_scope:Communication_proto.Communication_parameter)
+ private:
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> connect_string_vector_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr bind_string_;
+  friend struct ::TableStruct_communication_2eproto;
+};
+// -------------------------------------------------------------------
+
+class Communication_parameter_all PROTOBUF_FINAL :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:Communication_proto.Communication_parameter_all) */ {
+ public:
+  inline Communication_parameter_all() : Communication_parameter_all(nullptr) {}
+  virtual ~Communication_parameter_all();
+
+  Communication_parameter_all(const Communication_parameter_all& from);
+  Communication_parameter_all(Communication_parameter_all&& from) noexcept
+    : Communication_parameter_all() {
+    *this = ::std::move(from);
+  }
+
+  inline Communication_parameter_all& operator=(const Communication_parameter_all& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  inline Communication_parameter_all& operator=(Communication_parameter_all&& from) noexcept {
+    if (GetArena() == from.GetArena()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
+  }
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+  }
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return GetMetadataStatic().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return GetMetadataStatic().reflection;
+  }
+  static const Communication_parameter_all& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Communication_parameter_all* internal_default_instance() {
+    return reinterpret_cast<const Communication_parameter_all*>(
+               &_Communication_parameter_all_default_instance_);
+  }
+  static constexpr int kIndexInFileMessages =
+    1;
+
+  friend void swap(Communication_parameter_all& a, Communication_parameter_all& b) {
+    a.Swap(&b);
+  }
+  inline void Swap(Communication_parameter_all* other) {
+    if (other == this) return;
+    if (GetArena() == other->GetArena()) {
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(Communication_parameter_all* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    InternalSwap(other);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Communication_parameter_all* New() const final {
+    return CreateMaybeMessage<Communication_parameter_all>(nullptr);
+  }
+
+  Communication_parameter_all* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+    return CreateMaybeMessage<Communication_parameter_all>(arena);
+  }
+  void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+  void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+  void CopyFrom(const Communication_parameter_all& from);
+  void MergeFrom(const Communication_parameter_all& from);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
+      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
+  private:
+  inline void SharedCtor();
+  inline void SharedDtor();
+  void SetCachedSize(int size) const final;
+  void InternalSwap(Communication_parameter_all* other);
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "Communication_proto.Communication_parameter_all";
+  }
+  protected:
+  explicit Communication_parameter_all(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  public:
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
+  private:
+  static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
+    ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_communication_2eproto);
+    return ::descriptor_table_communication_2eproto.file_level_metadata[kIndexInFileMessages];
+  }
+
+  public:
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  enum : int {
+    kCommunicationParametersFieldNumber = 1,
+  };
+  // optional .Communication_proto.Communication_parameter communication_parameters = 1;
+  bool has_communication_parameters() const;
+  private:
+  bool _internal_has_communication_parameters() const;
+  public:
+  void clear_communication_parameters();
+  const ::Communication_proto::Communication_parameter& communication_parameters() const;
+  ::Communication_proto::Communication_parameter* release_communication_parameters();
+  ::Communication_proto::Communication_parameter* mutable_communication_parameters();
+  void set_allocated_communication_parameters(::Communication_proto::Communication_parameter* communication_parameters);
+  private:
+  const ::Communication_proto::Communication_parameter& _internal_communication_parameters() const;
+  ::Communication_proto::Communication_parameter* _internal_mutable_communication_parameters();
+  public:
+  void unsafe_arena_set_allocated_communication_parameters(
+      ::Communication_proto::Communication_parameter* communication_parameters);
+  ::Communication_proto::Communication_parameter* unsafe_arena_release_communication_parameters();
+
+  // @@protoc_insertion_point(class_scope:Communication_proto.Communication_parameter_all)
+ private:
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::Communication_proto::Communication_parameter* communication_parameters_;
+  friend struct ::TableStruct_communication_2eproto;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+#ifdef __GNUC__
+  #pragma GCC diagnostic push
+  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif  // __GNUC__
+// Communication_parameter
+
+// optional string bind_string = 1;
+inline bool Communication_parameter::_internal_has_bind_string() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
+}
+inline bool Communication_parameter::has_bind_string() const {
+  return _internal_has_bind_string();
+}
+inline void Communication_parameter::clear_bind_string() {
+  bind_string_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline const std::string& Communication_parameter::bind_string() const {
+  // @@protoc_insertion_point(field_get:Communication_proto.Communication_parameter.bind_string)
+  return _internal_bind_string();
+}
+inline void Communication_parameter::set_bind_string(const std::string& value) {
+  _internal_set_bind_string(value);
+  // @@protoc_insertion_point(field_set:Communication_proto.Communication_parameter.bind_string)
+}
+inline std::string* Communication_parameter::mutable_bind_string() {
+  // @@protoc_insertion_point(field_mutable:Communication_proto.Communication_parameter.bind_string)
+  return _internal_mutable_bind_string();
+}
+inline const std::string& Communication_parameter::_internal_bind_string() const {
+  return bind_string_.Get();
+}
+inline void Communication_parameter::_internal_set_bind_string(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  bind_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena());
+}
+inline void Communication_parameter::set_bind_string(std::string&& value) {
+  _has_bits_[0] |= 0x00000001u;
+  bind_string_.Set(
+    &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena());
+  // @@protoc_insertion_point(field_set_rvalue:Communication_proto.Communication_parameter.bind_string)
+}
+inline void Communication_parameter::set_bind_string(const char* value) {
+  GOOGLE_DCHECK(value != nullptr);
+  _has_bits_[0] |= 0x00000001u;
+  bind_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
+              GetArena());
+  // @@protoc_insertion_point(field_set_char:Communication_proto.Communication_parameter.bind_string)
+}
+inline void Communication_parameter::set_bind_string(const char* value,
+    size_t size) {
+  _has_bits_[0] |= 0x00000001u;
+  bind_string_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(
+      reinterpret_cast<const char*>(value), size), GetArena());
+  // @@protoc_insertion_point(field_set_pointer:Communication_proto.Communication_parameter.bind_string)
+}
+inline std::string* Communication_parameter::_internal_mutable_bind_string() {
+  _has_bits_[0] |= 0x00000001u;
+  return bind_string_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+}
+inline std::string* Communication_parameter::release_bind_string() {
+  // @@protoc_insertion_point(field_release:Communication_proto.Communication_parameter.bind_string)
+  if (!_internal_has_bind_string()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  return bind_string_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+}
+inline void Communication_parameter::set_allocated_bind_string(std::string* bind_string) {
+  if (bind_string != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  bind_string_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), bind_string,
+      GetArena());
+  // @@protoc_insertion_point(field_set_allocated:Communication_proto.Communication_parameter.bind_string)
+}
+
+// repeated string connect_string_vector = 2;
+inline int Communication_parameter::_internal_connect_string_vector_size() const {
+  return connect_string_vector_.size();
+}
+inline int Communication_parameter::connect_string_vector_size() const {
+  return _internal_connect_string_vector_size();
+}
+inline void Communication_parameter::clear_connect_string_vector() {
+  connect_string_vector_.Clear();
+}
+inline std::string* Communication_parameter::add_connect_string_vector() {
+  // @@protoc_insertion_point(field_add_mutable:Communication_proto.Communication_parameter.connect_string_vector)
+  return _internal_add_connect_string_vector();
+}
+inline const std::string& Communication_parameter::_internal_connect_string_vector(int index) const {
+  return connect_string_vector_.Get(index);
+}
+inline const std::string& Communication_parameter::connect_string_vector(int index) const {
+  // @@protoc_insertion_point(field_get:Communication_proto.Communication_parameter.connect_string_vector)
+  return _internal_connect_string_vector(index);
+}
+inline std::string* Communication_parameter::mutable_connect_string_vector(int index) {
+  // @@protoc_insertion_point(field_mutable:Communication_proto.Communication_parameter.connect_string_vector)
+  return connect_string_vector_.Mutable(index);
+}
+inline void Communication_parameter::set_connect_string_vector(int index, const std::string& value) {
+  // @@protoc_insertion_point(field_set:Communication_proto.Communication_parameter.connect_string_vector)
+  connect_string_vector_.Mutable(index)->assign(value);
+}
+inline void Communication_parameter::set_connect_string_vector(int index, std::string&& value) {
+  // @@protoc_insertion_point(field_set:Communication_proto.Communication_parameter.connect_string_vector)
+  connect_string_vector_.Mutable(index)->assign(std::move(value));
+}
+inline void Communication_parameter::set_connect_string_vector(int index, const char* value) {
+  GOOGLE_DCHECK(value != nullptr);
+  connect_string_vector_.Mutable(index)->assign(value);
+  // @@protoc_insertion_point(field_set_char:Communication_proto.Communication_parameter.connect_string_vector)
+}
+inline void Communication_parameter::set_connect_string_vector(int index, const char* value, size_t size) {
+  connect_string_vector_.Mutable(index)->assign(
+    reinterpret_cast<const char*>(value), size);
+  // @@protoc_insertion_point(field_set_pointer:Communication_proto.Communication_parameter.connect_string_vector)
+}
+inline std::string* Communication_parameter::_internal_add_connect_string_vector() {
+  return connect_string_vector_.Add();
+}
+inline void Communication_parameter::add_connect_string_vector(const std::string& value) {
+  connect_string_vector_.Add()->assign(value);
+  // @@protoc_insertion_point(field_add:Communication_proto.Communication_parameter.connect_string_vector)
+}
+inline void Communication_parameter::add_connect_string_vector(std::string&& value) {
+  connect_string_vector_.Add(std::move(value));
+  // @@protoc_insertion_point(field_add:Communication_proto.Communication_parameter.connect_string_vector)
+}
+inline void Communication_parameter::add_connect_string_vector(const char* value) {
+  GOOGLE_DCHECK(value != nullptr);
+  connect_string_vector_.Add()->assign(value);
+  // @@protoc_insertion_point(field_add_char:Communication_proto.Communication_parameter.connect_string_vector)
+}
+inline void Communication_parameter::add_connect_string_vector(const char* value, size_t size) {
+  connect_string_vector_.Add()->assign(reinterpret_cast<const char*>(value), size);
+  // @@protoc_insertion_point(field_add_pointer:Communication_proto.Communication_parameter.connect_string_vector)
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>&
+Communication_parameter::connect_string_vector() const {
+  // @@protoc_insertion_point(field_list:Communication_proto.Communication_parameter.connect_string_vector)
+  return connect_string_vector_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>*
+Communication_parameter::mutable_connect_string_vector() {
+  // @@protoc_insertion_point(field_mutable_list:Communication_proto.Communication_parameter.connect_string_vector)
+  return &connect_string_vector_;
+}
+
+// -------------------------------------------------------------------
+
+// Communication_parameter_all
+
+// optional .Communication_proto.Communication_parameter communication_parameters = 1;
+inline bool Communication_parameter_all::_internal_has_communication_parameters() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || communication_parameters_ != nullptr);
+  return value;
+}
+inline bool Communication_parameter_all::has_communication_parameters() const {
+  return _internal_has_communication_parameters();
+}
+inline void Communication_parameter_all::clear_communication_parameters() {
+  if (communication_parameters_ != nullptr) communication_parameters_->Clear();
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline const ::Communication_proto::Communication_parameter& Communication_parameter_all::_internal_communication_parameters() const {
+  const ::Communication_proto::Communication_parameter* p = communication_parameters_;
+  return p != nullptr ? *p : *reinterpret_cast<const ::Communication_proto::Communication_parameter*>(
+      &::Communication_proto::_Communication_parameter_default_instance_);
+}
+inline const ::Communication_proto::Communication_parameter& Communication_parameter_all::communication_parameters() const {
+  // @@protoc_insertion_point(field_get:Communication_proto.Communication_parameter_all.communication_parameters)
+  return _internal_communication_parameters();
+}
+inline void Communication_parameter_all::unsafe_arena_set_allocated_communication_parameters(
+    ::Communication_proto::Communication_parameter* communication_parameters) {
+  if (GetArena() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(communication_parameters_);
+  }
+  communication_parameters_ = communication_parameters;
+  if (communication_parameters) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:Communication_proto.Communication_parameter_all.communication_parameters)
+}
+inline ::Communication_proto::Communication_parameter* Communication_parameter_all::release_communication_parameters() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::Communication_proto::Communication_parameter* temp = communication_parameters_;
+  communication_parameters_ = nullptr;
+  if (GetArena() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+  return temp;
+}
+inline ::Communication_proto::Communication_parameter* Communication_parameter_all::unsafe_arena_release_communication_parameters() {
+  // @@protoc_insertion_point(field_release:Communication_proto.Communication_parameter_all.communication_parameters)
+  _has_bits_[0] &= ~0x00000001u;
+  ::Communication_proto::Communication_parameter* temp = communication_parameters_;
+  communication_parameters_ = nullptr;
+  return temp;
+}
+inline ::Communication_proto::Communication_parameter* Communication_parameter_all::_internal_mutable_communication_parameters() {
+  _has_bits_[0] |= 0x00000001u;
+  if (communication_parameters_ == nullptr) {
+    auto* p = CreateMaybeMessage<::Communication_proto::Communication_parameter>(GetArena());
+    communication_parameters_ = p;
+  }
+  return communication_parameters_;
+}
+inline ::Communication_proto::Communication_parameter* Communication_parameter_all::mutable_communication_parameters() {
+  // @@protoc_insertion_point(field_mutable:Communication_proto.Communication_parameter_all.communication_parameters)
+  return _internal_mutable_communication_parameters();
+}
+inline void Communication_parameter_all::set_allocated_communication_parameters(::Communication_proto::Communication_parameter* communication_parameters) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+  if (message_arena == nullptr) {
+    delete communication_parameters_;
+  }
+  if (communication_parameters) {
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+      ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(communication_parameters);
+    if (message_arena != submessage_arena) {
+      communication_parameters = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
+          message_arena, communication_parameters, submessage_arena);
+    }
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  communication_parameters_ = communication_parameters;
+  // @@protoc_insertion_point(field_set_allocated:Communication_proto.Communication_parameter_all.communication_parameters)
+}
+
+#ifdef __GNUC__
+  #pragma GCC diagnostic pop
+#endif  // __GNUC__
+// -------------------------------------------------------------------
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace Communication_proto
+
+// @@protoc_insertion_point(global_scope)
+
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_communication_2eproto

+ 9 - 0
src/communication/communication.proto

@@ -0,0 +1,9 @@
+syntax = "proto2";
+package Communication_proto;
+
+message Communication_parameter
+{
+    optional string bind_string = 1;
+    repeated string connect_string_vector = 2;
+
+}

+ 89 - 0
src/communication/communication_message.cpp

@@ -0,0 +1,89 @@
+//
+// Created by huli on 2020/6/29.
+//
+
+#include "communication_message.h"
+
+
+Communication_message::Communication_message()
+{
+	m_message_type = eBase_msg;
+	m_receive_time = std::chrono::system_clock::now();
+	m_timeout_ms = std::chrono::milliseconds(5000);		//超时默认5秒
+	m_sender = eEmpty;
+	m_receiver = eEmpty;
+//	m_message_buf = "";
+}
+
+Communication_message::Communication_message(std::string message_buf)
+{
+	m_message_type = eBase_msg;
+	m_receive_time = std::chrono::system_clock::now();
+	m_timeout_ms = std::chrono::milliseconds(5000);		//超时默认5秒
+	m_sender = eEmpty;
+	m_receiver = eEmpty;
+	m_message_buf = message_buf;
+}
+
+Communication_message::Communication_message(char* p_buf, int size)
+{
+	m_message_type = eBase_msg;
+	m_receive_time = std::chrono::system_clock::now();
+	m_timeout_ms = std::chrono::milliseconds(5000);		//超时默认5秒
+	m_sender = eEmpty;
+	m_receiver = eEmpty;
+	m_message_buf = std::string(p_buf, size);
+}
+
+
+
+Communication_message::~Communication_message()
+{
+
+}
+
+bool Communication_message::is_over_time()
+{
+	if ( std::chrono::system_clock::now() - m_receive_time > m_timeout_ms)
+	{
+	    return true;
+	}
+	else
+	{
+		return false;
+	}
+}
+
+
+void Communication_message::reset(const message::Base_info& base_msg, std::string receive_string)
+{
+	m_message_type = (Message_type)(base_msg.msg_type());
+
+	m_receive_time = std::chrono::system_clock::now();
+	m_timeout_ms = std::chrono::milliseconds(base_msg.timeout_ms());
+	m_sender = (Communicator)(base_msg.sender());
+	m_receiver = (Communicator)(base_msg.receiver());
+	m_message_buf = receive_string;
+}
+
+Communication_message::Message_type Communication_message::get_message_type()
+{
+	return m_message_type;
+}
+Communication_message::Communicator Communication_message::get_sender()
+{
+	return m_sender;
+}
+Communication_message::Communicator Communication_message::get_receiver()
+{
+	return m_receiver;
+}
+std::string& Communication_message::get_message_buf()
+{
+	return m_message_buf;
+}
+
+
+
+
+

+ 106 - 0
src/communication/communication_message.h

@@ -0,0 +1,106 @@
+//
+// Created by huli on 2020/6/29.
+//
+
+#ifndef NNXX_TESTS_COMMUNICATION_MESSAGE_H
+#define NNXX_TESTS_COMMUNICATION_MESSAGE_H
+
+#include "../error_code/error_code.h"
+
+#include <time.h>
+#include <sys/time.h>
+#include <chrono>
+//#include <iosfwd>
+
+#include <string>
+#include "message_base.pb.h"
+
+
+class Communication_message
+{
+public:
+	//消息类型定义,每个在网络上传输的消息必须含有这个属性
+	enum Message_type
+	{
+		eBase_msg=0x00,
+		eCommand_msg=0x01,                      //指令消息
+
+		eLocate_status_msg=0x11,                //定位模块状态消息
+		eLocate_request_msg=0x12,               //定位请求消息
+		eLocate_response_msg=0x13,              //定位反馈消息
+
+        eDispatch_status_msg=0x21,                //调度模块硬件状态消息
+        eDispatch_request_msg=0x22,              //请求调度消息
+        eDispatch_response_msg=0x23,             //调度结果反馈消息
+
+        eParkspace_allocation_status_msg = 0x31,   //车位分配模块状态消息,包括车位信息
+        eParkspace_allocation_request_msg = 0x32,  //请求分配车位消息
+        eParkspace_allocation_response_msg = 0x33, //分配车位结果反馈消息
+        eParkspace_search_request_msg = 0x34,    //查询车位请求消息
+        eParkspace_search_response_msg = 0x35,    //查询车位反馈消息
+        eParkspace_release_request_msg = 0x36,    //释放车位请求消息
+        eParkspace_release_response_msg = 0x37,    //释放车位反馈消息
+        eParkspace_force_update_request_msg = 0x38,	//手动修改车位消息
+        eParkspace_force_update_response_msg = 0x39,//手动修改车位反馈消息
+        eParkspace_confirm_alloc_request_msg = 0x3A,//确认分配车位请求消息
+        eParkspace_confirm_alloc_response_msg = 0x3B,//确认分配车位反馈消息
+        eParkspace_refresh_request_msg=0x3C,        //请求更新车位数据
+        eParkspace_allocation_data_msg=0x3D,
+
+        eStore_command_request_msg=0x41,                    //终端停车请求消息
+        eStore_command_response_msg=0x42,                   //停车请求反馈消息
+        ePickup_command_request_msg=0x43,                   //取车请求消息
+        ePickup_command_response_msg=0x44,                  //取车请求反馈消息
+
+        eStoring_process_statu_msg=0x90,                    //停车进度条消息
+        ePicking_process_statu_msg=0x91,                    //取车进度消息
+
+        eCentral_controller_statu_msg=0xa0,                 //中控状态消息
+
+        eEntrance_manual_operation_msg=0xb0,            //针对出入口状态操作的手动消息
+        eProcess_manual_operation_msg=0xb1,
+    };
+
+//通讯单元
+	enum Communicator
+	{
+		eEmpty=0x0000,		//空
+		eMain=0x0001,    	//主流程
+		eTerminor=0x0100,	//终端
+		eTable=0x0200,		//数据表
+		eMeasurer=0x0300,	//测量单元
+		eProcess=0x0400,	//调度机构
+		//...
+	};
+public:
+	Communication_message();
+	Communication_message(std::string message_buf);
+	Communication_message(char* p_buf, int size);
+	Communication_message(const Communication_message& other)= default;
+	Communication_message& operator =(const Communication_message& other)= default;
+	~Communication_message();
+public://API functions
+	bool is_over_time();
+public://get or set member variable
+	void reset(const message::Base_info& base_info, std::string receive_string);
+
+	Message_type get_message_type();
+	Communicator get_sender();
+	Communicator get_receiver();
+	std::string& get_message_buf();
+
+protected://member variable
+	Message_type								m_message_type;				//消息类型
+	std::chrono::system_clock::time_point		m_receive_time;				//接收消息的时间点
+	std::chrono::milliseconds					m_timeout_ms;				//超时时间, 整个软件都统一为毫秒
+	Communicator								m_sender;					//发送者
+	Communicator								m_receiver;					//接受者
+
+	std::string									m_message_buf;				//消息数据
+
+private:
+
+};
+
+
+#endif //NNXX_TESTS_COMMUNICATION_MESSAGE_H

+ 5 - 0
src/communication/communication_requestor.cpp

@@ -0,0 +1,5 @@
+//
+// Created by zx on 2020/7/10.
+//
+
+#include "communication_requestor.h"

+ 15 - 0
src/communication/communication_requestor.h

@@ -0,0 +1,15 @@
+//
+// Created by zx on 2020/7/10.
+//
+
+#ifndef NNXX_TESTS_COMMUNICATION_REQUESTOR_H
+#define NNXX_TESTS_COMMUNICATION_REQUESTOR_H
+
+
+class communication_requestor
+{
+
+};
+
+
+#endif //NNXX_TESTS_COMMUNICATION_REQUESTOR_H

+ 591 - 0
src/communication/communication_socket_base.cpp

@@ -0,0 +1,591 @@
+
+
+
+#include "communication_socket_base.h"
+#include "../tool/proto_tool.h"
+
+Communication_socket_base::Communication_socket_base()
+{
+	m_communication_statu = COMMUNICATION_UNKNOW;
+
+	mp_receive_data_thread = NULL;
+	mp_analysis_data_thread = NULL;
+	mp_send_data_thread = NULL;
+	mp_encapsulate_data_thread = NULL;
+}
+
+Communication_socket_base::~Communication_socket_base()
+{
+	communication_uninit();
+}
+
+//初始化 通信 模块。如下三选一
+Error_manager Communication_socket_base::communication_init()
+{
+	LOG(INFO) << " ---Communication_socket_base::communication_init() run--- "<< this;
+
+	return  communication_init_from_protobuf(COMMUNICATION_PARAMETER_PATH);
+}
+
+//初始化 通信 模块。从文件读取
+Error_manager Communication_socket_base::communication_init_from_protobuf(std::string prototxt_path)
+{
+	Communication_proto::Communication_parameter_all t_communication_parameter_all;
+	if(!  proto_tool::read_proto_param(prototxt_path,t_communication_parameter_all) )
+	{
+		return Error_manager(COMMUNICATION_READ_PROTOBUF_ERROR,MINOR_ERROR,
+		"Communication_socket_base read_proto_param  failed");
+	}
+
+	return communication_init_from_protobuf(t_communication_parameter_all);
+}
+
+//初始化 通信 模块。从protobuf读取
+Error_manager Communication_socket_base::communication_init_from_protobuf(Communication_proto::Communication_parameter_all& communication_parameter_all)
+{
+	LOG(INFO) << " ---Communication_socket_base::communication_init_from_protobuf() run--- "<< this;
+	Error_manager t_error;
+
+	if ( communication_parameter_all.communication_parameters().has_bind_string() )
+	{
+		t_error = communication_bind(communication_parameter_all.communication_parameters().bind_string());
+		if ( t_error != Error_code::SUCCESS )
+		{
+			return t_error;
+		}
+	}
+	std::cout << "communication_parameter_all.communication_parameters().connect_string_vector_size() " <<
+		communication_parameter_all.communication_parameters().connect_string_vector_size()<< std::endl;
+	for(int i=0;i<communication_parameter_all.communication_parameters().connect_string_vector_size();++i)
+	{
+		t_error = communication_connect( communication_parameter_all.communication_parameters().connect_string_vector(i) );
+		if ( t_error != Error_code::SUCCESS )
+		{
+			return t_error;
+		}
+	}
+
+	//启动通信, run thread
+	communication_run();
+
+	return Error_code::SUCCESS;
+}
+
+//初始化
+Error_manager Communication_socket_base::communication_init(std::string bind_string, std::vector<std::string>& connect_string_vector)
+{
+	LOG(INFO) << " ---Communication_socket_base::communication_init() run--- "<< this;
+	Error_manager t_error;
+
+	t_error = communication_bind(bind_string);
+	if ( t_error != Error_code::SUCCESS )
+	{
+		return t_error;
+	}
+
+	t_error = communication_connect(connect_string_vector);
+	if ( t_error != Error_code::SUCCESS )
+	{
+		return t_error;
+	}
+
+	//启动通信, run thread
+	communication_run();
+
+	return Error_code::SUCCESS;
+}
+//bind
+Error_manager Communication_socket_base::communication_bind(std::string bind_string)
+{
+	Error_manager t_error;
+	int t_socket_result;
+
+	//m_socket 自己作为一个服务器, 绑定一个端口
+	t_socket_result = m_socket.bind(bind_string);
+	if ( t_socket_result <0 )
+	{
+		return Error_manager(Error_code::COMMUNICATION_BIND_ERROR, Error_level::MINOR_ERROR,
+							 " m_socket.bind error ");
+	}
+	//LOG(INFO) << " ---Communication_socket_base::communication_bind() bind::  "<< bind_string << "  " << this;
+
+	return Error_code::SUCCESS;
+}
+//connect
+Error_manager Communication_socket_base::communication_connect(std::vector<std::string>& connect_string_vector)
+{
+	Error_manager t_error;
+	for (auto iter = connect_string_vector.begin(); iter != connect_string_vector.end(); ++iter)
+	{
+		t_error = communication_connect(*iter);
+		if ( t_error != Error_code::SUCCESS )
+		{
+			return t_error;
+		}
+	}
+	return Error_code::SUCCESS;
+}
+//connect
+Error_manager Communication_socket_base::communication_connect(std::string connect_string)
+{
+	Error_manager t_error;
+	int t_socket_result;
+	//m_socket 和远端通信, 连接远端服务器的端口
+	t_socket_result = m_socket.connect(connect_string);
+	if ( t_socket_result <0 )
+	{
+		return Error_manager(Error_code::COMMUNICATION_CONNECT_ERROR, Error_level::MINOR_ERROR,
+							 " m_socket.connect error ");
+	}
+	return Error_code::SUCCESS;
+}
+//启动通信, run thread
+Error_manager Communication_socket_base::communication_run()
+{
+	m_communication_statu = COMMUNICATION_READY;
+	//启动4个线程。
+	//接受线程默认循环, 内部的nn_recv进行等待, 超时1ms
+	m_receive_condition.reset(false, false, false);
+	mp_receive_data_thread = new std::thread(&Communication_socket_base::receive_data_thread, this);
+	//解析线程默认等待, 需要接受线程去唤醒, 超时1ms, 超时后主动遍历m_receive_data_list
+	m_analysis_data_condition.reset(false, false, false);
+	mp_analysis_data_thread = new std::thread(&Communication_socket_base::analysis_data_thread, this);
+	//发送线程默认循环, 内部的wait_and_pop进行等待,
+	m_send_data_condition.reset(false, true, false);
+	mp_send_data_thread = new std::thread(&Communication_socket_base::send_data_thread, this);
+	//封装线程默认等待, ...., 超时1ms, 超时后主动 封装心跳和状态信息,
+	m_encapsulate_data_condition.reset(false, false, false);
+	mp_encapsulate_data_thread = new std::thread(&Communication_socket_base::encapsulate_data_thread, this);
+
+	return Error_code::SUCCESS;
+}
+
+
+//反初始化 通信 模块。
+Error_manager Communication_socket_base::communication_uninit()
+{
+	//终止list,防止 wait_and_pop 阻塞线程。
+	m_receive_data_list.termination_list();
+	m_send_data_list.termination_list();
+
+	//杀死4个线程,强制退出
+	if (mp_receive_data_thread)
+	{
+		m_receive_condition.kill_all();
+	}
+	if (mp_analysis_data_thread)
+	{
+		m_analysis_data_condition.kill_all();
+	}
+	if (mp_send_data_thread)
+	{
+		m_send_data_condition.kill_all();
+	}
+	if (mp_encapsulate_data_thread)
+	{
+		m_encapsulate_data_condition.kill_all();
+	}
+	//回收4个线程的资源
+	if (mp_receive_data_thread)
+	{
+		mp_receive_data_thread->join();
+		delete mp_receive_data_thread;
+		mp_receive_data_thread = NULL;
+	}
+	if (mp_analysis_data_thread)
+	{
+		mp_analysis_data_thread->join();
+		delete mp_analysis_data_thread;
+		mp_analysis_data_thread = 0;
+	}
+	if (mp_send_data_thread)
+	{
+		mp_send_data_thread->join();
+		delete mp_send_data_thread;
+		mp_send_data_thread = NULL;
+	}
+	if (mp_encapsulate_data_thread)
+	{
+		mp_encapsulate_data_thread->join();
+		delete mp_encapsulate_data_thread;
+		mp_encapsulate_data_thread = NULL;
+	}
+
+	//清空list
+	m_receive_data_list.clear_and_delete();
+	m_send_data_list.clear_and_delete();
+
+	m_communication_statu = COMMUNICATION_UNKNOW;
+	m_socket.close();
+
+	return Error_code::SUCCESS;
+}
+
+
+
+
+
+
+
+//mp_receive_data_thread 接受线程执行函数,
+//receive_data_thread 内部线程负责接受消息
+void Communication_socket_base::receive_data_thread(Communication_socket_base* communicator)
+{
+	//LOG(INFO) << " Communication_socket_base::receive_data_thread start "<< communicator;
+
+	//通信接受线程, 负责接受socket消息, 并存入 m_receive_data_list
+	while (communicator->m_receive_condition.is_alive())
+	{
+        std::this_thread::yield();
+        //usleep(1);
+        communicator->m_receive_condition.wait_for_ex(std::chrono::microseconds(1));
+		if ( communicator->m_receive_condition.is_alive() )
+		{
+
+			std::unique_lock<std::mutex> lk(communicator->m_mutex);
+			//flags为1, 非阻塞接受消息, 如果接收到消息, 那么接受数据长度大于0
+			std::string t_receive_string = communicator->m_socket.recv<std::string>(1);
+			if ( t_receive_string.length()>0 )
+			{
+				//如果这里接受到了消息, 在这提前解析消息最前面的Base_msg (消息公共内容), 用于后续的check
+				message::Base_msg t_base_msg;
+				if( t_base_msg.ParseFromString(t_receive_string) )
+				{
+					//第一次解析之后转化为, Communication_message, 自定义的通信消息格式
+					Communication_message  * tp_communication_message = new Communication_message;
+					tp_communication_message->reset(t_base_msg.base_info(), t_receive_string);
+					//检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
+					if ( communicator->check_msg(tp_communication_message) == SUCCESS )
+					{
+						bool is_push = communicator->m_receive_data_list.push(tp_communication_message);
+						//push成功之后, tp_communication_message内存的管理权限交给链表, 如果失败就要回收内存
+						if ( is_push )
+						{
+							//唤醒解析线程一次,
+                            communicator->m_analysis_data_condition.notify_all(false, true);
+						}
+						else
+						{
+//						push失败, 就要回收内存
+							delete(tp_communication_message);
+							tp_communication_message = NULL;
+//					return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
+//										 " m_receive_data_list.push error ");
+						}
+					}
+					else
+					{
+						delete(tp_communication_message);
+						tp_communication_message = NULL;
+					}
+
+				}
+				//解析失败, 就当做什么也没发生, 认为接收消息无效,
+			}
+			//没有接受到消息, 返回空字符串
+		}
+	}
+
+	//LOG(INFO) << " Communication_socket_base::receive_data_thread end "<< communicator;
+	return;
+}
+
+//检查消息是否有效, 主要检查消息类型和接受者, 判断这条消息是不是给我的.
+Error_manager Communication_socket_base::check_msg(Communication_message*  p_msg)
+{
+	//通过 p_msg->get_message_type() 和 p_msg->get_receiver() 判断这条消息是不是给我的.
+	//子类重载时, 增加自己模块的判断逻辑, 以后再写.
+	if ( p_msg->get_message_type() == Communication_message::Message_type::eBase_msg
+		 && p_msg->get_receiver() == Communication_message::Communicator::eMain )
+	{
+		return Error_code::SUCCESS;
+	}
+	else
+	{
+		//认为接受人
+		return Error_code::INVALID_MESSAGE;
+	}
+}
+
+//mp_analysis_data_thread 解析线程执行函数,
+//analysis_data_thread 内部线程负责解析消息
+void Communication_socket_base::analysis_data_thread()
+{
+	//LOG(INFO) << " Communication_socket_base::analysis_data_thread start "<< this;
+
+	//通信解析线程, 负责巡检m_receive_data_list, 并解析和处理消息
+	while (m_analysis_data_condition.is_alive())
+	{
+        std::this_thread::yield();
+		bool t_pass_flag = m_analysis_data_condition.wait_for_millisecond(1000);
+		if ( m_analysis_data_condition.is_alive() )
+		{
+
+			//如果解析线程被主动唤醒, 那么就表示 收到新的消息, 那就遍历整个链表
+			if ( t_pass_flag )
+			{
+				analysis_receive_list();
+			}
+				//如果解析线程超时通过, 那么就定时处理链表残留的消息,
+			else
+			{
+				analysis_receive_list();
+			}
+		}
+	}
+
+	//LOG(INFO) << " Communication_socket_base::analysis_data_thread end "<< this;
+	return;
+}
+
+//循环接受链表, 解析消息,
+Error_manager Communication_socket_base::analysis_receive_list()
+{
+	Error_manager t_error;
+	if ( m_receive_data_list.m_termination_flag )
+	{
+		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
+							 " Communication_socket_base::analysis_receive_list error ");
+	}
+	else
+	{
+		std::unique_lock<std::mutex> lk(m_receive_data_list.m_mutex);
+		for (auto iter = m_receive_data_list.m_data_list.begin(); iter != m_receive_data_list.m_data_list.end(); )
+		{
+			Communication_message* tp_msg = **iter;
+			if ( tp_msg == NULL )
+			{
+				iter = m_receive_data_list.m_data_list.erase(iter);
+				//注:erase 删除当前 iter 之后返回下一个节点,当前的 iter 无效化,
+			}
+			else
+			{
+				//检查消息是否可以被处理
+				t_error = check_executer(tp_msg);
+				if ( t_error == SUCCESS)
+				{
+					//处理消息
+					t_error = execute_msg(tp_msg);
+				if ( t_error!=SUCCESS )
+				{
+					fprintf(stderr,"%s\n",t_error.to_string().c_str());
+				}
+//				else
+//				{
+//					//执行结果不管
+//				}
+					delete(tp_msg);
+					tp_msg = NULL;
+					iter = m_receive_data_list.m_data_list.erase(iter);
+					//注:erase 删除当前 iter 之后返回下一个节点,当前的 iter 无效化,
+				}
+				else if( t_error == COMMUNICATION_EXCUTER_IS_BUSY)
+				{
+					//处理器正忙, 那就不做处理, 直接处理下一个
+					//注:这条消息就被保留了下来, wait_for_millisecond 超时通过之后, 会循环检查残留的消息.
+					iter++;
+				}
+				else //if( t_error == COMMUNICATION_ANALYSIS_TIME_OUT )
+				{
+					//超时了就直接删除
+					delete(tp_msg);
+					tp_msg = NULL;
+					iter = m_receive_data_list.m_data_list.erase(iter);
+					//注:erase 删除当前 iter 之后返回下一个节点,当前的 iter 无效化,
+
+					//注:消息删除之后, 不需要发送答复消息, 发送方也会有超时处理的,  只有 execute_msg 里面可以答复消息
+				}
+			}
+		}
+	}
+	return Error_code::SUCCESS;
+}
+
+
+
+//检查执行者的状态, 判断能否处理这条消息, 需要子类重载
+Error_manager Communication_socket_base::check_executer(Communication_message*  p_msg)
+{
+	//检查对应模块的状态, 判断是否可以处理这条消息
+	//同时也要判断是否超时, 超时返回 COMMUNICATION_ANALYSIS_TIME_OUT
+	//如果处理器正在忙别的, 那么返回 COMMUNICATION_EXCUTER_IS_BUSY
+
+	if ( p_msg->is_over_time() )
+	{
+		return Error_code::COMMUNICATION_ANALYSIS_TIME_OUT;
+	}
+	else
+	{
+		bool executer_is_ready = false;
+		//通过 p_msg->get_message_type() 和 p_msg->get_receiver() 找到处理模块的实例对象, 查询执行人是否可以处理这条消息
+		//这里子类重载时, 增加判断逻辑, 以后再写.
+//		executer_is_ready = true;
+
+		if ( executer_is_ready )
+		{
+			std::cout << "executer_is_ready , " << std::endl;
+			return Error_code::SUCCESS;
+		}
+		else
+		{
+			std::cout << "executer_is_busy , " << std::endl;
+			return Error_code::COMMUNICATION_EXCUTER_IS_BUSY;
+		}
+	}
+
+	return Error_code::SUCCESS;
+}
+
+//处理消息
+Error_manager Communication_socket_base::execute_msg(Communication_message*  p_msg)
+{
+	//先将 p_msg 转化为 对应的格式, 使用对应模块的protobuf来二次解析
+	// 不能一直使用 Communication_message*  p_msg, 这个是要销毁的
+	//然后处理这个消息, 就是调用对应模块的 execute 接口函数
+	//执行结果不管, 如果需要答复, 那么对应模块 在自己内部 封装一条消息发送即可.
+	//子类重载, 需要完全重写, 以后再写.
+
+	//注注注注注意了, 本模块只是用来做通信,
+	//在做处理消息的时候, 可能会调用执行者的接口函数,
+	//这里不应该长时间阻塞或者处理复杂的逻辑,
+	//请执行者另开线程来处理任务.
+
+	return Error_code::SUCCESS;
+}
+
+//mp_send_data_thread 发送线程执行函数,
+//send_data_thread 内部线程负责发送消息
+void Communication_socket_base::send_data_thread(Communication_socket_base* communicator)
+{
+	//LOG(INFO) << " Communication_socket_base::send_data_thread start "<< communicator;
+
+	//通信发送线程, 负责巡检m_send_data_list, 并发送消息
+	while (communicator->m_send_data_condition.is_alive())
+	{
+        std::this_thread::yield();
+        communicator->m_send_data_condition.wait();
+		if ( communicator->m_send_data_condition.is_alive() )
+		{
+
+
+			Communication_message* tp_msg = NULL;
+			//这里 wait_and_pop 会使用链表内部的 m_data_cond 条件变量来控制等待,
+			//封装线程使用push的时候, 会唤醒线程并通过等待, 此时 m_send_data_condition 是一直通过的.
+			//如果需要退出, 那么就要 m_send_data_list.termination_list();	和 m_send_data_condition.kill_all();
+			bool is_pop = communicator->m_send_data_list.wait_and_pop(tp_msg);
+			if ( is_pop )
+			{
+				if ( tp_msg != NULL )
+				{
+					std::unique_lock<std::mutex> lk(communicator->m_mutex);
+					int send_size = communicator->m_socket.send(tp_msg->get_message_buf());
+
+					delete(tp_msg);
+					tp_msg = NULL;
+				}
+			}
+			else
+			{
+				//没有取出, 那么应该就是 m_termination_flag 结束了
+//				return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
+//									 " Communication_socket_base::send_data_thread() error ");
+			}
+		}
+	}
+
+	//LOG(INFO) << " Communication_socket_base::send_data_thread end "<< communicator;
+	return;
+}
+
+//mp_encapsulate_data_thread 封装线程执行函数,
+//encapsulate_data_thread 内部线程负责封装消息
+void Communication_socket_base::encapsulate_data_thread()
+{
+	//LOG(INFO) << " Communication_socket_base::encapsulate_data_thread start "<< this;
+
+	//通信封装线程, 负责定时封装消息, 并存入 m_send_data_list
+	while (m_encapsulate_data_condition.is_alive())
+	{
+        std::this_thread::yield();
+		bool t_pass_flag = m_encapsulate_data_condition.wait_for_millisecond(1000);
+		if ( m_encapsulate_data_condition.is_alive() )
+		{
+
+			//如果封装线程被主动唤醒, 那么就表示 需要主动发送消息,
+			if ( t_pass_flag )
+			{
+				//主动发送消息,
+			}
+				//如果封装线程超时通过, 那么就定时封装心跳和状态信息
+			else
+			{
+				encapsulate_send_data();
+			}
+		}
+	}
+
+	//LOG(INFO) << " Communication_socket_base::encapsulate_data_thread end "<< this;
+	return;
+}
+
+
+//定时封装发送消息, 一般为心跳和状态信息, 需要子类重载
+Error_manager Communication_socket_base::encapsulate_send_data()
+{
+//	char buf[256] = {0};
+//	static unsigned int t_heartbeat = 0;
+//	sprintf(buf, "Communication_socket_base, heartbeat = %d\0\0\0, test\0", t_heartbeat);
+//	t_heartbeat++;
+
+	message::Base_info t_base_msg;
+	t_base_msg.set_msg_type(message::Message_type::eBase_msg);
+	t_base_msg.set_timeout_ms(5000);
+	t_base_msg.set_sender(message::Communicator::eMain);
+	t_base_msg.set_receiver(message::Communicator::eMain);
+
+	Communication_message* tp_msg = new Communication_message(t_base_msg.SerializeAsString());
+	bool is_push = m_send_data_list.push(tp_msg);
+	if ( is_push == false )
+	{
+		delete(tp_msg);
+		tp_msg = NULL;
+		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
+							 " Communication_socket_base::encapsulate_msg error ");
+	}
+	return Error_code::SUCCESS;
+}
+
+
+
+//封装消息, 需要子类重载
+Error_manager Communication_socket_base::encapsulate_msg(std::string message)
+{
+	Communication_message* tp_msg = new Communication_message(message);
+	bool is_push = m_send_data_list.push(tp_msg);
+	if ( is_push == false )
+	{
+		delete(tp_msg);
+		tp_msg = NULL;
+		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
+							 " Communication_socket_base::encapsulate_msg error ");
+	}
+	return Error_code::SUCCESS;
+}
+
+//封装消息, 需要子类重载
+Error_manager Communication_socket_base::encapsulate_msg(Communication_message* p_msg)
+{
+	Communication_message* tp_msg = new Communication_message(*p_msg);
+
+	bool is_push = m_send_data_list.push(tp_msg);
+
+
+	if ( is_push == false )
+	{
+		delete(tp_msg);
+		tp_msg = NULL;
+		return Error_manager(Error_code::CONTAINER_IS_TERMINATE, Error_level::MINOR_ERROR,
+							 " Communication_socket_base::encapsulate_msg error ");
+	}
+	return Error_code::SUCCESS;
+}

+ 143 - 0
src/communication/communication_socket_base.h

@@ -0,0 +1,143 @@
+
+
+/*
+ * communication_socket_base 通信模块的基类,
+ * 用户从这个基类继承, 初始化之后, 便可以自动进行通信
+ * 重载解析消息和封装消息,
+ *
+ *Thread_safe_list<Binary_buf*> 使用 Binary_buf , 而不是string
+ * 主要是为了支持直接发送数字0
+ * 
+ * 
+ * */
+
+#ifndef __COMMUNICATION_SOCKET_BASE__HH__
+#define __COMMUNICATION_SOCKET_BASE__HH__
+
+
+#include <nnxx/message>
+#include <nnxx/socket.h>
+#include <nnxx/bus.h>
+
+#include <glog/logging.h>
+#include "../error_code/error_code.h"
+#include "../tool/binary_buf.h"
+#include "../tool/thread_safe_list.h"
+#include "../tool/thread_condition.h"
+
+#include "../communication/communication.pb.h"
+#include "../communication/communication_message.h"
+
+#include "message_base.pb.h"
+
+
+
+#define COMMUNICATION_PARAMETER_PATH "../setting/communication.prototxt"
+
+class Communication_socket_base
+{
+	//通信状态
+	enum Communication_statu
+	{
+		COMMUNICATION_UNKNOW		=0,	        //通信状态 未知
+		COMMUNICATION_READY			=1,			//通信状态 正常
+
+		COMMUNICATION_FAULT			=3,         //通信状态 错误
+	};
+
+public:
+	Communication_socket_base();
+	Communication_socket_base(const Communication_socket_base& other)= delete;
+	Communication_socket_base& operator =(const Communication_socket_base& other)= delete;
+	~Communication_socket_base();
+public://API functions
+	//初始化 通信 模块。如下三选一
+	virtual Error_manager communication_init();
+	//初始化 通信 模块。从文件读取
+	Error_manager communication_init_from_protobuf(std::string prototxt_path);
+	//初始化 通信 模块。从protobuf读取
+	Error_manager communication_init_from_protobuf(Communication_proto::Communication_parameter_all& communication_parameter_all);
+
+	//初始化
+	virtual Error_manager communication_init(std::string bind_string, std::vector<std::string>& connect_string_vector);
+	//bind
+	virtual Error_manager communication_bind(std::string bind_string);
+	//connect
+	virtual Error_manager communication_connect(std::vector<std::string>& connect_string_vector);
+	//connect
+	virtual Error_manager communication_connect(std::string connect_string);
+	//启动通信, run thread
+	virtual Error_manager communication_run();
+
+	//反初始化 通信 模块。
+	virtual Error_manager communication_uninit();
+	
+	
+public://get or set member variable
+
+protected:
+	//mp_receive_data_thread 接受线程执行函数,
+	//receive_data_thread 内部线程负责接受消息
+	static void receive_data_thread(Communication_socket_base* communicator);
+
+	//检查消息是否可以被解析, 需要子类重载
+	virtual Error_manager check_msg(Communication_message* p_msg);
+
+	//mp_analysis_data_thread 解析线程执行函数,
+	//analysis_data_thread 内部线程负责解析消息
+	void analysis_data_thread();
+
+	//遍历接受链表, 解析消息,
+	Error_manager analysis_receive_list();
+
+	//检查消息是否可以被解析, 需要子类重载
+	virtual Error_manager check_executer(Communication_message* p_msg);
+
+	//处理消息, 需要子类重载
+	virtual Error_manager execute_msg(Communication_message* p_msg);
+
+	//mp_send_data_thread 发送线程执行函数,
+	//send_data_thread 内部线程负责发送消息
+	static void send_data_thread(Communication_socket_base* communicator);
+
+	//mp_encapsulate_data_thread 封装线程执行函数,
+	//encapsulate_data_thread 内部线程负责封装消息
+	void encapsulate_data_thread();
+
+	//定时封装发送消息, 一般为心跳和状态信息, 需要子类重载
+	virtual Error_manager encapsulate_send_data();
+
+public:
+	//封装消息, 需要子类重载
+	virtual Error_manager encapsulate_msg(std::string message);
+	//封装消息, 需要子类重载
+	virtual Error_manager encapsulate_msg(Communication_message* p_msg);
+
+protected://member variable
+
+	//通用的网络编程接口, 默认使用总线模式, (网状结构)
+	nnxx::socket 						m_socket { nnxx::SP, nnxx::BUS };
+	std::mutex 							m_mutex;				//m_socket的锁
+
+	//通信状态
+	Communication_statu 				m_communication_statu;			//通信状态
+
+	//接受模块,
+	Thread_safe_list<Communication_message*>		m_receive_data_list; 			//接受的list容器
+	std::thread*						mp_receive_data_thread;    		//接受的线程指针
+	Thread_condition					m_receive_condition;			//接受的条件变量
+	std::thread*						mp_analysis_data_thread;    	//解析的线程指针
+	Thread_condition					m_analysis_data_condition;		//解析的条件变量
+
+	//发送模块,
+	Thread_safe_list<Communication_message*>		m_send_data_list;				//发送的list容器
+	std::thread*						mp_send_data_thread;    		//发送的线程指针
+	Thread_condition					m_send_data_condition;			//发送的条件变量
+	std::thread*						mp_encapsulate_data_thread;    	//封装的线程指针
+	Thread_condition					m_encapsulate_data_condition;	//封装的条件变量
+
+private:
+
+};
+
+#endif //__COMMUNICATION_SOCKET_BASE__HH__

+ 463 - 22
src/configure.pb.cc

@@ -16,6 +16,7 @@
 #include <google/protobuf/port_def.inc>
 extern PROTOBUF_INTERNAL_EXPORT_configure_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Box_configure_2eproto;
 extern PROTOBUF_INTERNAL_EXPORT_configure_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Calib_parameter_configure_2eproto;
+extern PROTOBUF_INTERNAL_EXPORT_configure_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Communication_configure_configure_2eproto;
 extern PROTOBUF_INTERNAL_EXPORT_configure_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Lidar_configure_configure_2eproto;
 namespace ground_region {
 class Calib_parameterDefaultTypeInternal {
@@ -30,6 +31,10 @@ class BoxDefaultTypeInternal {
  public:
   ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Box> _instance;
 } _Box_default_instance_;
+class Communication_configureDefaultTypeInternal {
+ public:
+  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Communication_configure> _instance;
+} _Communication_configure_default_instance_;
 class ConfigureDefaultTypeInternal {
  public:
   ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Configure> _instance;
@@ -63,6 +68,20 @@ static void InitDefaultsscc_info_Calib_parameter_configure_2eproto() {
 ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Calib_parameter_configure_2eproto =
     {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Calib_parameter_configure_2eproto}, {}};
 
+static void InitDefaultsscc_info_Communication_configure_configure_2eproto() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  {
+    void* ptr = &::ground_region::_Communication_configure_default_instance_;
+    new (ptr) ::ground_region::Communication_configure();
+    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::ground_region::Communication_configure::InitAsDefaultInstance();
+}
+
+::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Communication_configure_configure_2eproto =
+    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Communication_configure_configure_2eproto}, {}};
+
 static void InitDefaultsscc_info_Configure_configure_2eproto() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
@@ -74,10 +93,11 @@ static void InitDefaultsscc_info_Configure_configure_2eproto() {
   ::ground_region::Configure::InitAsDefaultInstance();
 }
 
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Configure_configure_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_Configure_configure_2eproto}, {
+::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_Configure_configure_2eproto =
+    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, 0, InitDefaultsscc_info_Configure_configure_2eproto}, {
       &scc_info_Lidar_configure_configure_2eproto.base,
-      &scc_info_Box_configure_2eproto.base,}};
+      &scc_info_Box_configure_2eproto.base,
+      &scc_info_Communication_configure_configure_2eproto.base,}};
 
 static void InitDefaultsscc_info_Lidar_configure_configure_2eproto() {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
@@ -94,7 +114,7 @@ static void InitDefaultsscc_info_Lidar_configure_configure_2eproto() {
     {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_Lidar_configure_configure_2eproto}, {
       &scc_info_Calib_parameter_configure_2eproto.base,}};
 
-static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_configure_2eproto[4];
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_configure_2eproto[5];
 static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_configure_2eproto = nullptr;
 static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_configure_2eproto = nullptr;
 
@@ -144,6 +164,15 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_configure_2eproto::offsets[] P
   3,
   4,
   5,
+  PROTOBUF_FIELD_OFFSET(::ground_region::Communication_configure, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::ground_region::Communication_configure, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  PROTOBUF_FIELD_OFFSET(::ground_region::Communication_configure, ip_),
+  PROTOBUF_FIELD_OFFSET(::ground_region::Communication_configure, port_),
+  0,
+  1,
   PROTOBUF_FIELD_OFFSET(::ground_region::Configure, _has_bits_),
   PROTOBUF_FIELD_OFFSET(::ground_region::Configure, _internal_metadata_),
   ~0u,  // no _extensions_
@@ -151,20 +180,26 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_configure_2eproto::offsets[] P
   ~0u,  // no _weak_field_map_
   PROTOBUF_FIELD_OFFSET(::ground_region::Configure, lidar_),
   PROTOBUF_FIELD_OFFSET(::ground_region::Configure, box_),
+  PROTOBUF_FIELD_OFFSET(::ground_region::Configure, id_),
+  PROTOBUF_FIELD_OFFSET(::ground_region::Configure, communication_cfg_),
   ~0u,
   0,
+  2,
+  1,
 };
 static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
   { 0, 11, sizeof(::ground_region::Calib_parameter)},
   { 17, 25, sizeof(::ground_region::Lidar_configure)},
   { 28, 39, sizeof(::ground_region::Box)},
-  { 45, 52, sizeof(::ground_region::Configure)},
+  { 45, 52, sizeof(::ground_region::Communication_configure)},
+  { 54, 63, sizeof(::ground_region::Configure)},
 };
 
 static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
   reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::ground_region::_Calib_parameter_default_instance_),
   reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::ground_region::_Lidar_configure_default_instance_),
   reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::ground_region::_Box_default_instance_),
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::ground_region::_Communication_configure_default_instance_),
   reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::ground_region::_Configure_default_instance_),
 };
 
@@ -177,24 +212,28 @@ const char descriptor_table_protodef_configure_2eproto[] PROTOBUF_SECTION_VARIAB
   ".ground_region.Calib_parameter\"Y\n\003Box\022\014\n"
   "\004minx\030\001 \002(\002\022\014\n\004maxx\030\002 \002(\002\022\014\n\004miny\030\003 \002(\002\022"
   "\014\n\004maxy\030\004 \002(\002\022\014\n\004minz\030\005 \002(\002\022\014\n\004maxz\030\006 \002("
-  "\002\"[\n\tConfigure\022-\n\005lidar\030\001 \003(\0132\036.ground_r"
-  "egion.Lidar_configure\022\037\n\003box\030\002 \002(\0132\022.gro"
-  "und_region.Box"
+  "\002\"3\n\027Communication_configure\022\n\n\002ip\030\001 \002(\t"
+  "\022\014\n\004port\030\002 \002(\005\"\252\001\n\tConfigure\022-\n\005lidar\030\001 "
+  "\003(\0132\036.ground_region.Lidar_configure\022\037\n\003b"
+  "ox\030\002 \002(\0132\022.ground_region.Box\022\n\n\002id\030\003 \002(\005"
+  "\022A\n\021communication_cfg\030\004 \002(\0132&.ground_reg"
+  "ion.Communication_configure"
   ;
 static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_configure_2eproto_deps[1] = {
 };
-static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_configure_2eproto_sccs[4] = {
+static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_configure_2eproto_sccs[5] = {
   &scc_info_Box_configure_2eproto.base,
   &scc_info_Calib_parameter_configure_2eproto.base,
+  &scc_info_Communication_configure_configure_2eproto.base,
   &scc_info_Configure_configure_2eproto.base,
   &scc_info_Lidar_configure_configure_2eproto.base,
 };
 static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_configure_2eproto_once;
 const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_configure_2eproto = {
-  false, false, descriptor_table_protodef_configure_2eproto, "configure.proto", 414,
-  &descriptor_table_configure_2eproto_once, descriptor_table_configure_2eproto_sccs, descriptor_table_configure_2eproto_deps, 4, 0,
+  false, false, descriptor_table_protodef_configure_2eproto, "configure.proto", 547,
+  &descriptor_table_configure_2eproto_once, descriptor_table_configure_2eproto_sccs, descriptor_table_configure_2eproto_deps, 5, 0,
   schemas, file_default_instances, TableStruct_configure_2eproto::offsets,
-  file_level_metadata_configure_2eproto, 4, file_level_enum_descriptors_configure_2eproto, file_level_service_descriptors_configure_2eproto,
+  file_level_metadata_configure_2eproto, 5, file_level_enum_descriptors_configure_2eproto, file_level_service_descriptors_configure_2eproto,
 };
 
 // Force running AddDescriptors() at dynamic initialization time.
@@ -1272,11 +1311,296 @@ void Box::InternalSwap(Box* other) {
 }
 
 
+// ===================================================================
+
+void Communication_configure::InitAsDefaultInstance() {
+}
+class Communication_configure::_Internal {
+ public:
+  using HasBits = decltype(std::declval<Communication_configure>()._has_bits_);
+  static void set_has_ip(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_port(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static bool MissingRequiredFields(const HasBits& has_bits) {
+    return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
+  }
+};
+
+Communication_configure::Communication_configure(::PROTOBUF_NAMESPACE_ID::Arena* arena)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
+  SharedCtor();
+  RegisterArenaDtor(arena);
+  // @@protoc_insertion_point(arena_constructor:ground_region.Communication_configure)
+}
+Communication_configure::Communication_configure(const Communication_configure& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  ip_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  if (from._internal_has_ip()) {
+    ip_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_ip(),
+      GetArena());
+  }
+  port_ = from.port_;
+  // @@protoc_insertion_point(copy_constructor:ground_region.Communication_configure)
+}
+
+void Communication_configure::SharedCtor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Communication_configure_configure_2eproto.base);
+  ip_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  port_ = 0;
+}
+
+Communication_configure::~Communication_configure() {
+  // @@protoc_insertion_point(destructor:ground_region.Communication_configure)
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+void Communication_configure::SharedDtor() {
+  GOOGLE_DCHECK(GetArena() == nullptr);
+  ip_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+}
+
+void Communication_configure::ArenaDtor(void* object) {
+  Communication_configure* _this = reinterpret_cast< Communication_configure* >(object);
+  (void)_this;
+}
+void Communication_configure::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void Communication_configure::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
+const Communication_configure& Communication_configure::default_instance() {
+  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Communication_configure_configure_2eproto.base);
+  return *internal_default_instance();
+}
+
+
+void Communication_configure::Clear() {
+// @@protoc_insertion_point(message_clear_start:ground_region.Communication_configure)
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000001u) {
+    ip_.ClearNonDefaultToEmpty();
+  }
+  port_ = 0;
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* Communication_configure::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
+  while (!ctx->Done(&ptr)) {
+    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    CHK_(ptr);
+    switch (tag >> 3) {
+      // required string ip = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+          auto str = _internal_mutable_ip();
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          #ifndef NDEBUG
+          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "ground_region.Communication_configure.ip");
+          #endif  // !NDEBUG
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      // required int32 port = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
+          _Internal::set_has_port(&has_bits);
+          port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      default: {
+      handle_unusual:
+        if ((tag & 7) == 4 || tag == 0) {
+          ctx->SetLastTag(tag);
+          goto success;
+        }
+        ptr = UnknownFieldParse(tag,
+            _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+            ptr, ctx);
+        CHK_(ptr != nullptr);
+        continue;
+      }
+    }  // switch
+  }  // while
+success:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto success;
+#undef CHK_
+}
+
+::PROTOBUF_NAMESPACE_ID::uint8* Communication_configure::_InternalSerialize(
+    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:ground_region.Communication_configure)
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required string ip = 1;
+  if (cached_has_bits & 0x00000001u) {
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
+      this->_internal_ip().data(), static_cast<int>(this->_internal_ip().length()),
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
+      "ground_region.Communication_configure.ip");
+    target = stream->WriteStringMaybeAliased(
+        1, this->_internal_ip(), target);
+  }
+
+  // required int32 port = 2;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_port(), target);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:ground_region.Communication_configure)
+  return target;
+}
+
+size_t Communication_configure::RequiredFieldsByteSizeFallback() const {
+// @@protoc_insertion_point(required_fields_byte_size_fallback_start:ground_region.Communication_configure)
+  size_t total_size = 0;
+
+  if (_internal_has_ip()) {
+    // required string ip = 1;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_ip());
+  }
+
+  if (_internal_has_port()) {
+    // required int32 port = 2;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        this->_internal_port());
+  }
+
+  return total_size;
+}
+size_t Communication_configure::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:ground_region.Communication_configure)
+  size_t total_size = 0;
+
+  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
+    // required string ip = 1;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+        this->_internal_ip());
+
+    // required int32 port = 2;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        this->_internal_port());
+
+  } else {
+    total_size += RequiredFieldsByteSizeFallback();
+  }
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
+        _internal_metadata_, total_size, &_cached_size_);
+  }
+  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  SetCachedSize(cached_size);
+  return total_size;
+}
+
+void Communication_configure::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:ground_region.Communication_configure)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Communication_configure* source =
+      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Communication_configure>(
+          &from);
+  if (source == nullptr) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:ground_region.Communication_configure)
+    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:ground_region.Communication_configure)
+    MergeFrom(*source);
+  }
+}
+
+void Communication_configure::MergeFrom(const Communication_configure& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:ground_region.Communication_configure)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
+    if (cached_has_bits & 0x00000001u) {
+      _internal_set_ip(from._internal_ip());
+    }
+    if (cached_has_bits & 0x00000002u) {
+      port_ = from.port_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+}
+
+void Communication_configure::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:ground_region.Communication_configure)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Communication_configure::CopyFrom(const Communication_configure& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:ground_region.Communication_configure)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Communication_configure::IsInitialized() const {
+  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
+  return true;
+}
+
+void Communication_configure::InternalSwap(Communication_configure* other) {
+  using std::swap;
+  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  ip_.Swap(&other->ip_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  swap(port_, other->port_);
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata Communication_configure::GetMetadata() const {
+  return GetMetadataStatic();
+}
+
+
 // ===================================================================
 
 void Configure::InitAsDefaultInstance() {
   ::ground_region::_Configure_default_instance_._instance.get_mutable()->box_ = const_cast< ::ground_region::Box*>(
       ::ground_region::Box::internal_default_instance());
+  ::ground_region::_Configure_default_instance_._instance.get_mutable()->communication_cfg_ = const_cast< ::ground_region::Communication_configure*>(
+      ::ground_region::Communication_configure::internal_default_instance());
 }
 class Configure::_Internal {
  public:
@@ -1285,8 +1609,15 @@ class Configure::_Internal {
   static void set_has_box(HasBits* has_bits) {
     (*has_bits)[0] |= 1u;
   }
+  static void set_has_id(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static const ::ground_region::Communication_configure& communication_cfg(const Configure* msg);
+  static void set_has_communication_cfg(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
   static bool MissingRequiredFields(const HasBits& has_bits) {
-    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
+    return ((has_bits[0] & 0x00000007) ^ 0x00000007) != 0;
   }
 };
 
@@ -1294,6 +1625,10 @@ const ::ground_region::Box&
 Configure::_Internal::box(const Configure* msg) {
   return *msg->box_;
 }
+const ::ground_region::Communication_configure&
+Configure::_Internal::communication_cfg(const Configure* msg) {
+  return *msg->communication_cfg_;
+}
 Configure::Configure(::PROTOBUF_NAMESPACE_ID::Arena* arena)
   : ::PROTOBUF_NAMESPACE_ID::Message(arena),
   lidar_(arena) {
@@ -1311,12 +1646,20 @@ Configure::Configure(const Configure& from)
   } else {
     box_ = nullptr;
   }
+  if (from._internal_has_communication_cfg()) {
+    communication_cfg_ = new ::ground_region::Communication_configure(*from.communication_cfg_);
+  } else {
+    communication_cfg_ = nullptr;
+  }
+  id_ = from.id_;
   // @@protoc_insertion_point(copy_constructor:ground_region.Configure)
 }
 
 void Configure::SharedCtor() {
   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Configure_configure_2eproto.base);
-  box_ = nullptr;
+  ::memset(&box_, 0, static_cast<size_t>(
+      reinterpret_cast<char*>(&id_) -
+      reinterpret_cast<char*>(&box_)) + sizeof(id_));
 }
 
 Configure::~Configure() {
@@ -1328,6 +1671,7 @@ Configure::~Configure() {
 void Configure::SharedDtor() {
   GOOGLE_DCHECK(GetArena() == nullptr);
   if (this != internal_default_instance()) delete box_;
+  if (this != internal_default_instance()) delete communication_cfg_;
 }
 
 void Configure::ArenaDtor(void* object) {
@@ -1353,10 +1697,17 @@ void Configure::Clear() {
 
   lidar_.Clear();
   cached_has_bits = _has_bits_[0];
-  if (cached_has_bits & 0x00000001u) {
-    GOOGLE_DCHECK(box_ != nullptr);
-    box_->Clear();
+  if (cached_has_bits & 0x00000003u) {
+    if (cached_has_bits & 0x00000001u) {
+      GOOGLE_DCHECK(box_ != nullptr);
+      box_->Clear();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(communication_cfg_ != nullptr);
+      communication_cfg_->Clear();
+    }
   }
+  id_ = 0;
   _has_bits_.Clear();
   _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
 }
@@ -1389,6 +1740,21 @@ const char* Configure::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::
           CHK_(ptr);
         } else goto handle_unusual;
         continue;
+      // required int32 id = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
+          _Internal::set_has_id(&has_bits);
+          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      // required .ground_region.Communication_configure communication_cfg = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
+          ptr = ctx->ParseMessage(_internal_mutable_communication_cfg(), ptr);
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
       default: {
       handle_unusual:
         if ((tag & 7) == 4 || tag == 0) {
@@ -1435,6 +1801,20 @@ failure:
         2, _Internal::box(this), target, stream);
   }
 
+  // required int32 id = 3;
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_id(), target);
+  }
+
+  // required .ground_region.Communication_configure communication_cfg = 4;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        4, _Internal::communication_cfg(this), target, stream);
+  }
+
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
         _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
@@ -1443,15 +1823,55 @@ failure:
   return target;
 }
 
+size_t Configure::RequiredFieldsByteSizeFallback() const {
+// @@protoc_insertion_point(required_fields_byte_size_fallback_start:ground_region.Configure)
+  size_t total_size = 0;
+
+  if (_internal_has_box()) {
+    // required .ground_region.Box box = 2;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *box_);
+  }
+
+  if (_internal_has_communication_cfg()) {
+    // required .ground_region.Communication_configure communication_cfg = 4;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *communication_cfg_);
+  }
+
+  if (_internal_has_id()) {
+    // required int32 id = 3;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        this->_internal_id());
+  }
+
+  return total_size;
+}
 size_t Configure::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:ground_region.Configure)
   size_t total_size = 0;
 
-  // required .ground_region.Box box = 2;
-  if (_internal_has_box()) {
+  if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) {  // All required fields are present.
+    // required .ground_region.Box box = 2;
     total_size += 1 +
       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
         *box_);
+
+    // required .ground_region.Communication_configure communication_cfg = 4;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *communication_cfg_);
+
+    // required int32 id = 3;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        this->_internal_id());
+
+  } else {
+    total_size += RequiredFieldsByteSizeFallback();
   }
   ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
@@ -1496,8 +1916,18 @@ void Configure::MergeFrom(const Configure& from) {
   (void) cached_has_bits;
 
   lidar_.MergeFrom(from.lidar_);
-  if (from._internal_has_box()) {
-    _internal_mutable_box()->::ground_region::Box::MergeFrom(from._internal_box());
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x00000007u) {
+    if (cached_has_bits & 0x00000001u) {
+      _internal_mutable_box()->::ground_region::Box::MergeFrom(from._internal_box());
+    }
+    if (cached_has_bits & 0x00000002u) {
+      _internal_mutable_communication_cfg()->::ground_region::Communication_configure::MergeFrom(from._internal_communication_cfg());
+    }
+    if (cached_has_bits & 0x00000004u) {
+      id_ = from.id_;
+    }
+    _has_bits_[0] |= cached_has_bits;
   }
 }
 
@@ -1521,6 +1951,9 @@ bool Configure::IsInitialized() const {
   if (_internal_has_box()) {
     if (!box_->IsInitialized()) return false;
   }
+  if (_internal_has_communication_cfg()) {
+    if (!communication_cfg_->IsInitialized()) return false;
+  }
   return true;
 }
 
@@ -1529,7 +1962,12 @@ void Configure::InternalSwap(Configure* other) {
   _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   lidar_.InternalSwap(&other->lidar_);
-  swap(box_, other->box_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(Configure, id_)
+      + sizeof(Configure::id_)
+      - PROTOBUF_FIELD_OFFSET(Configure, box_)>(
+          reinterpret_cast<char*>(&box_),
+          reinterpret_cast<char*>(&other->box_));
 }
 
 ::PROTOBUF_NAMESPACE_ID::Metadata Configure::GetMetadata() const {
@@ -1549,6 +1987,9 @@ template<> PROTOBUF_NOINLINE ::ground_region::Lidar_configure* Arena::CreateMayb
 template<> PROTOBUF_NOINLINE ::ground_region::Box* Arena::CreateMaybeMessage< ::ground_region::Box >(Arena* arena) {
   return Arena::CreateMessageInternal< ::ground_region::Box >(arena);
 }
+template<> PROTOBUF_NOINLINE ::ground_region::Communication_configure* Arena::CreateMaybeMessage< ::ground_region::Communication_configure >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::ground_region::Communication_configure >(arena);
+}
 template<> PROTOBUF_NOINLINE ::ground_region::Configure* Arena::CreateMaybeMessage< ::ground_region::Configure >(Arena* arena) {
   return Arena::CreateMessageInternal< ::ground_region::Configure >(arena);
 }

+ 437 - 2
src/configure.pb.h

@@ -47,7 +47,7 @@ struct TableStruct_configure_2eproto {
     PROTOBUF_SECTION_VARIABLE(protodesc_cold);
   static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
     PROTOBUF_SECTION_VARIABLE(protodesc_cold);
-  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4]
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[5]
     PROTOBUF_SECTION_VARIABLE(protodesc_cold);
   static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
   static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
@@ -61,6 +61,9 @@ extern BoxDefaultTypeInternal _Box_default_instance_;
 class Calib_parameter;
 class Calib_parameterDefaultTypeInternal;
 extern Calib_parameterDefaultTypeInternal _Calib_parameter_default_instance_;
+class Communication_configure;
+class Communication_configureDefaultTypeInternal;
+extern Communication_configureDefaultTypeInternal _Communication_configure_default_instance_;
 class Configure;
 class ConfigureDefaultTypeInternal;
 extern ConfigureDefaultTypeInternal _Configure_default_instance_;
@@ -71,6 +74,7 @@ extern Lidar_configureDefaultTypeInternal _Lidar_configure_default_instance_;
 PROTOBUF_NAMESPACE_OPEN
 template<> ::ground_region::Box* Arena::CreateMaybeMessage<::ground_region::Box>(Arena*);
 template<> ::ground_region::Calib_parameter* Arena::CreateMaybeMessage<::ground_region::Calib_parameter>(Arena*);
+template<> ::ground_region::Communication_configure* Arena::CreateMaybeMessage<::ground_region::Communication_configure>(Arena*);
 template<> ::ground_region::Configure* Arena::CreateMaybeMessage<::ground_region::Configure>(Arena*);
 template<> ::ground_region::Lidar_configure* Arena::CreateMaybeMessage<::ground_region::Lidar_configure>(Arena*);
 PROTOBUF_NAMESPACE_CLOSE
@@ -723,6 +727,180 @@ class Box PROTOBUF_FINAL :
 };
 // -------------------------------------------------------------------
 
+class Communication_configure PROTOBUF_FINAL :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ground_region.Communication_configure) */ {
+ public:
+  inline Communication_configure() : Communication_configure(nullptr) {}
+  virtual ~Communication_configure();
+
+  Communication_configure(const Communication_configure& from);
+  Communication_configure(Communication_configure&& from) noexcept
+    : Communication_configure() {
+    *this = ::std::move(from);
+  }
+
+  inline Communication_configure& operator=(const Communication_configure& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  inline Communication_configure& operator=(Communication_configure&& from) noexcept {
+    if (GetArena() == from.GetArena()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
+  }
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+  }
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return GetMetadataStatic().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return GetMetadataStatic().reflection;
+  }
+  static const Communication_configure& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Communication_configure* internal_default_instance() {
+    return reinterpret_cast<const Communication_configure*>(
+               &_Communication_configure_default_instance_);
+  }
+  static constexpr int kIndexInFileMessages =
+    3;
+
+  friend void swap(Communication_configure& a, Communication_configure& b) {
+    a.Swap(&b);
+  }
+  inline void Swap(Communication_configure* other) {
+    if (other == this) return;
+    if (GetArena() == other->GetArena()) {
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(Communication_configure* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    InternalSwap(other);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Communication_configure* New() const final {
+    return CreateMaybeMessage<Communication_configure>(nullptr);
+  }
+
+  Communication_configure* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+    return CreateMaybeMessage<Communication_configure>(arena);
+  }
+  void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+  void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+  void CopyFrom(const Communication_configure& from);
+  void MergeFrom(const Communication_configure& from);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
+      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
+  private:
+  inline void SharedCtor();
+  inline void SharedDtor();
+  void SetCachedSize(int size) const final;
+  void InternalSwap(Communication_configure* other);
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "ground_region.Communication_configure";
+  }
+  protected:
+  explicit Communication_configure(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  public:
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
+  private:
+  static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
+    ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_configure_2eproto);
+    return ::descriptor_table_configure_2eproto.file_level_metadata[kIndexInFileMessages];
+  }
+
+  public:
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  enum : int {
+    kIpFieldNumber = 1,
+    kPortFieldNumber = 2,
+  };
+  // required string ip = 1;
+  bool has_ip() const;
+  private:
+  bool _internal_has_ip() const;
+  public:
+  void clear_ip();
+  const std::string& ip() const;
+  void set_ip(const std::string& value);
+  void set_ip(std::string&& value);
+  void set_ip(const char* value);
+  void set_ip(const char* value, size_t size);
+  std::string* mutable_ip();
+  std::string* release_ip();
+  void set_allocated_ip(std::string* ip);
+  private:
+  const std::string& _internal_ip() const;
+  void _internal_set_ip(const std::string& value);
+  std::string* _internal_mutable_ip();
+  public:
+
+  // required int32 port = 2;
+  bool has_port() const;
+  private:
+  bool _internal_has_port() const;
+  public:
+  void clear_port();
+  ::PROTOBUF_NAMESPACE_ID::int32 port() const;
+  void set_port(::PROTOBUF_NAMESPACE_ID::int32 value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::int32 _internal_port() const;
+  void _internal_set_port(::PROTOBUF_NAMESPACE_ID::int32 value);
+  public:
+
+  // @@protoc_insertion_point(class_scope:ground_region.Communication_configure)
+ private:
+  class _Internal;
+
+  // helper for ByteSizeLong()
+  size_t RequiredFieldsByteSizeFallback() const;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr ip_;
+  ::PROTOBUF_NAMESPACE_ID::int32 port_;
+  friend struct ::TableStruct_configure_2eproto;
+};
+// -------------------------------------------------------------------
+
 class Configure PROTOBUF_FINAL :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:ground_region.Configure) */ {
  public:
@@ -772,7 +950,7 @@ class Configure PROTOBUF_FINAL :
                &_Configure_default_instance_);
   }
   static constexpr int kIndexInFileMessages =
-    3;
+    4;
 
   friend void swap(Configure& a, Configure& b) {
     a.Swap(&b);
@@ -845,6 +1023,8 @@ class Configure PROTOBUF_FINAL :
   enum : int {
     kLidarFieldNumber = 1,
     kBoxFieldNumber = 2,
+    kCommunicationCfgFieldNumber = 4,
+    kIdFieldNumber = 3,
   };
   // repeated .ground_region.Lidar_configure lidar = 1;
   int lidar_size() const;
@@ -882,10 +1062,44 @@ class Configure PROTOBUF_FINAL :
       ::ground_region::Box* box);
   ::ground_region::Box* unsafe_arena_release_box();
 
+  // required .ground_region.Communication_configure communication_cfg = 4;
+  bool has_communication_cfg() const;
+  private:
+  bool _internal_has_communication_cfg() const;
+  public:
+  void clear_communication_cfg();
+  const ::ground_region::Communication_configure& communication_cfg() const;
+  ::ground_region::Communication_configure* release_communication_cfg();
+  ::ground_region::Communication_configure* mutable_communication_cfg();
+  void set_allocated_communication_cfg(::ground_region::Communication_configure* communication_cfg);
+  private:
+  const ::ground_region::Communication_configure& _internal_communication_cfg() const;
+  ::ground_region::Communication_configure* _internal_mutable_communication_cfg();
+  public:
+  void unsafe_arena_set_allocated_communication_cfg(
+      ::ground_region::Communication_configure* communication_cfg);
+  ::ground_region::Communication_configure* unsafe_arena_release_communication_cfg();
+
+  // required int32 id = 3;
+  bool has_id() const;
+  private:
+  bool _internal_has_id() const;
+  public:
+  void clear_id();
+  ::PROTOBUF_NAMESPACE_ID::int32 id() const;
+  void set_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::int32 _internal_id() const;
+  void _internal_set_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  public:
+
   // @@protoc_insertion_point(class_scope:ground_region.Configure)
  private:
   class _Internal;
 
+  // helper for ByteSizeLong()
+  size_t RequiredFieldsByteSizeFallback() const;
+
   template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
   typedef void InternalArenaConstructable_;
   typedef void DestructorSkippable_;
@@ -893,6 +1107,8 @@ class Configure PROTOBUF_FINAL :
   mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::ground_region::Lidar_configure > lidar_;
   ::ground_region::Box* box_;
+  ::ground_region::Communication_configure* communication_cfg_;
+  ::PROTOBUF_NAMESPACE_ID::int32 id_;
   friend struct ::TableStruct_configure_2eproto;
 };
 // ===================================================================
@@ -1437,6 +1653,112 @@ inline void Box::set_maxz(float value) {
 
 // -------------------------------------------------------------------
 
+// Communication_configure
+
+// required string ip = 1;
+inline bool Communication_configure::_internal_has_ip() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  return value;
+}
+inline bool Communication_configure::has_ip() const {
+  return _internal_has_ip();
+}
+inline void Communication_configure::clear_ip() {
+  ip_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline const std::string& Communication_configure::ip() const {
+  // @@protoc_insertion_point(field_get:ground_region.Communication_configure.ip)
+  return _internal_ip();
+}
+inline void Communication_configure::set_ip(const std::string& value) {
+  _internal_set_ip(value);
+  // @@protoc_insertion_point(field_set:ground_region.Communication_configure.ip)
+}
+inline std::string* Communication_configure::mutable_ip() {
+  // @@protoc_insertion_point(field_mutable:ground_region.Communication_configure.ip)
+  return _internal_mutable_ip();
+}
+inline const std::string& Communication_configure::_internal_ip() const {
+  return ip_.Get();
+}
+inline void Communication_configure::_internal_set_ip(const std::string& value) {
+  _has_bits_[0] |= 0x00000001u;
+  ip_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena());
+}
+inline void Communication_configure::set_ip(std::string&& value) {
+  _has_bits_[0] |= 0x00000001u;
+  ip_.Set(
+    &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena());
+  // @@protoc_insertion_point(field_set_rvalue:ground_region.Communication_configure.ip)
+}
+inline void Communication_configure::set_ip(const char* value) {
+  GOOGLE_DCHECK(value != nullptr);
+  _has_bits_[0] |= 0x00000001u;
+  ip_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
+              GetArena());
+  // @@protoc_insertion_point(field_set_char:ground_region.Communication_configure.ip)
+}
+inline void Communication_configure::set_ip(const char* value,
+    size_t size) {
+  _has_bits_[0] |= 0x00000001u;
+  ip_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(
+      reinterpret_cast<const char*>(value), size), GetArena());
+  // @@protoc_insertion_point(field_set_pointer:ground_region.Communication_configure.ip)
+}
+inline std::string* Communication_configure::_internal_mutable_ip() {
+  _has_bits_[0] |= 0x00000001u;
+  return ip_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+}
+inline std::string* Communication_configure::release_ip() {
+  // @@protoc_insertion_point(field_release:ground_region.Communication_configure.ip)
+  if (!_internal_has_ip()) {
+    return nullptr;
+  }
+  _has_bits_[0] &= ~0x00000001u;
+  return ip_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+}
+inline void Communication_configure::set_allocated_ip(std::string* ip) {
+  if (ip != nullptr) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  ip_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ip,
+      GetArena());
+  // @@protoc_insertion_point(field_set_allocated:ground_region.Communication_configure.ip)
+}
+
+// required int32 port = 2;
+inline bool Communication_configure::_internal_has_port() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  return value;
+}
+inline bool Communication_configure::has_port() const {
+  return _internal_has_port();
+}
+inline void Communication_configure::clear_port() {
+  port_ = 0;
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline ::PROTOBUF_NAMESPACE_ID::int32 Communication_configure::_internal_port() const {
+  return port_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::int32 Communication_configure::port() const {
+  // @@protoc_insertion_point(field_get:ground_region.Communication_configure.port)
+  return _internal_port();
+}
+inline void Communication_configure::_internal_set_port(::PROTOBUF_NAMESPACE_ID::int32 value) {
+  _has_bits_[0] |= 0x00000002u;
+  port_ = value;
+}
+inline void Communication_configure::set_port(::PROTOBUF_NAMESPACE_ID::int32 value) {
+  _internal_set_port(value);
+  // @@protoc_insertion_point(field_set:ground_region.Communication_configure.port)
+}
+
+// -------------------------------------------------------------------
+
 // Configure
 
 // repeated .ground_region.Lidar_configure lidar = 1;
@@ -1561,6 +1883,117 @@ inline void Configure::set_allocated_box(::ground_region::Box* box) {
   // @@protoc_insertion_point(field_set_allocated:ground_region.Configure.box)
 }
 
+// required int32 id = 3;
+inline bool Configure::_internal_has_id() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
+}
+inline bool Configure::has_id() const {
+  return _internal_has_id();
+}
+inline void Configure::clear_id() {
+  id_ = 0;
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline ::PROTOBUF_NAMESPACE_ID::int32 Configure::_internal_id() const {
+  return id_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::int32 Configure::id() const {
+  // @@protoc_insertion_point(field_get:ground_region.Configure.id)
+  return _internal_id();
+}
+inline void Configure::_internal_set_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+  _has_bits_[0] |= 0x00000004u;
+  id_ = value;
+}
+inline void Configure::set_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+  _internal_set_id(value);
+  // @@protoc_insertion_point(field_set:ground_region.Configure.id)
+}
+
+// required .ground_region.Communication_configure communication_cfg = 4;
+inline bool Configure::_internal_has_communication_cfg() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || communication_cfg_ != nullptr);
+  return value;
+}
+inline bool Configure::has_communication_cfg() const {
+  return _internal_has_communication_cfg();
+}
+inline void Configure::clear_communication_cfg() {
+  if (communication_cfg_ != nullptr) communication_cfg_->Clear();
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline const ::ground_region::Communication_configure& Configure::_internal_communication_cfg() const {
+  const ::ground_region::Communication_configure* p = communication_cfg_;
+  return p != nullptr ? *p : *reinterpret_cast<const ::ground_region::Communication_configure*>(
+      &::ground_region::_Communication_configure_default_instance_);
+}
+inline const ::ground_region::Communication_configure& Configure::communication_cfg() const {
+  // @@protoc_insertion_point(field_get:ground_region.Configure.communication_cfg)
+  return _internal_communication_cfg();
+}
+inline void Configure::unsafe_arena_set_allocated_communication_cfg(
+    ::ground_region::Communication_configure* communication_cfg) {
+  if (GetArena() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(communication_cfg_);
+  }
+  communication_cfg_ = communication_cfg;
+  if (communication_cfg) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:ground_region.Configure.communication_cfg)
+}
+inline ::ground_region::Communication_configure* Configure::release_communication_cfg() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::ground_region::Communication_configure* temp = communication_cfg_;
+  communication_cfg_ = nullptr;
+  if (GetArena() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+  return temp;
+}
+inline ::ground_region::Communication_configure* Configure::unsafe_arena_release_communication_cfg() {
+  // @@protoc_insertion_point(field_release:ground_region.Configure.communication_cfg)
+  _has_bits_[0] &= ~0x00000002u;
+  ::ground_region::Communication_configure* temp = communication_cfg_;
+  communication_cfg_ = nullptr;
+  return temp;
+}
+inline ::ground_region::Communication_configure* Configure::_internal_mutable_communication_cfg() {
+  _has_bits_[0] |= 0x00000002u;
+  if (communication_cfg_ == nullptr) {
+    auto* p = CreateMaybeMessage<::ground_region::Communication_configure>(GetArena());
+    communication_cfg_ = p;
+  }
+  return communication_cfg_;
+}
+inline ::ground_region::Communication_configure* Configure::mutable_communication_cfg() {
+  // @@protoc_insertion_point(field_mutable:ground_region.Configure.communication_cfg)
+  return _internal_mutable_communication_cfg();
+}
+inline void Configure::set_allocated_communication_cfg(::ground_region::Communication_configure* communication_cfg) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+  if (message_arena == nullptr) {
+    delete communication_cfg_;
+  }
+  if (communication_cfg) {
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+      ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(communication_cfg);
+    if (message_arena != submessage_arena) {
+      communication_cfg = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
+          message_arena, communication_cfg, submessage_arena);
+    }
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  communication_cfg_ = communication_cfg;
+  // @@protoc_insertion_point(field_set_allocated:ground_region.Configure.communication_cfg)
+}
+
 #ifdef __GNUC__
   #pragma GCC diagnostic pop
 #endif  // __GNUC__
@@ -1570,6 +2003,8 @@ inline void Configure::set_allocated_box(::ground_region::Box* box) {
 
 // -------------------------------------------------------------------
 
+// -------------------------------------------------------------------
+
 
 // @@protoc_insertion_point(namespace_scope)
 

+ 9 - 0
src/configure.proto

@@ -30,7 +30,16 @@ message Box
 
 }
 
+message Communication_configure
+{
+    required string         ip=1;
+    required int32          port=2;
+}
+
 message Configure {
     repeated Lidar_configure     lidar=1;
     required Box                box=2;
+    required int32              id=3;
+    required Communication_configure     communication_cfg=4;
 }
+

+ 32 - 169
src/error_code/error_code.h

@@ -43,179 +43,42 @@ enum Empty_status
 enum Error_code
 {
     //成功,没有错误,默认值0
-    SUCCESS                         = 0x00000000,
+    SUCCESS = 0x00000000,
 
 
     //基本错误码,
-    ERROR                           = 0x00000001,//错误
-    PARTIAL_SUCCESS                 = 0x00000002,//部分成功
-    WARNING                         = 0x00000003,//警告
-    FAILED                          = 0x00000004,//失败
-
-    NODATA                          = 0x00000010,//没有数据,传入参数容器内部没有数据时,
-
-    POINTER_IS_NULL                 = 0x00000101,//空指针
-    PARAMETER_ERROR                 = 0x00000102,//参数错误,传入参数不符合规范时,
-    POINTER_MALLOC_FAIL             = 0x00000103,//手动分配内存失败
-
-    CLASS_BASE_FUNCTION_CANNOT_USE  = 0x00000201,//基类函数不允许使用,必须使用子类的
-
-
-//    错误码的规范,
-//    错误码是int型,32位,十六进制。
-//    例如0x12345678
-//    12表示功能模块,例如:laser雷达模块               框架制定
-//    34表示文件名称,例如:laser_livox.cpp             框架制定
-//    56表示具体的类,例如:class laser_livox           个人制定
-//    78表示类的函数,例如:laser_livox::start();       个人制定
-//    注:错误码的制定从1开始,不要从0开始,
-//        0用作错误码的基数,用来位运算,来判断错误码的范围。
-
-//    laser扫描模块
-    LASER_ERROR_BASE                = 0x01000000,
-
-//    laser_base基类
-	LASER_BASE_ERROR_BASE			= 0x01010000,
-    LASER_TASK_PARAMETER_ERROR      = 0x01010001,   //雷达任务输入参数错误
-    LASER_CONNECT_FAILED,
-	LASER_START_FAILED,
-	LASER_CHECK_FAILED				,
-	LASER_STATUS_ERROR,								//雷达状态错误
-
-
-    LASER_LIVOX_SKD_INIT_FAILED,
-
-
-//    laser_livox.cpp的错误码
-    LIVOX_ERROR_BASE                = 0x01020000,
-    LIVOX_START_FAILE               = 0x01020101,
-	LIVOX_TASK_TYPE_ERROR,							//livox任务类型错误
-
-
-     //PLC error code  ...
-    PLC_ERROR_BASE                  = 0x02010000,
-    PLC_UNKNOWN_ERROR,
-    PLC_EMPTY_TASK,
-    PLC_IP_PORT_ERROR,
-    PLC_SLAVE_ID_ERROR,
-    PLC_CONNECTION_FAILED,
-    PLC_READ_FAILED,
-    PLC_WRITE_FAILED,
-    PLC_NOT_ENOUGH_DATA_ERROR,
-
-    //Locater.cpp error from 0x0301000-0x030100FF
-        LOCATER_TASK_INIT_CLOUD_EMPTY=0x03010000,
-    LOCATER_TASK_ERROR,
-    LOCATER_TASK_INPUT_CLOUD_UNINIT,
-    LOCATER_INPUT_CLOUD_EMPTY,
-    LOCATER_YOLO_UNINIT,
-    LOCATER_POINTSIFT_UNINIT,
-    LOCATER_3DCNN_UNINIT,
-    LOCATER_INPUT_YOLO_CLOUD_EMPTY,
-    LOCATER_Y_OUT_RANGE_BY_PLC,
-    LOCATER_MEASURE_HEIGHT_CLOUD_UNINIT,
-    LOCATER_MEASURE_HEIGHT_CLOUD_EMPTY,
-    LOCATER_INPUT_CLOUD_UNINIT,
-
-
-    //point sift from 0x03010100-0x030101FF
-        LOCATER_SIFT_INIT_FAILED=0x03010100,
-    LOCATER_SIFT_INPUT_CLOUD_UNINIT,
-    LOCATER_SIFT_PREDICT_FAILED,
-    LOCATER_SIFT_CREATE_INPUT_DATA_FAILED,
-    LOCATER_SIFT_FILTE_OBS_FAILED,
-    LOCATER_SIFT_INPUT_BOX_PARAMETER_FAILED,
-    LOCATER_SIFT_INPUT_CLOUD_EMPTY,
-    LOCATER_SIFT_PREDICT_NO_CAR_POINT,
-
-    //yolo from 0x03010200-0x030102FF
-        LOCATER_YOLO_DETECT_FAILED=0x03010200,
-    LOCATER_YOLO_DETECT_NO_TARGET,
-    LOCATER_YOLO_PARAMETER_INVALID,
-    LOCATER_YOLO_INPUT_CLOUD_UNINIT,
-
-    //3dcnn from 0x03010300-0x030103FF
-    LOCATER_3DCNN_INIT_FAILED=0x03010300,
-    LOCATER_3DCNN_INPUT_CLOUD_UNINIT,
-    LOCATER_3DCNN_PREDICT_FAILED,
-    LOCATER_3DCNN_VERIFY_RECT_FAILED_3,
-    LOCATER_3DCNN_VERIFY_RECT_FAILED_4,
-    LOCATER_3DCNN_KMEANS_FAILED,
-    LOCATER_3DCNN_IIU_FAILED,
-    LOCATER_3DCNN_INPUT_CLOUD_EMPTY,
-    LOCATER_3DCNN_PCA_OUT_CLOUD_EMPTY,
-
-    //System_manager error from 0x04010000-0x0401FFFF
-    SYSTEM_READ_PARAMETER_ERROR=0x04010100,
-    SYSTEM_PARAMETER_ERROR,
-    SYSTEM_INPUT_TERMINOR_NO_LASERS,
-
-    //terminor_command_executor.cpp from 0x04010200-0x040102FF
-    TERMINOR_NOT_READY=0x04010200,
-    TERMINOR_INPUT_LASER_NULL,
-    TERMINOR_NOT_CONTAINS_LASER,
-    TERMINOR_INPUT_PLC_NULL,
-    TERMINOR_INPUT_LOCATER_NULL,
-    TERMINOR_CREATE_WORKING_THREAD_FAILED,
-    TERMINOR_FORCE_QUIT,
-    TERMINOR_LASER_TIMEOUT,
-    TERMINOR_POST_PLC_TIMEOUT,
-    TERMINOR_CHECK_RESULTS_ERROR,
-
-    ////Hardware limit from 0x05010000 - 0x0501ffff
-    ///railing.cpp from 0x05010100-0x050101ff
-    HARDWARE_LIMIT_LEFT_RAILING=0x05010100,         //左栏杆限制
-    HARDWARE_LIMIT_RAILING_PARAMETER_ERROR,
-    HARDWARE_LIMIT_RAILING_ERROR,
-    HARDWARE_LIMIT_CENTER_X_LEFT,
-    HARDWARE_LIMIT_CENTER_X_RIGHT,
-    HARDWARE_LIMIT_CENTER_Y_TOP,
-    HARDWARE_LIMIT_CENTER_Y_BOTTOM,
-    HARDWARE_LIMIT_HEIGHT_OUT_RANGE,
-    HARDWARE_LIMIT_ANGLE_OUT_RANGE,
-    //termonal_limit from 0x05010200-0x050102ff
-    HARDWARE_LIMIT_TERMINAL_LEFT_ERROR,
-    HARDWARE_LIMIT_TERMINAL_RIGHT_ERROR,
-    HARDWARE_LIMIT_TERMINAL_LR_ERROR,
-
-
-    //wj_lidar error from 0x06010000-0x0601FFFF
-        WJ_LIDAR_CONNECT_FAILED=0x06010000,
-    WJ_LIDAR_UNINITIALIZED,
-    WJ_LIDAR_READ_FAILED,
-    WJ_LIDAR_WRITE_FAILED,
-    WJ_LIDAR_GET_CLOUD_TIMEOUT,
-
-    //wj lidar protocol error from 0x06020000-0x0602FFFF
-        WJ_PROTOCOL_ERROR_BASE=0x06020000,
-    WJ_PROTOCOL_INTEGRITY_ERROR,
-    WJ_PROTOCOL_PARSE_FAILED,
-    WJ_PROTOCOL_EMPTY_PACKAGE,
-    WJ_PROTOCOL_EXCEED_MAX_SIZE,
-
-    //wj region detect error from 0x06030000-0x0603FFFF
-        WJ_REGION_EMPTY_CLOUD=0x06030000,
-    WJ_REGION_RECTANGLE_ANGLE_ERROR,
-    WJ_REGION_RECTANGLE_SIZE_ERROR,
-    WJ_REGION_RECTANGLE_SYMMETRY_ERROR,
-    WJ_REGION_CLUSTER_SIZE_ERROR,
-    WJ_REGION_CERES_SOLVE_ERROR,
-
-    //wj manager error from 0x06040000-0x0604FFFF
-    WJ_MANAGER_UNINITIALIZED=0x06040000,
-    WJ_MANAGER_LIDAR_DISCONNECTED,
-    WJ_MANAGER_PLC_DISCONNECTED,
-    WJ_MANAGER_EMPTY_CLOUD,
-
-    WJ_LIDAR_TASK_EMPTY_RESULT=0x06050000,
-    WJ_LIDAR_TASK_EMPTY_TASK,
-    WJ_LIDAR_TASK_WRONG_TYPE,
-    WJ_LIDAR_TASK_INVALID_TASK,
-    WJ_LIDAR_TASK_MEASURE_FAILED,
-
-    WJ_FILTER_LACK_OF_RESULT,
-    WJ_FILTER_FLUCTUATING,
+    FAILED = 0x00000001,//失败
+    ERROR = 0x00000002,//错误
+    WARNING = 0x00000003,//警告
+    PARTIAL_SUCCESS = 0x00000002,//部分成功
 
+    INVALID_MESSAGE = 0x00000011, //无效的消息,
+    RESPONSE_TIMEOUT = 0x00000012,
+    PAUSE = 0x00000013,   //急停
+    TASK_CANCEL = 0x00000014,   //任务取消
+
+    DISCONNECT = 0x00000020,   //通讯中断/断开连接
+    UNKNOW_STATU = 0x00000021,   //未知状态
+
+    POINTER_IS_NULL = 0x00000101,//空指针
+    PARAMETER_ERROR = 0x00000102,//参数错误,传入参数不符合规范时,
+    POINTER_MALLOC_FAIL = 0x00000103,//手动分配内存失败
+
+    CLASS_BASE_FUNCTION_CANNOT_USE = 0x00000201,//基类函数不允许使用,必须使用子类的
+
+    CONTAINER_IS_TERMINATE = 0x00000301,//容器被终止
+
+    POINT_EMPTY=0x00000302,
+    CLOUD_INCOMPLETED,                  //点云不完整,某个雷达缺点
+
+
+    //Communication module, 通信模块
+            COMMUNICATION_BASE_ERROR_BASE = 0x11010000,
+    COMMUNICATION_READ_PROTOBUF_ERROR,                //模块,读取参数错误
+    COMMUNICATION_BIND_ERROR,
+    COMMUNICATION_CONNECT_ERROR,
+    COMMUNICATION_ANALYSIS_TIME_OUT,                                    //解析超时,
+    COMMUNICATION_EXCUTER_IS_BUSY                                    //处理器正忙, 请稍等
 };
 
 //错误等级,用来做故障处理

+ 156 - 42
src/ground_region.cpp

@@ -8,7 +8,7 @@
 #include <pcl/filters/voxel_grid.h>
 #include <pcl/segmentation/extract_clusters.h>
 #include <fcntl.h>
-
+#include "publisher.h"
 //欧式聚类*******************************************************
 std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> Ground_region::segmentation(pcl::PointCloud<pcl::PointXYZ>::Ptr sor_cloud)
 {
@@ -284,8 +284,15 @@ Error_manager Ground_region::init(std::string configure_file)
 }
 Error_manager Ground_region::init(ground_region::Configure configure)
 {
+    //绑定通讯ip
+    char connect_str[255]={0};
+    sprintf(connect_str,"tcp://%s:%d",configure.communication_cfg().ip().c_str(),
+            configure.communication_cfg().port());
+    Publisher::get_instance_pointer()->communication_bind(connect_str);
+    Publisher::get_instance_pointer()->communication_run();
+
     //创建雷达
-    /*m_lidars.resize(configure.lidar_size());
+    m_lidars.resize(configure.lidar_size());
     for(int i=0;i<configure.lidar_size();++i)
     {
         const boost::asio::ip::address address = boost::asio::ip::address::from_string( configure.lidar(i).ip() );
@@ -296,7 +303,10 @@ Error_manager Ground_region::init(ground_region::Configure configure)
             sprintf(description,"lidar [%d] open failed  ip:%s ,port:%d",i,configure.lidar(i).ip().c_str(),port);
             return Error_manager(FAILED,NORMAL,description);
         }
-    }*/
+    }
+
+
+
     m_configure=configure;
     m_running_thread=new std::thread(std::bind(thread_measure_func,this));
     return SUCCESS;
@@ -337,11 +347,11 @@ pcl::PointCloud<pcl::PointXYZ>::Ptr Ground_region::scans2cloud(const velodyne::F
     return cloud_transpose;
 }
 
-Error_manager Ground_region::sync_capture(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,double timeout_second)
+Error_manager Ground_region::sync_capture(std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr>& clouds,double timeout_second)
 {
     Tick timer;
     bool sync=false;
-    pcl::PointCloud<pcl::PointXYZ>::Ptr sync_cloud(new pcl::PointCloud<pcl::PointXYZ>);
+    clouds.clear();
     std::vector<velodyne::Frame>  sync_frames;
     while((false==m_exit_condition.wait_for_ex(std::chrono::microseconds(1))) && sync==false)
     {
@@ -372,7 +382,8 @@ Error_manager Ground_region::sync_capture(pcl::PointCloud<pcl::PointXYZ>::Ptr cl
     {
         for(int i=0;i<sync_frames.size();++i)
         {
-            *sync_cloud+=(*scans2cloud(sync_frames[i],m_configure.lidar(i).calib()));
+            pcl::PointCloud<pcl::PointXYZ>::Ptr cloud=(scans2cloud(sync_frames[i],m_configure.lidar(i).calib()));
+            clouds.push_back(cloud);
         }
         return SUCCESS;
     }
@@ -380,54 +391,80 @@ Error_manager Ground_region::sync_capture(pcl::PointCloud<pcl::PointXYZ>::Ptr cl
 
 }
 
-void Ground_region::thread_measure_func(Ground_region* p)
+Error_manager Ground_region::prehandle_cloud(std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr>& clouds,
+                                             message::Ground_measure_statu_msg& msg)
 {
-    return ;
-    //保持 10 fps
-    while(false==p->m_exit_condition.wait_for_millisecond(100))
+    if(msg.laser_statu_vector_size()!=m_lidars.size())
+        return ERROR;
+    //直通滤波
+    ground_region::Box box = m_configure.box();
+    std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> filtered_cloud_vector;
+    for (int i = 0; i < clouds.size(); ++i)
     {
-        pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
-        Error_manager code=p->sync_capture(cloud,0.5);
-
-        if(code!=SUCCESS)
+        pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZ>);
+        for (int j = 0; j < clouds[i]->size(); ++j)
         {
-            std::cout<<code.get_error_description()<<std::endl;
-            continue;
+            pcl::PointXYZ pt = clouds[i]->points[j];
+            if (pt.x > box.minx() && pt.x < box.maxx()
+                    && pt.y > box.miny() && pt.y < box.maxy()
+                    && pt.z > box.minz() && pt.z < box.maxz())
+            {
+                cloud_filtered->push_back(pt);
+            }
         }
+        filtered_cloud_vector.push_back(cloud_filtered);
+    }
+    //根据点云判断雷达状态,若所有雷达滤波后都有点, 则正常,lidar_statu_bit 各个位代表雷达是否有点, 有点为0,无点为1
+    int lidar_statu_bit = 0;
+    for (int i = 0; i < filtered_cloud_vector.size(); ++i)
+    {
+        if (filtered_cloud_vector[i]->size() == 0)
+            lidar_statu_bit |= (0x01 << i);
+        else
+            msg.set_laser_statu_vector(i, message::LASER_READY);//雷达正常
+    }
+    if (lidar_statu_bit == 0)
+    {
+        clouds = filtered_cloud_vector;
+        return SUCCESS;
+    }
 
-        detect_wheel_ceres::Detect_result result;
-
-        code=p->detect(cloud,p->m_configure.box(),result);
-        if(code!=SUCCESS)
+    //判断是否有雷达故障
+    for (int i = 0; i < filtered_cloud_vector.size(); ++i)
+    {
+        if (filtered_cloud_vector[i]->size() == 0)
         {
-            LOG_EVERY_N(INFO,20)<<code.get_error_description();
-            continue;
+            //滤波之前也没有点,雷达故障
+            if (clouds[i]->size() == 0)
+            {
+                clouds = filtered_cloud_vector;
+                msg.set_laser_statu_vector(i, message::LASER_DISCONNECT);
+                return Error_manager(DISCONNECT, NORMAL, "雷达故障");
+            }
         }
-
-        //  tobe 发布结果
-
-
-
     }
-}
+    //判断是不是所有雷达在该区域都没有点,表示该区域没有东西
+    int temp = 0;
+    if (~(((~temp) << (filtered_cloud_vector.size())) | lidar_statu_bit) == 0)
+    {
+        clouds = filtered_cloud_vector;
+        return Error_manager(POINT_EMPTY, NORMAL, "区域无点");
+    }
+    else
+    {
+        clouds = filtered_cloud_vector;
+        return Error_manager(CLOUD_INCOMPLETED, NORMAL, "点云不完整(雷达正常)");
+    }
 
+}
 
 
 Error_manager Ground_region::detect(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,
-        const ground_region::Box& box,detect_wheel_ceres::Detect_result& last_result)
+                                    const ground_region::Box& box,detect_wheel_ceres::Detect_result& last_result)
 {
-    //直通滤波
-    pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZ>);
-    for(int i=0;i<cloud->size();++i)
-    {
-        pcl::PointXYZ pt=cloud->points[i];
-        if(pt.x>box.minx() && pt.x<box.maxx()
-            && pt.y>box.miny() && pt.y<box.maxy()
-            && pt.z>box.minz() && pt.z<box.maxz())
-        {
-            cloud_filtered->push_back(pt);
-        }
-    }
+    if(cloud->size()==0)
+        return Error_manager(POINT_EMPTY,NORMAL,"no point");
+
 
     float start_z=box.minz();
     float max_z=0.2;
@@ -467,4 +504,81 @@ Error_manager Ground_region::detect(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,
     ///  to be
     last_result=results[results.size()-1];
     return SUCCESS;
-}
+}
+
+#include "message_base.pb.h"
+void Ground_region::thread_measure_func(Ground_region* p)
+{
+    message::Ground_measure_statu_msg msg;
+    message::Base_info base_info;
+    base_info.set_msg_type(message::eGround_measure_statu_msg);
+    base_info.set_sender(message::eEmpty);
+    base_info.set_receiver(message::eEmpty);
+    msg.mutable_base_info()->CopyFrom(base_info);
+    msg.set_ground_statu(message::Nothing);
+    const float fps=10.;
+    //保持 10 fps
+    while(false==p->m_exit_condition.wait_for_millisecond(int(1000./fps)))
+    {
+        for(int i=0;i<p->m_lidars.size();++i)
+        {
+            msg.add_laser_statu_vector(
+                    p->m_lidars[i]->isRun()?message::LASER_READY:message::LASER_DISCONNECT);
+        }
+
+        std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> clouds;
+        Error_manager code=p->sync_capture(clouds,0.5);
+        if(code!=SUCCESS)
+        {
+            LOG(WARNING)<<code.get_error_description();
+            continue;
+        }
+
+        Tick tick;
+        code=p->prehandle_cloud(clouds,msg);
+        if(code!=SUCCESS)
+        {
+            LOG(WARNING)<<code.get_error_description();
+            continue;
+        }
+        detect_wheel_ceres::Detect_result result;
+        pcl::PointCloud<pcl::PointXYZ>::Ptr correct_cloud(new pcl::PointCloud<pcl::PointXYZ>);
+        for(int i=0;i<clouds.size();++i)
+        {
+            *correct_cloud+=(*clouds[i]);
+        }
+        code=p->detect(correct_cloud,p->m_configure.box(),result);
+
+        if(tick.tic()>1./fps)
+        {
+            LOG(WARNING)<<" detect fps < capture fps";
+        }
+        if(code!=SUCCESS)
+        {
+            LOG_EVERY_N(INFO,20)<<code.get_error_description();
+            continue;
+        }
+
+        //  to be 发布结果
+        msg.set_ground_statu(message::Car_correct);
+        message::Locate_information locate_information;
+        locate_information.set_locate_x(result.cx);
+        locate_information.set_locate_y(result.cy);
+        locate_information.set_locate_angle(result.theta);
+        locate_information.set_locate_wheel_base(result.wheel_base);
+        locate_information.set_locate_length(result.wheel_base);
+        locate_information.set_locate_wheel_width(result.width);
+        locate_information.set_locate_width(result.body_width);
+        locate_information.set_locate_front_theta(result.front_theta);
+        locate_information.set_locate_correct(true);
+
+        Communication_message c_msg;
+        c_msg.reset(msg.base_info(),msg.SerializeAsString());
+        Publisher::get_instance_pointer()->publish_msg(&c_msg);
+
+
+    }
+}
+
+
+

+ 6 - 2
src/ground_region.h

@@ -23,6 +23,7 @@ using google::protobuf::Message;
 
 #include <pcl/point_types.h>
 #include <pcl/point_cloud.h>
+#include "ground_measure_msg.pb.h"
 
 class Ground_region
 {
@@ -37,9 +38,12 @@ class Ground_region
 
  private:
     bool read_proto_param(std::string file, ::google::protobuf::Message& parameter);
-    Error_manager sync_capture(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,double timeout_second=1.0);
+    Error_manager sync_capture(std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr>& cloud,double timeout_second=1.0);
     pcl::PointCloud<pcl::PointXYZ>::Ptr scans2cloud(const velodyne::Frame& frame,const ground_region::Calib_parameter& calib);
 
+    //预处理点云, 并并判断雷达状态
+    Error_manager prehandle_cloud(std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr>& clouds,
+            message::Ground_measure_statu_msg& msg);
     bool classify_ceres_detect(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,double thresh_z,
                                detect_wheel_ceres::Detect_result& result);
 
@@ -51,6 +55,7 @@ class Ground_region
     double distance(cv::Point2f p1, cv::Point2f p2);
     bool isRect(std::vector<cv::Point2f>& points);
  private:
+
     std::vector<velodyne::VLP16Capture*>     m_lidars;
     ground_region::Configure                m_configure;
     std::thread*                            m_running_thread;
@@ -58,7 +63,6 @@ class Ground_region
 
     detect_wheel_ceres                      m_detector;
 
-
 };
 
 

+ 579 - 0
src/message/ground_measure_msg.pb.cc

@@ -0,0 +1,579 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: ground_measure_msg.proto
+
+#include "ground_measure_msg.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/wire_format_lite.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/reflection_ops.h>
+#include <google/protobuf/wire_format.h>
+// @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+extern PROTOBUF_INTERNAL_EXPORT_message_5fbase_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Base_info_message_5fbase_2eproto;
+extern PROTOBUF_INTERNAL_EXPORT_message_5fbase_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Locate_information_message_5fbase_2eproto;
+namespace message {
+class Ground_measure_statu_msgDefaultTypeInternal {
+ public:
+  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Ground_measure_statu_msg> _instance;
+} _Ground_measure_statu_msg_default_instance_;
+}  // namespace message
+static void InitDefaultsscc_info_Ground_measure_statu_msg_ground_5fmeasure_5fmsg_2eproto() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  {
+    void* ptr = &::message::_Ground_measure_statu_msg_default_instance_;
+    new (ptr) ::message::Ground_measure_statu_msg();
+    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
+  }
+  ::message::Ground_measure_statu_msg::InitAsDefaultInstance();
+}
+
+::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Ground_measure_statu_msg_ground_5fmeasure_5fmsg_2eproto =
+    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_Ground_measure_statu_msg_ground_5fmeasure_5fmsg_2eproto}, {
+      &scc_info_Base_info_message_5fbase_2eproto.base,
+      &scc_info_Locate_information_message_5fbase_2eproto.base,}};
+
+static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_ground_5fmeasure_5fmsg_2eproto[1];
+static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_ground_5fmeasure_5fmsg_2eproto[2];
+static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_ground_5fmeasure_5fmsg_2eproto = nullptr;
+
+const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_ground_5fmeasure_5fmsg_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  PROTOBUF_FIELD_OFFSET(::message::Ground_measure_statu_msg, _has_bits_),
+  PROTOBUF_FIELD_OFFSET(::message::Ground_measure_statu_msg, _internal_metadata_),
+  ~0u,  // no _extensions_
+  ~0u,  // no _oneof_case_
+  ~0u,  // no _weak_field_map_
+  PROTOBUF_FIELD_OFFSET(::message::Ground_measure_statu_msg, base_info_),
+  PROTOBUF_FIELD_OFFSET(::message::Ground_measure_statu_msg, id_),
+  PROTOBUF_FIELD_OFFSET(::message::Ground_measure_statu_msg, laser_statu_vector_),
+  PROTOBUF_FIELD_OFFSET(::message::Ground_measure_statu_msg, ground_statu_),
+  PROTOBUF_FIELD_OFFSET(::message::Ground_measure_statu_msg, locate_information_realtime_),
+  0,
+  2,
+  ~0u,
+  3,
+  1,
+};
+static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
+  { 0, 10, sizeof(::message::Ground_measure_statu_msg)},
+};
+
+static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
+  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::message::_Ground_measure_statu_msg_default_instance_),
+};
+
+const char descriptor_table_protodef_ground_5fmeasure_5fmsg_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
+  "\n\030ground_measure_msg.proto\022\007message\032\022mes"
+  "sage_base.proto\"\356\001\n\030Ground_measure_statu"
+  "_msg\022%\n\tbase_info\030\001 \002(\0132\022.message.Base_i"
+  "nfo\022\n\n\002id\030\002 \002(\005\0220\n\022laser_statu_vector\030\003 "
+  "\003(\0162\024.message.Laser_statu\022+\n\014ground_stat"
+  "u\030\004 \002(\0162\025.message.Ground_statu\022@\n\033locate"
+  "_information_realtime\030\005 \001(\0132\033.message.Lo"
+  "cate_information*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\013LASER_FAULT\020\003*\201\001\n\014Ground_statu"
+  "\022\013\n\007Nothing\020\000\022\t\n\005Noise\020\001\022\017\n\013Car_correct\020"
+  "\002\022\020\n\014Car_left_out\020\003\022\021\n\rCar_right_out\020\004\022\017"
+  "\n\013Car_top_out\020\005\022\022\n\016Car_bottom_out\020\006"
+  ;
+static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_ground_5fmeasure_5fmsg_2eproto_deps[1] = {
+  &::descriptor_table_message_5fbase_2eproto,
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_ground_5fmeasure_5fmsg_2eproto_sccs[1] = {
+  &scc_info_Ground_measure_statu_msg_ground_5fmeasure_5fmsg_2eproto.base,
+};
+static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_ground_5fmeasure_5fmsg_2eproto_once;
+const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ground_5fmeasure_5fmsg_2eproto = {
+  false, false, descriptor_table_protodef_ground_5fmeasure_5fmsg_2eproto, "ground_measure_msg.proto", 515,
+  &descriptor_table_ground_5fmeasure_5fmsg_2eproto_once, descriptor_table_ground_5fmeasure_5fmsg_2eproto_sccs, descriptor_table_ground_5fmeasure_5fmsg_2eproto_deps, 1, 1,
+  schemas, file_default_instances, TableStruct_ground_5fmeasure_5fmsg_2eproto::offsets,
+  file_level_metadata_ground_5fmeasure_5fmsg_2eproto, 1, file_level_enum_descriptors_ground_5fmeasure_5fmsg_2eproto, file_level_service_descriptors_ground_5fmeasure_5fmsg_2eproto,
+};
+
+// Force running AddDescriptors() at dynamic initialization time.
+static bool dynamic_init_dummy_ground_5fmeasure_5fmsg_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_ground_5fmeasure_5fmsg_2eproto)), true);
+namespace message {
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Laser_statu_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_ground_5fmeasure_5fmsg_2eproto);
+  return file_level_enum_descriptors_ground_5fmeasure_5fmsg_2eproto[0];
+}
+bool Laser_statu_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+      return true;
+    default:
+      return false;
+  }
+}
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Ground_statu_descriptor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_ground_5fmeasure_5fmsg_2eproto);
+  return file_level_enum_descriptors_ground_5fmeasure_5fmsg_2eproto[1];
+}
+bool Ground_statu_IsValid(int value) {
+  switch (value) {
+    case 0:
+    case 1:
+    case 2:
+    case 3:
+    case 4:
+    case 5:
+    case 6:
+      return true;
+    default:
+      return false;
+  }
+}
+
+
+// ===================================================================
+
+void Ground_measure_statu_msg::InitAsDefaultInstance() {
+  ::message::_Ground_measure_statu_msg_default_instance_._instance.get_mutable()->base_info_ = const_cast< ::message::Base_info*>(
+      ::message::Base_info::internal_default_instance());
+  ::message::_Ground_measure_statu_msg_default_instance_._instance.get_mutable()->locate_information_realtime_ = const_cast< ::message::Locate_information*>(
+      ::message::Locate_information::internal_default_instance());
+}
+class Ground_measure_statu_msg::_Internal {
+ public:
+  using HasBits = decltype(std::declval<Ground_measure_statu_msg>()._has_bits_);
+  static const ::message::Base_info& base_info(const Ground_measure_statu_msg* msg);
+  static void set_has_base_info(HasBits* has_bits) {
+    (*has_bits)[0] |= 1u;
+  }
+  static void set_has_id(HasBits* has_bits) {
+    (*has_bits)[0] |= 4u;
+  }
+  static void set_has_ground_statu(HasBits* has_bits) {
+    (*has_bits)[0] |= 8u;
+  }
+  static const ::message::Locate_information& locate_information_realtime(const Ground_measure_statu_msg* msg);
+  static void set_has_locate_information_realtime(HasBits* has_bits) {
+    (*has_bits)[0] |= 2u;
+  }
+  static bool MissingRequiredFields(const HasBits& has_bits) {
+    return ((has_bits[0] & 0x0000000d) ^ 0x0000000d) != 0;
+  }
+};
+
+const ::message::Base_info&
+Ground_measure_statu_msg::_Internal::base_info(const Ground_measure_statu_msg* msg) {
+  return *msg->base_info_;
+}
+const ::message::Locate_information&
+Ground_measure_statu_msg::_Internal::locate_information_realtime(const Ground_measure_statu_msg* msg) {
+  return *msg->locate_information_realtime_;
+}
+void Ground_measure_statu_msg::clear_base_info() {
+  if (base_info_ != nullptr) base_info_->Clear();
+  _has_bits_[0] &= ~0x00000001u;
+}
+void Ground_measure_statu_msg::clear_locate_information_realtime() {
+  if (locate_information_realtime_ != nullptr) locate_information_realtime_->Clear();
+  _has_bits_[0] &= ~0x00000002u;
+}
+Ground_measure_statu_msg::Ground_measure_statu_msg(::PROTOBUF_NAMESPACE_ID::Arena* arena)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena),
+  laser_statu_vector_(arena) {
+  SharedCtor();
+  RegisterArenaDtor(arena);
+  // @@protoc_insertion_point(arena_constructor:message.Ground_measure_statu_msg)
+}
+Ground_measure_statu_msg::Ground_measure_statu_msg(const Ground_measure_statu_msg& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message(),
+      _has_bits_(from._has_bits_),
+      laser_statu_vector_(from.laser_statu_vector_) {
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  if (from._internal_has_base_info()) {
+    base_info_ = new ::message::Base_info(*from.base_info_);
+  } else {
+    base_info_ = nullptr;
+  }
+  if (from._internal_has_locate_information_realtime()) {
+    locate_information_realtime_ = new ::message::Locate_information(*from.locate_information_realtime_);
+  } else {
+    locate_information_realtime_ = nullptr;
+  }
+  ::memcpy(&id_, &from.id_,
+    static_cast<size_t>(reinterpret_cast<char*>(&ground_statu_) -
+    reinterpret_cast<char*>(&id_)) + sizeof(ground_statu_));
+  // @@protoc_insertion_point(copy_constructor:message.Ground_measure_statu_msg)
+}
+
+void Ground_measure_statu_msg::SharedCtor() {
+  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Ground_measure_statu_msg_ground_5fmeasure_5fmsg_2eproto.base);
+  ::memset(&base_info_, 0, static_cast<size_t>(
+      reinterpret_cast<char*>(&ground_statu_) -
+      reinterpret_cast<char*>(&base_info_)) + sizeof(ground_statu_));
+}
+
+Ground_measure_statu_msg::~Ground_measure_statu_msg() {
+  // @@protoc_insertion_point(destructor:message.Ground_measure_statu_msg)
+  SharedDtor();
+  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+void Ground_measure_statu_msg::SharedDtor() {
+  GOOGLE_DCHECK(GetArena() == nullptr);
+  if (this != internal_default_instance()) delete base_info_;
+  if (this != internal_default_instance()) delete locate_information_realtime_;
+}
+
+void Ground_measure_statu_msg::ArenaDtor(void* object) {
+  Ground_measure_statu_msg* _this = reinterpret_cast< Ground_measure_statu_msg* >(object);
+  (void)_this;
+}
+void Ground_measure_statu_msg::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
+}
+void Ground_measure_statu_msg::SetCachedSize(int size) const {
+  _cached_size_.Set(size);
+}
+const Ground_measure_statu_msg& Ground_measure_statu_msg::default_instance() {
+  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Ground_measure_statu_msg_ground_5fmeasure_5fmsg_2eproto.base);
+  return *internal_default_instance();
+}
+
+
+void Ground_measure_statu_msg::Clear() {
+// @@protoc_insertion_point(message_clear_start:message.Ground_measure_statu_msg)
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  laser_statu_vector_.Clear();
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000003u) {
+    if (cached_has_bits & 0x00000001u) {
+      GOOGLE_DCHECK(base_info_ != nullptr);
+      base_info_->Clear();
+    }
+    if (cached_has_bits & 0x00000002u) {
+      GOOGLE_DCHECK(locate_information_realtime_ != nullptr);
+      locate_information_realtime_->Clear();
+    }
+  }
+  if (cached_has_bits & 0x0000000cu) {
+    ::memset(&id_, 0, static_cast<size_t>(
+        reinterpret_cast<char*>(&ground_statu_) -
+        reinterpret_cast<char*>(&id_)) + sizeof(ground_statu_));
+  }
+  _has_bits_.Clear();
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* Ground_measure_statu_msg::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  _Internal::HasBits has_bits{};
+  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
+  while (!ctx->Done(&ptr)) {
+    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
+    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
+    CHK_(ptr);
+    switch (tag >> 3) {
+      // required .message.Base_info base_info = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+          ptr = ctx->ParseMessage(_internal_mutable_base_info(), ptr);
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      // required int32 id = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
+          _Internal::set_has_id(&has_bits);
+          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      // repeated .message.Laser_statu laser_statu_vector = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
+          ptr -= 1;
+          do {
+            ptr += 1;
+            ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+            CHK_(ptr);
+            if (PROTOBUF_PREDICT_TRUE(::message::Laser_statu_IsValid(val))) {
+              _internal_add_laser_statu_vector(static_cast<::message::Laser_statu>(val));
+            } else {
+              ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
+            }
+            if (!ctx->DataAvailable(ptr)) break;
+          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr));
+        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26) {
+          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(_internal_mutable_laser_statu_vector(), ptr, ctx, ::message::Laser_statu_IsValid, &_internal_metadata_, 3);
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      // required .message.Ground_statu ground_statu = 4;
+      case 4:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
+          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          CHK_(ptr);
+          if (PROTOBUF_PREDICT_TRUE(::message::Ground_statu_IsValid(val))) {
+            _internal_set_ground_statu(static_cast<::message::Ground_statu>(val));
+          } else {
+            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
+          }
+        } else goto handle_unusual;
+        continue;
+      // optional .message.Locate_information locate_information_realtime = 5;
+      case 5:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
+          ptr = ctx->ParseMessage(_internal_mutable_locate_information_realtime(), ptr);
+          CHK_(ptr);
+        } else goto handle_unusual;
+        continue;
+      default: {
+      handle_unusual:
+        if ((tag & 7) == 4 || tag == 0) {
+          ctx->SetLastTag(tag);
+          goto success;
+        }
+        ptr = UnknownFieldParse(tag,
+            _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+            ptr, ctx);
+        CHK_(ptr != nullptr);
+        continue;
+      }
+    }  // switch
+  }  // while
+success:
+  _has_bits_.Or(has_bits);
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto success;
+#undef CHK_
+}
+
+::PROTOBUF_NAMESPACE_ID::uint8* Ground_measure_statu_msg::_InternalSerialize(
+    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:message.Ground_measure_statu_msg)
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  cached_has_bits = _has_bits_[0];
+  // required .message.Base_info base_info = 1;
+  if (cached_has_bits & 0x00000001u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        1, _Internal::base_info(this), target, stream);
+  }
+
+  // required int32 id = 2;
+  if (cached_has_bits & 0x00000004u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_id(), target);
+  }
+
+  // repeated .message.Laser_statu laser_statu_vector = 3;
+  for (int i = 0, n = this->_internal_laser_statu_vector_size(); i < n; i++) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+        3, this->_internal_laser_statu_vector(i), target);
+  }
+
+  // required .message.Ground_statu ground_statu = 4;
+  if (cached_has_bits & 0x00000008u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+      4, this->_internal_ground_statu(), target);
+  }
+
+  // optional .message.Locate_information locate_information_realtime = 5;
+  if (cached_has_bits & 0x00000002u) {
+    target = stream->EnsureSpace(target);
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
+      InternalWriteMessage(
+        5, _Internal::locate_information_realtime(this), target, stream);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
+        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:message.Ground_measure_statu_msg)
+  return target;
+}
+
+size_t Ground_measure_statu_msg::RequiredFieldsByteSizeFallback() const {
+// @@protoc_insertion_point(required_fields_byte_size_fallback_start:message.Ground_measure_statu_msg)
+  size_t total_size = 0;
+
+  if (_internal_has_base_info()) {
+    // required .message.Base_info base_info = 1;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *base_info_);
+  }
+
+  if (_internal_has_id()) {
+    // required int32 id = 2;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        this->_internal_id());
+  }
+
+  if (_internal_has_ground_statu()) {
+    // required .message.Ground_statu ground_statu = 4;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_ground_statu());
+  }
+
+  return total_size;
+}
+size_t Ground_measure_statu_msg::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:message.Ground_measure_statu_msg)
+  size_t total_size = 0;
+
+  if (((_has_bits_[0] & 0x0000000d) ^ 0x0000000d) == 0) {  // All required fields are present.
+    // required .message.Base_info base_info = 1;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *base_info_);
+
+    // required int32 id = 2;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        this->_internal_id());
+
+    // required .message.Ground_statu ground_statu = 4;
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_ground_statu());
+
+  } else {
+    total_size += RequiredFieldsByteSizeFallback();
+  }
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // repeated .message.Laser_statu laser_statu_vector = 3;
+  {
+    size_t data_size = 0;
+    unsigned int count = static_cast<unsigned int>(this->_internal_laser_statu_vector_size());for (unsigned int i = 0; i < count; i++) {
+      data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(
+        this->_internal_laser_statu_vector(static_cast<int>(i)));
+    }
+    total_size += (1UL * count) + data_size;
+  }
+
+  // optional .message.Locate_information locate_information_realtime = 5;
+  cached_has_bits = _has_bits_[0];
+  if (cached_has_bits & 0x00000002u) {
+    total_size += 1 +
+      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
+        *locate_information_realtime_);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
+        _internal_metadata_, total_size, &_cached_size_);
+  }
+  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  SetCachedSize(cached_size);
+  return total_size;
+}
+
+void Ground_measure_statu_msg::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+// @@protoc_insertion_point(generalized_merge_from_start:message.Ground_measure_statu_msg)
+  GOOGLE_DCHECK_NE(&from, this);
+  const Ground_measure_statu_msg* source =
+      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Ground_measure_statu_msg>(
+          &from);
+  if (source == nullptr) {
+  // @@protoc_insertion_point(generalized_merge_from_cast_fail:message.Ground_measure_statu_msg)
+    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
+  } else {
+  // @@protoc_insertion_point(generalized_merge_from_cast_success:message.Ground_measure_statu_msg)
+    MergeFrom(*source);
+  }
+}
+
+void Ground_measure_statu_msg::MergeFrom(const Ground_measure_statu_msg& from) {
+// @@protoc_insertion_point(class_specific_merge_from_start:message.Ground_measure_statu_msg)
+  GOOGLE_DCHECK_NE(&from, this);
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  laser_statu_vector_.MergeFrom(from.laser_statu_vector_);
+  cached_has_bits = from._has_bits_[0];
+  if (cached_has_bits & 0x0000000fu) {
+    if (cached_has_bits & 0x00000001u) {
+      _internal_mutable_base_info()->::message::Base_info::MergeFrom(from._internal_base_info());
+    }
+    if (cached_has_bits & 0x00000002u) {
+      _internal_mutable_locate_information_realtime()->::message::Locate_information::MergeFrom(from._internal_locate_information_realtime());
+    }
+    if (cached_has_bits & 0x00000004u) {
+      id_ = from.id_;
+    }
+    if (cached_has_bits & 0x00000008u) {
+      ground_statu_ = from.ground_statu_;
+    }
+    _has_bits_[0] |= cached_has_bits;
+  }
+}
+
+void Ground_measure_statu_msg::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
+// @@protoc_insertion_point(generalized_copy_from_start:message.Ground_measure_statu_msg)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Ground_measure_statu_msg::CopyFrom(const Ground_measure_statu_msg& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:message.Ground_measure_statu_msg)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Ground_measure_statu_msg::IsInitialized() const {
+  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
+  if (_internal_has_base_info()) {
+    if (!base_info_->IsInitialized()) return false;
+  }
+  return true;
+}
+
+void Ground_measure_statu_msg::InternalSwap(Ground_measure_statu_msg* other) {
+  using std::swap;
+  _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
+  swap(_has_bits_[0], other->_has_bits_[0]);
+  laser_statu_vector_.InternalSwap(&other->laser_statu_vector_);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(Ground_measure_statu_msg, ground_statu_)
+      + sizeof(Ground_measure_statu_msg::ground_statu_)
+      - PROTOBUF_FIELD_OFFSET(Ground_measure_statu_msg, base_info_)>(
+          reinterpret_cast<char*>(&base_info_),
+          reinterpret_cast<char*>(&other->base_info_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata Ground_measure_statu_msg::GetMetadata() const {
+  return GetMetadataStatic();
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+}  // namespace message
+PROTOBUF_NAMESPACE_OPEN
+template<> PROTOBUF_NOINLINE ::message::Ground_measure_statu_msg* Arena::CreateMaybeMessage< ::message::Ground_measure_statu_msg >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::message::Ground_measure_statu_msg >(arena);
+}
+PROTOBUF_NAMESPACE_CLOSE
+
+// @@protoc_insertion_point(global_scope)
+#include <google/protobuf/port_undef.inc>

+ 645 - 0
src/message/ground_measure_msg.pb.h

@@ -0,0 +1,645 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: ground_measure_msg.proto
+
+#ifndef GOOGLE_PROTOBUF_INCLUDED_ground_5fmeasure_5fmsg_2eproto
+#define GOOGLE_PROTOBUF_INCLUDED_ground_5fmeasure_5fmsg_2eproto
+
+#include <limits>
+#include <string>
+
+#include <google/protobuf/port_def.inc>
+#if PROTOBUF_VERSION < 3013000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers. Please update
+#error your headers.
+#endif
+#if 3013000 < PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers. Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/port_undef.inc>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/arena.h>
+#include <google/protobuf/arenastring.h>
+#include <google/protobuf/generated_message_table_driven.h>
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/inlined_string_field.h>
+#include <google/protobuf/metadata_lite.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/repeated_field.h>  // IWYU pragma: export
+#include <google/protobuf/extension_set.h>  // IWYU pragma: export
+#include <google/protobuf/generated_enum_reflection.h>
+#include <google/protobuf/unknown_field_set.h>
+#include "message_base.pb.h"
+// @@protoc_insertion_point(includes)
+#include <google/protobuf/port_def.inc>
+#define PROTOBUF_INTERNAL_EXPORT_ground_5fmeasure_5fmsg_2eproto
+PROTOBUF_NAMESPACE_OPEN
+namespace internal {
+class AnyMetadata;
+}  // namespace internal
+PROTOBUF_NAMESPACE_CLOSE
+
+// Internal implementation detail -- do not use these members.
+struct TableStruct_ground_5fmeasure_5fmsg_2eproto {
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1]
+    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
+  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
+  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
+  static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
+};
+extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ground_5fmeasure_5fmsg_2eproto;
+namespace message {
+class Ground_measure_statu_msg;
+class Ground_measure_statu_msgDefaultTypeInternal;
+extern Ground_measure_statu_msgDefaultTypeInternal _Ground_measure_statu_msg_default_instance_;
+}  // namespace message
+PROTOBUF_NAMESPACE_OPEN
+template<> ::message::Ground_measure_statu_msg* Arena::CreateMaybeMessage<::message::Ground_measure_statu_msg>(Arena*);
+PROTOBUF_NAMESPACE_CLOSE
+namespace message {
+
+enum Laser_statu : int {
+  LASER_DISCONNECT = 0,
+  LASER_READY = 1,
+  LASER_BUSY = 2,
+  LASER_FAULT = 3
+};
+bool Laser_statu_IsValid(int value);
+constexpr Laser_statu Laser_statu_MIN = LASER_DISCONNECT;
+constexpr Laser_statu Laser_statu_MAX = LASER_FAULT;
+constexpr int Laser_statu_ARRAYSIZE = Laser_statu_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Laser_statu_descriptor();
+template<typename T>
+inline const std::string& Laser_statu_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, Laser_statu>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function Laser_statu_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    Laser_statu_descriptor(), enum_t_value);
+}
+inline bool Laser_statu_Parse(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Laser_statu* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<Laser_statu>(
+    Laser_statu_descriptor(), name, value);
+}
+enum Ground_statu : int {
+  Nothing = 0,
+  Noise = 1,
+  Car_correct = 2,
+  Car_left_out = 3,
+  Car_right_out = 4,
+  Car_top_out = 5,
+  Car_bottom_out = 6
+};
+bool Ground_statu_IsValid(int value);
+constexpr Ground_statu Ground_statu_MIN = Nothing;
+constexpr Ground_statu Ground_statu_MAX = Car_bottom_out;
+constexpr int Ground_statu_ARRAYSIZE = Ground_statu_MAX + 1;
+
+const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Ground_statu_descriptor();
+template<typename T>
+inline const std::string& Ground_statu_Name(T enum_t_value) {
+  static_assert(::std::is_same<T, Ground_statu>::value ||
+    ::std::is_integral<T>::value,
+    "Incorrect type passed to function Ground_statu_Name.");
+  return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum(
+    Ground_statu_descriptor(), enum_t_value);
+}
+inline bool Ground_statu_Parse(
+    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Ground_statu* value) {
+  return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum<Ground_statu>(
+    Ground_statu_descriptor(), name, value);
+}
+// ===================================================================
+
+class Ground_measure_statu_msg PROTOBUF_FINAL :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:message.Ground_measure_statu_msg) */ {
+ public:
+  inline Ground_measure_statu_msg() : Ground_measure_statu_msg(nullptr) {}
+  virtual ~Ground_measure_statu_msg();
+
+  Ground_measure_statu_msg(const Ground_measure_statu_msg& from);
+  Ground_measure_statu_msg(Ground_measure_statu_msg&& from) noexcept
+    : Ground_measure_statu_msg() {
+    *this = ::std::move(from);
+  }
+
+  inline Ground_measure_statu_msg& operator=(const Ground_measure_statu_msg& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  inline Ground_measure_statu_msg& operator=(Ground_measure_statu_msg&& from) noexcept {
+    if (GetArena() == from.GetArena()) {
+      if (this != &from) InternalSwap(&from);
+    } else {
+      CopyFrom(from);
+    }
+    return *this;
+  }
+
+  inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const {
+    return _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance);
+  }
+  inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() {
+    return _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+  }
+
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
+    return GetDescriptor();
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
+    return GetMetadataStatic().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return GetMetadataStatic().reflection;
+  }
+  static const Ground_measure_statu_msg& default_instance();
+
+  static void InitAsDefaultInstance();  // FOR INTERNAL USE ONLY
+  static inline const Ground_measure_statu_msg* internal_default_instance() {
+    return reinterpret_cast<const Ground_measure_statu_msg*>(
+               &_Ground_measure_statu_msg_default_instance_);
+  }
+  static constexpr int kIndexInFileMessages =
+    0;
+
+  friend void swap(Ground_measure_statu_msg& a, Ground_measure_statu_msg& b) {
+    a.Swap(&b);
+  }
+  inline void Swap(Ground_measure_statu_msg* other) {
+    if (other == this) return;
+    if (GetArena() == other->GetArena()) {
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(Ground_measure_statu_msg* other) {
+    if (other == this) return;
+    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    InternalSwap(other);
+  }
+
+  // implements Message ----------------------------------------------
+
+  inline Ground_measure_statu_msg* New() const final {
+    return CreateMaybeMessage<Ground_measure_statu_msg>(nullptr);
+  }
+
+  Ground_measure_statu_msg* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+    return CreateMaybeMessage<Ground_measure_statu_msg>(arena);
+  }
+  void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+  void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
+  void CopyFrom(const Ground_measure_statu_msg& from);
+  void MergeFrom(const Ground_measure_statu_msg& from);
+  PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
+  bool IsInitialized() const final;
+
+  size_t ByteSizeLong() const final;
+  const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
+  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
+      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _cached_size_.Get(); }
+
+  private:
+  inline void SharedCtor();
+  inline void SharedDtor();
+  void SetCachedSize(int size) const final;
+  void InternalSwap(Ground_measure_statu_msg* other);
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
+    return "message.Ground_measure_statu_msg";
+  }
+  protected:
+  explicit Ground_measure_statu_msg(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  private:
+  static void ArenaDtor(void* object);
+  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  public:
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
+  private:
+  static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
+    ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_ground_5fmeasure_5fmsg_2eproto);
+    return ::descriptor_table_ground_5fmeasure_5fmsg_2eproto.file_level_metadata[kIndexInFileMessages];
+  }
+
+  public:
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  enum : int {
+    kLaserStatuVectorFieldNumber = 3,
+    kBaseInfoFieldNumber = 1,
+    kLocateInformationRealtimeFieldNumber = 5,
+    kIdFieldNumber = 2,
+    kGroundStatuFieldNumber = 4,
+  };
+  // repeated .message.Laser_statu laser_statu_vector = 3;
+  int laser_statu_vector_size() const;
+  private:
+  int _internal_laser_statu_vector_size() const;
+  public:
+  void clear_laser_statu_vector();
+  private:
+  ::message::Laser_statu _internal_laser_statu_vector(int index) const;
+  void _internal_add_laser_statu_vector(::message::Laser_statu value);
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>* _internal_mutable_laser_statu_vector();
+  public:
+  ::message::Laser_statu laser_statu_vector(int index) const;
+  void set_laser_statu_vector(int index, ::message::Laser_statu value);
+  void add_laser_statu_vector(::message::Laser_statu value);
+  const ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>& laser_statu_vector() const;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>* mutable_laser_statu_vector();
+
+  // required .message.Base_info base_info = 1;
+  bool has_base_info() const;
+  private:
+  bool _internal_has_base_info() const;
+  public:
+  void clear_base_info();
+  const ::message::Base_info& base_info() const;
+  ::message::Base_info* release_base_info();
+  ::message::Base_info* mutable_base_info();
+  void set_allocated_base_info(::message::Base_info* base_info);
+  private:
+  const ::message::Base_info& _internal_base_info() const;
+  ::message::Base_info* _internal_mutable_base_info();
+  public:
+  void unsafe_arena_set_allocated_base_info(
+      ::message::Base_info* base_info);
+  ::message::Base_info* unsafe_arena_release_base_info();
+
+  // optional .message.Locate_information locate_information_realtime = 5;
+  bool has_locate_information_realtime() const;
+  private:
+  bool _internal_has_locate_information_realtime() const;
+  public:
+  void clear_locate_information_realtime();
+  const ::message::Locate_information& locate_information_realtime() const;
+  ::message::Locate_information* release_locate_information_realtime();
+  ::message::Locate_information* mutable_locate_information_realtime();
+  void set_allocated_locate_information_realtime(::message::Locate_information* locate_information_realtime);
+  private:
+  const ::message::Locate_information& _internal_locate_information_realtime() const;
+  ::message::Locate_information* _internal_mutable_locate_information_realtime();
+  public:
+  void unsafe_arena_set_allocated_locate_information_realtime(
+      ::message::Locate_information* locate_information_realtime);
+  ::message::Locate_information* unsafe_arena_release_locate_information_realtime();
+
+  // required int32 id = 2;
+  bool has_id() const;
+  private:
+  bool _internal_has_id() const;
+  public:
+  void clear_id();
+  ::PROTOBUF_NAMESPACE_ID::int32 id() const;
+  void set_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  private:
+  ::PROTOBUF_NAMESPACE_ID::int32 _internal_id() const;
+  void _internal_set_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  public:
+
+  // required .message.Ground_statu ground_statu = 4;
+  bool has_ground_statu() const;
+  private:
+  bool _internal_has_ground_statu() const;
+  public:
+  void clear_ground_statu();
+  ::message::Ground_statu ground_statu() const;
+  void set_ground_statu(::message::Ground_statu value);
+  private:
+  ::message::Ground_statu _internal_ground_statu() const;
+  void _internal_set_ground_statu(::message::Ground_statu value);
+  public:
+
+  // @@protoc_insertion_point(class_scope:message.Ground_measure_statu_msg)
+ private:
+  class _Internal;
+
+  // helper for ByteSizeLong()
+  size_t RequiredFieldsByteSizeFallback() const;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_;
+  mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  ::PROTOBUF_NAMESPACE_ID::RepeatedField<int> laser_statu_vector_;
+  ::message::Base_info* base_info_;
+  ::message::Locate_information* locate_information_realtime_;
+  ::PROTOBUF_NAMESPACE_ID::int32 id_;
+  int ground_statu_;
+  friend struct ::TableStruct_ground_5fmeasure_5fmsg_2eproto;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+#ifdef __GNUC__
+  #pragma GCC diagnostic push
+  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif  // __GNUC__
+// Ground_measure_statu_msg
+
+// required .message.Base_info base_info = 1;
+inline bool Ground_measure_statu_msg::_internal_has_base_info() const {
+  bool value = (_has_bits_[0] & 0x00000001u) != 0;
+  PROTOBUF_ASSUME(!value || base_info_ != nullptr);
+  return value;
+}
+inline bool Ground_measure_statu_msg::has_base_info() const {
+  return _internal_has_base_info();
+}
+inline const ::message::Base_info& Ground_measure_statu_msg::_internal_base_info() const {
+  const ::message::Base_info* p = base_info_;
+  return p != nullptr ? *p : *reinterpret_cast<const ::message::Base_info*>(
+      &::message::_Base_info_default_instance_);
+}
+inline const ::message::Base_info& Ground_measure_statu_msg::base_info() const {
+  // @@protoc_insertion_point(field_get:message.Ground_measure_statu_msg.base_info)
+  return _internal_base_info();
+}
+inline void Ground_measure_statu_msg::unsafe_arena_set_allocated_base_info(
+    ::message::Base_info* base_info) {
+  if (GetArena() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(base_info_);
+  }
+  base_info_ = base_info;
+  if (base_info) {
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:message.Ground_measure_statu_msg.base_info)
+}
+inline ::message::Base_info* Ground_measure_statu_msg::release_base_info() {
+  _has_bits_[0] &= ~0x00000001u;
+  ::message::Base_info* temp = base_info_;
+  base_info_ = nullptr;
+  if (GetArena() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+  return temp;
+}
+inline ::message::Base_info* Ground_measure_statu_msg::unsafe_arena_release_base_info() {
+  // @@protoc_insertion_point(field_release:message.Ground_measure_statu_msg.base_info)
+  _has_bits_[0] &= ~0x00000001u;
+  ::message::Base_info* temp = base_info_;
+  base_info_ = nullptr;
+  return temp;
+}
+inline ::message::Base_info* Ground_measure_statu_msg::_internal_mutable_base_info() {
+  _has_bits_[0] |= 0x00000001u;
+  if (base_info_ == nullptr) {
+    auto* p = CreateMaybeMessage<::message::Base_info>(GetArena());
+    base_info_ = p;
+  }
+  return base_info_;
+}
+inline ::message::Base_info* Ground_measure_statu_msg::mutable_base_info() {
+  // @@protoc_insertion_point(field_mutable:message.Ground_measure_statu_msg.base_info)
+  return _internal_mutable_base_info();
+}
+inline void Ground_measure_statu_msg::set_allocated_base_info(::message::Base_info* base_info) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(base_info_);
+  }
+  if (base_info) {
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+      reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(base_info)->GetArena();
+    if (message_arena != submessage_arena) {
+      base_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
+          message_arena, base_info, submessage_arena);
+    }
+    _has_bits_[0] |= 0x00000001u;
+  } else {
+    _has_bits_[0] &= ~0x00000001u;
+  }
+  base_info_ = base_info;
+  // @@protoc_insertion_point(field_set_allocated:message.Ground_measure_statu_msg.base_info)
+}
+
+// required int32 id = 2;
+inline bool Ground_measure_statu_msg::_internal_has_id() const {
+  bool value = (_has_bits_[0] & 0x00000004u) != 0;
+  return value;
+}
+inline bool Ground_measure_statu_msg::has_id() const {
+  return _internal_has_id();
+}
+inline void Ground_measure_statu_msg::clear_id() {
+  id_ = 0;
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline ::PROTOBUF_NAMESPACE_ID::int32 Ground_measure_statu_msg::_internal_id() const {
+  return id_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::int32 Ground_measure_statu_msg::id() const {
+  // @@protoc_insertion_point(field_get:message.Ground_measure_statu_msg.id)
+  return _internal_id();
+}
+inline void Ground_measure_statu_msg::_internal_set_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+  _has_bits_[0] |= 0x00000004u;
+  id_ = value;
+}
+inline void Ground_measure_statu_msg::set_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+  _internal_set_id(value);
+  // @@protoc_insertion_point(field_set:message.Ground_measure_statu_msg.id)
+}
+
+// repeated .message.Laser_statu laser_statu_vector = 3;
+inline int Ground_measure_statu_msg::_internal_laser_statu_vector_size() const {
+  return laser_statu_vector_.size();
+}
+inline int Ground_measure_statu_msg::laser_statu_vector_size() const {
+  return _internal_laser_statu_vector_size();
+}
+inline void Ground_measure_statu_msg::clear_laser_statu_vector() {
+  laser_statu_vector_.Clear();
+}
+inline ::message::Laser_statu Ground_measure_statu_msg::_internal_laser_statu_vector(int index) const {
+  return static_cast< ::message::Laser_statu >(laser_statu_vector_.Get(index));
+}
+inline ::message::Laser_statu Ground_measure_statu_msg::laser_statu_vector(int index) const {
+  // @@protoc_insertion_point(field_get:message.Ground_measure_statu_msg.laser_statu_vector)
+  return _internal_laser_statu_vector(index);
+}
+inline void Ground_measure_statu_msg::set_laser_statu_vector(int index, ::message::Laser_statu value) {
+  assert(::message::Laser_statu_IsValid(value));
+  laser_statu_vector_.Set(index, value);
+  // @@protoc_insertion_point(field_set:message.Ground_measure_statu_msg.laser_statu_vector)
+}
+inline void Ground_measure_statu_msg::_internal_add_laser_statu_vector(::message::Laser_statu value) {
+  assert(::message::Laser_statu_IsValid(value));
+  laser_statu_vector_.Add(value);
+}
+inline void Ground_measure_statu_msg::add_laser_statu_vector(::message::Laser_statu value) {
+  // @@protoc_insertion_point(field_add:message.Ground_measure_statu_msg.laser_statu_vector)
+  _internal_add_laser_statu_vector(value);
+}
+inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>&
+Ground_measure_statu_msg::laser_statu_vector() const {
+  // @@protoc_insertion_point(field_list:message.Ground_measure_statu_msg.laser_statu_vector)
+  return laser_statu_vector_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>*
+Ground_measure_statu_msg::_internal_mutable_laser_statu_vector() {
+  return &laser_statu_vector_;
+}
+inline ::PROTOBUF_NAMESPACE_ID::RepeatedField<int>*
+Ground_measure_statu_msg::mutable_laser_statu_vector() {
+  // @@protoc_insertion_point(field_mutable_list:message.Ground_measure_statu_msg.laser_statu_vector)
+  return _internal_mutable_laser_statu_vector();
+}
+
+// required .message.Ground_statu ground_statu = 4;
+inline bool Ground_measure_statu_msg::_internal_has_ground_statu() const {
+  bool value = (_has_bits_[0] & 0x00000008u) != 0;
+  return value;
+}
+inline bool Ground_measure_statu_msg::has_ground_statu() const {
+  return _internal_has_ground_statu();
+}
+inline void Ground_measure_statu_msg::clear_ground_statu() {
+  ground_statu_ = 0;
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline ::message::Ground_statu Ground_measure_statu_msg::_internal_ground_statu() const {
+  return static_cast< ::message::Ground_statu >(ground_statu_);
+}
+inline ::message::Ground_statu Ground_measure_statu_msg::ground_statu() const {
+  // @@protoc_insertion_point(field_get:message.Ground_measure_statu_msg.ground_statu)
+  return _internal_ground_statu();
+}
+inline void Ground_measure_statu_msg::_internal_set_ground_statu(::message::Ground_statu value) {
+  assert(::message::Ground_statu_IsValid(value));
+  _has_bits_[0] |= 0x00000008u;
+  ground_statu_ = value;
+}
+inline void Ground_measure_statu_msg::set_ground_statu(::message::Ground_statu value) {
+  _internal_set_ground_statu(value);
+  // @@protoc_insertion_point(field_set:message.Ground_measure_statu_msg.ground_statu)
+}
+
+// optional .message.Locate_information locate_information_realtime = 5;
+inline bool Ground_measure_statu_msg::_internal_has_locate_information_realtime() const {
+  bool value = (_has_bits_[0] & 0x00000002u) != 0;
+  PROTOBUF_ASSUME(!value || locate_information_realtime_ != nullptr);
+  return value;
+}
+inline bool Ground_measure_statu_msg::has_locate_information_realtime() const {
+  return _internal_has_locate_information_realtime();
+}
+inline const ::message::Locate_information& Ground_measure_statu_msg::_internal_locate_information_realtime() const {
+  const ::message::Locate_information* p = locate_information_realtime_;
+  return p != nullptr ? *p : *reinterpret_cast<const ::message::Locate_information*>(
+      &::message::_Locate_information_default_instance_);
+}
+inline const ::message::Locate_information& Ground_measure_statu_msg::locate_information_realtime() const {
+  // @@protoc_insertion_point(field_get:message.Ground_measure_statu_msg.locate_information_realtime)
+  return _internal_locate_information_realtime();
+}
+inline void Ground_measure_statu_msg::unsafe_arena_set_allocated_locate_information_realtime(
+    ::message::Locate_information* locate_information_realtime) {
+  if (GetArena() == nullptr) {
+    delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(locate_information_realtime_);
+  }
+  locate_information_realtime_ = locate_information_realtime;
+  if (locate_information_realtime) {
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  // @@protoc_insertion_point(field_unsafe_arena_set_allocated:message.Ground_measure_statu_msg.locate_information_realtime)
+}
+inline ::message::Locate_information* Ground_measure_statu_msg::release_locate_information_realtime() {
+  _has_bits_[0] &= ~0x00000002u;
+  ::message::Locate_information* temp = locate_information_realtime_;
+  locate_information_realtime_ = nullptr;
+  if (GetArena() != nullptr) {
+    temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  }
+  return temp;
+}
+inline ::message::Locate_information* Ground_measure_statu_msg::unsafe_arena_release_locate_information_realtime() {
+  // @@protoc_insertion_point(field_release:message.Ground_measure_statu_msg.locate_information_realtime)
+  _has_bits_[0] &= ~0x00000002u;
+  ::message::Locate_information* temp = locate_information_realtime_;
+  locate_information_realtime_ = nullptr;
+  return temp;
+}
+inline ::message::Locate_information* Ground_measure_statu_msg::_internal_mutable_locate_information_realtime() {
+  _has_bits_[0] |= 0x00000002u;
+  if (locate_information_realtime_ == nullptr) {
+    auto* p = CreateMaybeMessage<::message::Locate_information>(GetArena());
+    locate_information_realtime_ = p;
+  }
+  return locate_information_realtime_;
+}
+inline ::message::Locate_information* Ground_measure_statu_msg::mutable_locate_information_realtime() {
+  // @@protoc_insertion_point(field_mutable:message.Ground_measure_statu_msg.locate_information_realtime)
+  return _internal_mutable_locate_information_realtime();
+}
+inline void Ground_measure_statu_msg::set_allocated_locate_information_realtime(::message::Locate_information* locate_information_realtime) {
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+  if (message_arena == nullptr) {
+    delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(locate_information_realtime_);
+  }
+  if (locate_information_realtime) {
+    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
+      reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(locate_information_realtime)->GetArena();
+    if (message_arena != submessage_arena) {
+      locate_information_realtime = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
+          message_arena, locate_information_realtime, submessage_arena);
+    }
+    _has_bits_[0] |= 0x00000002u;
+  } else {
+    _has_bits_[0] &= ~0x00000002u;
+  }
+  locate_information_realtime_ = locate_information_realtime;
+  // @@protoc_insertion_point(field_set_allocated:message.Ground_measure_statu_msg.locate_information_realtime)
+}
+
+#ifdef __GNUC__
+  #pragma GCC diagnostic pop
+#endif  // __GNUC__
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace message
+
+PROTOBUF_NAMESPACE_OPEN
+
+template <> struct is_proto_enum< ::message::Laser_statu> : ::std::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Laser_statu>() {
+  return ::message::Laser_statu_descriptor();
+}
+template <> struct is_proto_enum< ::message::Ground_statu> : ::std::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Ground_statu>() {
+  return ::message::Ground_statu_descriptor();
+}
+
+PROTOBUF_NAMESPACE_CLOSE
+
+// @@protoc_insertion_point(global_scope)
+
+#include <google/protobuf/port_undef.inc>
+#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_ground_5fmeasure_5fmsg_2eproto

+ 35 - 0
src/message/ground_measure_msg.proto

@@ -0,0 +1,35 @@
+
+syntax = "proto2";
+package message;
+import "message_base.proto";
+
+//子雷达状态
+enum Laser_statu
+{
+	LASER_DISCONNECT	=0;	        //雷达断连
+	LASER_READY			=1;			//雷达正常待机,空闲
+	LASER_BUSY			=2;	        //雷达正在工作,正忙
+	LASER_FAULT			=3;         //雷达错误
+}
+
+enum Ground_statu
+{
+    Nothing=0;
+    Noise=1;
+    Car_correct=2;
+    Car_left_out=3;
+    Car_right_out=4;
+    Car_top_out=5;
+    Car_bottom_out=6;
+}
+
+
+//地面定位模块测量结果
+message Ground_measure_statu_msg
+{
+    required Base_info                  base_info=1;                 //消息类型
+    required int32                      id=2;
+    repeated Laser_statu                laser_statu_vector = 3;
+    required Ground_statu               ground_statu=4;
+    optional Locate_information         locate_information_realtime=5;  //地面雷达的 实时定位信息
+}

Plik diff jest za duży
+ 2779 - 0
src/message/message_base.pb.cc


Plik diff jest za duży
+ 2988 - 0
src/message/message_base.pb.h


+ 209 - 0
src/message/message_base.proto

@@ -0,0 +1,209 @@
+syntax = "proto2";
+package message;
+
+//消息类型定义;每个在网络上传输的消息必须含有这个属性
+enum Message_type
+{
+    eBase_msg=0x00;
+    eCommand_msg=0x01;                      //指令消息
+
+
+    eLocate_status_msg=0x11;                //定位模块状态消息
+    eLocate_request_msg=0x12;               //定位请求消息
+    eLocate_response_msg=0x13;              //定位反馈消息
+
+
+    eDispatch_status_msg=0x21;                //调度模块硬件状态消息
+    eDispatch_request_msg=0x22;              //请求调度消息
+    eDispatch_response_msg=0x23;             //调度结果反馈消息
+
+    eParkspace_allocation_status_msg=0x31;  //车位分配模块状态消息,包括车位信息
+    eParkspace_allocation_request_msg=0x32; //请求分配车位消息
+    eParkspace_allocation_response_msg=0x33;//分配车位结果反馈消息
+    eParkspace_search_request_msg = 0x34;		//查询车位请求消息
+    eParkspace_search_response_msg = 0x35;		//查询车位反馈消息
+    eParkspace_release_request_msg = 0x36;		//释放车位请求消息
+    eParkspace_release_response_msg = 0x37;		//释放车位反馈消息
+    eParkspace_force_update_request_msg = 0x38;	//手动修改车位消息
+    eParkspace_force_update_response_msg = 0x39;//手动修改车位反馈消息
+    eParkspace_confirm_alloc_request_msg = 0x3A;//确认分配车位请求消息
+    eParkspace_confirm_alloc_response_msg = 0x3B;//确认分配车位反馈消息
+    eParkspace_refresh_request_msg=0x3C;        //请求更新车位数据
+    eParkspace_allocation_data_msg=0x3D;        //车位数据消息
+
+
+    eStore_command_request_msg=0x41;        //终端停车请求消息
+    eStore_command_response_msg=0x42;       //停车请求反馈消息
+    ePickup_command_request_msg=0x43;       //取车请求消息
+    ePickup_command_response_msg=0x44;       //取车请求反馈消息
+
+
+
+    eStoring_process_statu_msg=0x90;        //停车指令进度条消息
+    ePicking_process_statu_msg=0x91;        //取车指令进度消息
+
+
+    eCentral_controller_statu_msg=0xa0;     //中控系统状态消息
+
+
+    eEntrance_manual_operation_msg=0xb0;            //针对出入口状态操作的手动消息
+    eProcess_manual_operation_msg=0xb1;             //针对流程的手动消息
+
+
+    eGround_measure_statu_msg=0xc0;                 //地面雷达测量消息,状态消息,广播发送
+
+
+}
+
+//通讯单元
+enum Communicator
+{
+    eEmpty=0x0000;
+    eMain=0x0001;    //主流程
+
+    eTerminor=0x0100;
+    //车位表
+    eParkspace=0x0200;
+    //测量单元
+    eMeasurer=0x0300;
+    //调度机构
+    eDispatch=0x0400;
+    //...
+
+
+}
+////base message 用于解析未知类型的消息
+message Base_info
+{
+    required Message_type               msg_type=1;
+    optional int32                      timeout_ms=2;
+    required Communicator               sender=3;                       //发送者
+    required Communicator               receiver=4;                     //接收者
+}
+
+// 事件,停车或者取车
+enum Process_type
+{
+    eStoring=1;
+    ePicking=2;
+}
+
+
+message Base_msg
+{
+    required Base_info                  base_info=1;
+}
+
+//错误等级,用来做故障处理
+enum Error_level
+{
+    NORMAL                = 0;      //    正常,没有错误,默认值0
+
+    NEGLIGIBLE_ERROR      = 1;      //    轻微故障;可忽略的故障,NEGLIGIBLE_ERROR
+
+    MINOR_ERROR           = 2;      //    一般故障,MINOR_ERROR
+
+    MAJOR_ERROR           = 3;      //    严重故障,MAJOR_ERROR
+
+    CRITICAL_ERROR        = 4;      //    致命故障,CRITICAL_ERROR
+
+}
+
+message Error_manager
+{
+    required int32                      error_code = 1;
+    optional Error_level                error_level = 2;
+    optional string                     error_description = 3;
+}
+
+//测量结果结构体
+message Locate_information
+{    
+    optional float locate_x = 1;				//整车的中心点x值; 四轮的中心
+    optional float locate_y = 2;				//整车的中心点y值; 四轮的中心
+    optional float locate_angle = 3;			//整车的旋转角; 四轮的旋转角
+    optional float locate_length = 4;		    //整车的长度; 用于规避碰撞
+    optional float locate_width = 5;			//整车的宽度; 用于规避碰撞
+    optional float locate_height = 6;		    //整车的高度; 用于规避碰撞
+    optional float locate_wheel_base = 7;	    //整车的轮距; 前后轮的距离; 用于机器人或agv的抓车
+    optional float locate_wheel_width = 8;	    //整车的轮距; 左右轮的距离; 用于机器人或agv的抓车
+    optional bool locate_correct = 9;		    //整车的校准标记位
+    optional float locate_front_theta=10;       //前轮角
+}
+
+//车辆基本信息
+message Car_info
+{
+    optional float                      car_length=1;           //车长
+    optional float                      car_width=2;            //车宽
+    optional float                      car_height=3;           //车高
+    optional string                     license=4;              //车辆凭证号
+}
+
+//车位状态枚举
+enum Parkspace_status
+{
+    eParkspace_empty            = 0;         //空闲,可分配
+    eParkspace_occupied         = 1;         //被占用,不可分配
+    eParkspace_reserverd        = 2;         //被预约,预约车辆可分配
+    eParkspace_error            = 3;         //车位机械结构或硬件故障
+}
+
+enum Direction
+{
+    eForward = 1;
+    eBackward = 2;
+}
+
+//单个车位基本信息与状态信息,车位信息以及车位上的车辆信息
+message Parkspace_info
+{
+    optional int32              parkspace_id=1;         //车位编号
+    optional int32              index=2;                //同层编号
+    optional Direction          direction=3;            //前后
+    optional int32              floor=4;                //楼层
+    optional float              length=5;               //车位长
+    optional float              width=6;                //车位宽
+    optional float              height=7;               //车位高
+    optional Parkspace_status   parkspace_status=8;     //车位当前状态
+    optional Car_info           car_info=9;              //当前车位存入车辆的凭证号
+    optional string             entry_time=10;          //入场时间
+    optional string             leave_time=11;          //离场时间
+}
+
+/*
+*流程中的步骤类型, 例如:停车流程包含5个步骤 , 分配车位-测量-检验结果-搬运-更新车位表
+*/
+enum Step_type
+{
+    eAlloc_step=0;
+    eMeasure_step=1;
+    eCompare_step=2;
+    eDispatch_step=3;
+    eConfirm_step=4;
+
+    eSearch_step=5;        //查询数据库
+    eWait_step=6;             //等待车辆离开
+    eRelease_step=7;          //释放车位
+
+    eComplete=8;              //完成
+
+    eBackConfirm_step=9;
+    eBack_compare_step=10;
+    eBackMeasure_step=11;
+    eBackAlloc_step=12;
+
+    eBackWait_step=13;
+    eBackDispatch_step=14;
+    eBackSearch_step=15;
+
+    eBackComplete=16;
+}
+//步骤状态,每个步骤有四中可能状态 ,等待中-执行中-完成或者错误  四个状态
+enum Step_statu
+{
+    eWaiting=0;               //空闲
+    eWorking=1;
+    eError=2;
+    eFinished=3;
+}

+ 14 - 0
src/publisher.cpp

@@ -0,0 +1,14 @@
+//
+// Created by zx on 2021/5/27.
+//
+
+#include "publisher.h"
+Publisher::~Publisher(){}
+Publisher::Publisher()
+{
+}
+
+Error_manager Publisher::publish_msg(Communication_message* p_msg)
+{
+    return Communication_socket_base::encapsulate_msg(p_msg);
+}

+ 26 - 0
src/publisher.h

@@ -0,0 +1,26 @@
+//
+// Created by zx on 2021/5/27.
+//
+
+#ifndef LIDARMEASURE_SRC_PUBLISHER_HPP_
+#define LIDARMEASURE_SRC_PUBLISHER_HPP_
+
+#include "singleton.h"
+#include "communication_socket_base.h"
+
+class Publisher : public Communication_socket_base,public Singleton<Publisher>
+{
+    friend class Singleton<Publisher>;
+ public:
+    Publisher(const Publisher& other)=delete;
+    Publisher& operator=(const Publisher& other)=delete;
+
+    Error_manager publish_msg(Communication_message* msg);
+    ~Publisher();
+
+ protected:
+    Publisher();
+};
+
+
+#endif //LIDARMEASURE_SRC_PUBLISHER_HPP_