Explorar el Código

20200629, 重定义message消息

huli hace 4 años
padre
commit
1103e9af17

+ 2 - 2
lidar_locate/Locate_communicator.cpp

@@ -35,7 +35,7 @@ Error_manager Locate_communicator::locate_request(message::Locate_request_msg re
             //解析response数据错误,
 //            return Error_manager(LOCATE_RESPONSE_PARSE_ERROR,MAJOR_ERROR,"response string parse failed");
         }
-        else if(response.error_code()==SUCCESS)
+        else if(response.error_manager().error_code()==SUCCESS)
         {
             result=response;
             return SUCCESS;
@@ -43,7 +43,7 @@ Error_manager Locate_communicator::locate_request(message::Locate_request_msg re
         else
         {
             ///将response中的错误信息,转换成错误码,返回
-            return Error_manager(Error_code(response.error_code()),MAJOR_ERROR,response.error_description().c_str());
+            return Error_manager(Error_code(response.error_manager().error_code()),MAJOR_ERROR,response.error_manager().error_description().c_str());
         }
     }
     else if(code.get_error_level()==MINOR_ERROR)

+ 1 - 1
lidar_locate/Locate_communicator.h

@@ -8,7 +8,7 @@
 #include <mutex>
 #include "nnxx_client.h"
 //#include "locate_message.pb.h"
-#include "../message/sensing_message.pb.h"
+#include "../message/measure_message.pb.h"
 #include "../error_code/error_code.h"
 
 class Locate_communicator {

+ 1 - 1
main.cpp

@@ -50,7 +50,7 @@ int main(int argc,char* argv[])
         LOG(ERROR)<<code.to_string();
     }
     //测试各个模块
-    message::Command_message cmd_msg;
+//    message::Command_message cmd_msg;
     message::Locate_request_msg request;
     message::Locate_response_msg result;
 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 445 - 300
message/hardware_message.pb.cc


+ 418 - 293
message/hardware_message.pb.h

@@ -102,6 +102,25 @@ inline bool Hardware_statu_Parse(
   return ::google::protobuf::internal::ParseNamedEnum<Hardware_statu>(
     Hardware_statu_descriptor(), name, value);
 }
+enum Action_type {
+  ePark = 0,
+  ePick = 1
+};
+bool Action_type_IsValid(int value);
+const Action_type Action_type_MIN = ePark;
+const Action_type Action_type_MAX = ePick;
+const int Action_type_ARRAYSIZE = Action_type_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Action_type_descriptor();
+inline const ::std::string& Action_type_Name(Action_type value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Action_type_descriptor(), value);
+}
+inline bool Action_type_Parse(
+    const ::std::string& name, Action_type* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Action_type>(
+    Action_type_descriptor(), name, value);
+}
 // ===================================================================
 
 class Position : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:message.Position) */ {
@@ -326,31 +345,22 @@ class Carrier_status : public ::google::protobuf::Message /* @@protoc_insertion_
 
   // accessors -------------------------------------------------------
 
-  // optional string error_destination = 3;
-  bool has_error_destination() const;
-  void clear_error_destination();
-  static const int kErrorDestinationFieldNumber = 3;
-  const ::std::string& error_destination() const;
-  void set_error_destination(const ::std::string& value);
+  // optional string error_description = 3;
+  bool has_error_description() const;
+  void clear_error_description();
+  static const int kErrorDescriptionFieldNumber = 3;
+  const ::std::string& error_description() const;
+  void set_error_description(const ::std::string& value);
   #if LANG_CXX11
-  void set_error_destination(::std::string&& value);
+  void set_error_description(::std::string&& value);
   #endif
-  void set_error_destination(const char* value);
-  void set_error_destination(const char* value, size_t size);
-  ::std::string* mutable_error_destination();
-  ::std::string* release_error_destination();
-  void set_allocated_error_destination(::std::string* error_destination);
-
-  // optional .message.Command_message cmd_msg = 2;
-  bool has_cmd_msg() const;
-  void clear_cmd_msg();
-  static const int kCmdMsgFieldNumber = 2;
-  const ::message::Command_message& cmd_msg() const;
-  ::message::Command_message* release_cmd_msg();
-  ::message::Command_message* mutable_cmd_msg();
-  void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
-
-  // optional .message.Position position = 4;
+  void set_error_description(const char* value);
+  void set_error_description(const char* value, size_t size);
+  ::std::string* mutable_error_description();
+  ::std::string* release_error_description();
+  void set_allocated_error_description(::std::string* error_description);
+
+  // required .message.Position position = 4;
   bool has_position() const;
   void clear_position();
   static const int kPositionFieldNumber = 4;
@@ -366,6 +376,13 @@ class Carrier_status : public ::google::protobuf::Message /* @@protoc_insertion_
   ::message::Hardware_statu statu() const;
   void set_statu(::message::Hardware_statu value);
 
+  // optional int32 command_id = 2;
+  bool has_command_id() const;
+  void clear_command_id();
+  static const int kCommandIdFieldNumber = 2;
+  ::google::protobuf::int32 command_id() const;
+  void set_command_id(::google::protobuf::int32 value);
+
   // required bool empty = 5;
   bool has_empty() const;
   void clear_empty();
@@ -377,10 +394,10 @@ class Carrier_status : public ::google::protobuf::Message /* @@protoc_insertion_
  private:
   void set_has_statu();
   void clear_has_statu();
-  void set_has_cmd_msg();
-  void clear_has_cmd_msg();
-  void set_has_error_destination();
-  void clear_has_error_destination();
+  void set_has_command_id();
+  void clear_has_command_id();
+  void set_has_error_description();
+  void clear_has_error_description();
   void set_has_position();
   void clear_has_position();
   void set_has_empty();
@@ -392,10 +409,10 @@ class Carrier_status : public ::google::protobuf::Message /* @@protoc_insertion_
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
-  ::google::protobuf::internal::ArenaStringPtr error_destination_;
-  ::message::Command_message* cmd_msg_;
+  ::google::protobuf::internal::ArenaStringPtr error_description_;
   ::message::Position* position_;
   int statu_;
+  ::google::protobuf::int32 command_id_;
   bool empty_;
   friend struct ::protobuf_hardware_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_hardware_5fmessage_2eproto::InitDefaultsCarrier_statusImpl();
@@ -640,37 +657,66 @@ class Execute_request_msg : public ::google::protobuf::Message /* @@protoc_inser
 
   // accessors -------------------------------------------------------
 
-  // required .message.Command_message cmd_msg = 2;
-  bool has_cmd_msg() const;
-  void clear_cmd_msg();
-  static const int kCmdMsgFieldNumber = 2;
-  const ::message::Command_message& cmd_msg() const;
-  ::message::Command_message* release_cmd_msg();
-  ::message::Command_message* mutable_cmd_msg();
-  void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
-
-  // required .message.Message_type msg_type = 1;
-  bool has_msg_type() const;
-  void clear_msg_type();
-  static const int kMsgTypeFieldNumber = 1;
-  ::message::Message_type msg_type() const;
-  void set_msg_type(::message::Message_type value);
-
-  // optional int32 time_out = 3 [default = 200000];
-  bool has_time_out() const;
-  void clear_time_out();
-  static const int kTimeOutFieldNumber = 3;
-  ::google::protobuf::int32 time_out() const;
-  void set_time_out(::google::protobuf::int32 value);
+  // required .message.Base_msg msg_base = 1;
+  bool has_msg_base() const;
+  void clear_msg_base();
+  static const int kMsgBaseFieldNumber = 1;
+  const ::message::Base_msg& msg_base() const;
+  ::message::Base_msg* release_msg_base();
+  ::message::Base_msg* mutable_msg_base();
+  void set_allocated_msg_base(::message::Base_msg* msg_base);
+
+  // required .message.Locate_information locate_information = 6;
+  bool has_locate_information() const;
+  void clear_locate_information();
+  static const int kLocateInformationFieldNumber = 6;
+  const ::message::Locate_information& locate_information() const;
+  ::message::Locate_information* release_locate_information();
+  ::message::Locate_information* mutable_locate_information();
+  void set_allocated_locate_information(::message::Locate_information* locate_information);
+
+  // required int32 command_id = 2;
+  bool has_command_id() const;
+  void clear_command_id();
+  static const int kCommandIdFieldNumber = 2;
+  ::google::protobuf::int32 command_id() const;
+  void set_command_id(::google::protobuf::int32 value);
+
+  // required .message.Action_type action_type = 3;
+  bool has_action_type() const;
+  void clear_action_type();
+  static const int kActionTypeFieldNumber = 3;
+  ::message::Action_type action_type() const;
+  void set_action_type(::message::Action_type value);
+
+  // required int32 from_id = 4;
+  bool has_from_id() const;
+  void clear_from_id();
+  static const int kFromIdFieldNumber = 4;
+  ::google::protobuf::int32 from_id() const;
+  void set_from_id(::google::protobuf::int32 value);
+
+  // required int32 destination = 5;
+  bool has_destination() const;
+  void clear_destination();
+  static const int kDestinationFieldNumber = 5;
+  ::google::protobuf::int32 destination() const;
+  void set_destination(::google::protobuf::int32 value);
 
   // @@protoc_insertion_point(class_scope:message.Execute_request_msg)
  private:
-  void set_has_msg_type();
-  void clear_has_msg_type();
-  void set_has_cmd_msg();
-  void clear_has_cmd_msg();
-  void set_has_time_out();
-  void clear_has_time_out();
+  void set_has_msg_base();
+  void clear_has_msg_base();
+  void set_has_command_id();
+  void clear_has_command_id();
+  void set_has_action_type();
+  void clear_has_action_type();
+  void set_has_from_id();
+  void clear_has_from_id();
+  void set_has_destination();
+  void clear_has_destination();
+  void set_has_locate_information();
+  void clear_has_locate_information();
 
   // helper for ByteSizeLong()
   size_t RequiredFieldsByteSizeFallback() const;
@@ -678,9 +724,12 @@ class Execute_request_msg : public ::google::protobuf::Message /* @@protoc_inser
   ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
-  ::message::Command_message* cmd_msg_;
-  int msg_type_;
-  ::google::protobuf::int32 time_out_;
+  ::message::Base_msg* msg_base_;
+  ::message::Locate_information* locate_information_;
+  ::google::protobuf::int32 command_id_;
+  int action_type_;
+  ::google::protobuf::int32 from_id_;
+  ::google::protobuf::int32 destination_;
   friend struct ::protobuf_hardware_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_hardware_5fmessage_2eproto::InitDefaultsExecute_request_msgImpl();
 };
@@ -790,14 +839,21 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::std::string* release_error_description();
   void set_allocated_error_description(::std::string* error_description);
 
-  // required .message.Command_message cmd_msg = 2;
-  bool has_cmd_msg() const;
-  void clear_cmd_msg();
-  static const int kCmdMsgFieldNumber = 2;
-  const ::message::Command_message& cmd_msg() const;
-  ::message::Command_message* release_cmd_msg();
-  ::message::Command_message* mutable_cmd_msg();
-  void set_allocated_cmd_msg(::message::Command_message* cmd_msg);
+  // required .message.Base_msg msg_base = 1;
+  bool has_msg_base() const;
+  void clear_msg_base();
+  static const int kMsgBaseFieldNumber = 1;
+  const ::message::Base_msg& msg_base() const;
+  ::message::Base_msg* release_msg_base();
+  ::message::Base_msg* mutable_msg_base();
+  void set_allocated_msg_base(::message::Base_msg* msg_base);
+
+  // required int32 command_id = 2;
+  bool has_command_id() const;
+  void clear_command_id();
+  static const int kCommandIdFieldNumber = 2;
+  ::google::protobuf::int32 command_id() const;
+  void set_command_id(::google::protobuf::int32 value);
 
   // required int32 error_code = 3;
   bool has_error_code() const;
@@ -806,19 +862,12 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::google::protobuf::int32 error_code() const;
   void set_error_code(::google::protobuf::int32 value);
 
-  // required .message.Message_type msg_type = 1;
-  bool has_msg_type() const;
-  void clear_msg_type();
-  static const int kMsgTypeFieldNumber = 1;
-  ::message::Message_type msg_type() const;
-  void set_msg_type(::message::Message_type value);
-
   // @@protoc_insertion_point(class_scope:message.Execute_response_msg)
  private:
-  void set_has_msg_type();
-  void clear_has_msg_type();
-  void set_has_cmd_msg();
-  void clear_has_cmd_msg();
+  void set_has_msg_base();
+  void clear_has_msg_base();
+  void set_has_command_id();
+  void clear_has_command_id();
   void set_has_error_code();
   void clear_has_error_code();
   void set_has_error_description();
@@ -831,9 +880,9 @@ class Execute_response_msg : public ::google::protobuf::Message /* @@protoc_inse
   ::google::protobuf::internal::HasBits<1> _has_bits_;
   mutable int _cached_size_;
   ::google::protobuf::internal::ArenaStringPtr error_description_;
-  ::message::Command_message* cmd_msg_;
+  ::message::Base_msg* msg_base_;
+  ::google::protobuf::int32 command_id_;
   ::google::protobuf::int32 error_code_;
-  int msg_type_;
   friend struct ::protobuf_hardware_5fmessage_2eproto::TableStruct;
   friend void ::protobuf_hardware_5fmessage_2eproto::InitDefaultsExecute_response_msgImpl();
 };
@@ -926,13 +975,13 @@ inline void Position::set_z(float value) {
 
 // required .message.Hardware_statu statu = 1;
 inline bool Carrier_status::has_statu() const {
-  return (_has_bits_[0] & 0x00000008u) != 0;
+  return (_has_bits_[0] & 0x00000004u) != 0;
 }
 inline void Carrier_status::set_has_statu() {
-  _has_bits_[0] |= 0x00000008u;
+  _has_bits_[0] |= 0x00000004u;
 }
 inline void Carrier_status::clear_has_statu() {
-  _has_bits_[0] &= ~0x00000008u;
+  _has_bits_[0] &= ~0x00000004u;
 }
 inline void Carrier_status::clear_statu() {
   statu_ = 0;
@@ -949,128 +998,102 @@ inline void Carrier_status::set_statu(::message::Hardware_statu value) {
   // @@protoc_insertion_point(field_set:message.Carrier_status.statu)
 }
 
-// optional .message.Command_message cmd_msg = 2;
-inline bool Carrier_status::has_cmd_msg() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
+// optional int32 command_id = 2;
+inline bool Carrier_status::has_command_id() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
-inline void Carrier_status::set_has_cmd_msg() {
-  _has_bits_[0] |= 0x00000002u;
+inline void Carrier_status::set_has_command_id() {
+  _has_bits_[0] |= 0x00000008u;
 }
-inline void Carrier_status::clear_has_cmd_msg() {
-  _has_bits_[0] &= ~0x00000002u;
+inline void Carrier_status::clear_has_command_id() {
+  _has_bits_[0] &= ~0x00000008u;
 }
-inline const ::message::Command_message& Carrier_status::cmd_msg() const {
-  const ::message::Command_message* p = cmd_msg_;
-  // @@protoc_insertion_point(field_get:message.Carrier_status.cmd_msg)
-  return p != NULL ? *p : *reinterpret_cast<const ::message::Command_message*>(
-      &::message::_Command_message_default_instance_);
-}
-inline ::message::Command_message* Carrier_status::release_cmd_msg() {
-  // @@protoc_insertion_point(field_release:message.Carrier_status.cmd_msg)
-  clear_has_cmd_msg();
-  ::message::Command_message* temp = cmd_msg_;
-  cmd_msg_ = NULL;
-  return temp;
+inline void Carrier_status::clear_command_id() {
+  command_id_ = 0;
+  clear_has_command_id();
 }
-inline ::message::Command_message* Carrier_status::mutable_cmd_msg() {
-  set_has_cmd_msg();
-  if (cmd_msg_ == NULL) {
-    cmd_msg_ = new ::message::Command_message;
-  }
-  // @@protoc_insertion_point(field_mutable:message.Carrier_status.cmd_msg)
-  return cmd_msg_;
+inline ::google::protobuf::int32 Carrier_status::command_id() const {
+  // @@protoc_insertion_point(field_get:message.Carrier_status.command_id)
+  return command_id_;
 }
-inline void Carrier_status::set_allocated_cmd_msg(::message::Command_message* cmd_msg) {
-  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
-  if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(cmd_msg_);
-  }
-  if (cmd_msg) {
-    ::google::protobuf::Arena* submessage_arena = NULL;
-    if (message_arena != submessage_arena) {
-      cmd_msg = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, cmd_msg, submessage_arena);
-    }
-    set_has_cmd_msg();
-  } else {
-    clear_has_cmd_msg();
-  }
-  cmd_msg_ = cmd_msg;
-  // @@protoc_insertion_point(field_set_allocated:message.Carrier_status.cmd_msg)
+inline void Carrier_status::set_command_id(::google::protobuf::int32 value) {
+  set_has_command_id();
+  command_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Carrier_status.command_id)
 }
 
-// optional string error_destination = 3;
-inline bool Carrier_status::has_error_destination() const {
+// optional string error_description = 3;
+inline bool Carrier_status::has_error_description() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
-inline void Carrier_status::set_has_error_destination() {
+inline void Carrier_status::set_has_error_description() {
   _has_bits_[0] |= 0x00000001u;
 }
-inline void Carrier_status::clear_has_error_destination() {
+inline void Carrier_status::clear_has_error_description() {
   _has_bits_[0] &= ~0x00000001u;
 }
-inline void Carrier_status::clear_error_destination() {
-  error_destination_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
-  clear_has_error_destination();
+inline void Carrier_status::clear_error_description() {
+  error_description_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  clear_has_error_description();
 }
-inline const ::std::string& Carrier_status::error_destination() const {
-  // @@protoc_insertion_point(field_get:message.Carrier_status.error_destination)
-  return error_destination_.GetNoArena();
+inline const ::std::string& Carrier_status::error_description() const {
+  // @@protoc_insertion_point(field_get:message.Carrier_status.error_description)
+  return error_description_.GetNoArena();
 }
-inline void Carrier_status::set_error_destination(const ::std::string& value) {
-  set_has_error_destination();
-  error_destination_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
-  // @@protoc_insertion_point(field_set:message.Carrier_status.error_destination)
+inline void Carrier_status::set_error_description(const ::std::string& value) {
+  set_has_error_description();
+  error_description_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
+  // @@protoc_insertion_point(field_set:message.Carrier_status.error_description)
 }
 #if LANG_CXX11
-inline void Carrier_status::set_error_destination(::std::string&& value) {
-  set_has_error_destination();
-  error_destination_.SetNoArena(
+inline void Carrier_status::set_error_description(::std::string&& value) {
+  set_has_error_description();
+  error_description_.SetNoArena(
     &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
-  // @@protoc_insertion_point(field_set_rvalue:message.Carrier_status.error_destination)
+  // @@protoc_insertion_point(field_set_rvalue:message.Carrier_status.error_description)
 }
 #endif
-inline void Carrier_status::set_error_destination(const char* value) {
+inline void Carrier_status::set_error_description(const char* value) {
   GOOGLE_DCHECK(value != NULL);
-  set_has_error_destination();
-  error_destination_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
-  // @@protoc_insertion_point(field_set_char:message.Carrier_status.error_destination)
+  set_has_error_description();
+  error_description_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
+  // @@protoc_insertion_point(field_set_char:message.Carrier_status.error_description)
 }
-inline void Carrier_status::set_error_destination(const char* value, size_t size) {
-  set_has_error_destination();
-  error_destination_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
+inline void Carrier_status::set_error_description(const char* value, size_t size) {
+  set_has_error_description();
+  error_description_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
       ::std::string(reinterpret_cast<const char*>(value), size));
-  // @@protoc_insertion_point(field_set_pointer:message.Carrier_status.error_destination)
+  // @@protoc_insertion_point(field_set_pointer:message.Carrier_status.error_description)
 }
-inline ::std::string* Carrier_status::mutable_error_destination() {
-  set_has_error_destination();
-  // @@protoc_insertion_point(field_mutable:message.Carrier_status.error_destination)
-  return error_destination_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline ::std::string* Carrier_status::mutable_error_description() {
+  set_has_error_description();
+  // @@protoc_insertion_point(field_mutable:message.Carrier_status.error_description)
+  return error_description_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
-inline ::std::string* Carrier_status::release_error_destination() {
-  // @@protoc_insertion_point(field_release:message.Carrier_status.error_destination)
-  clear_has_error_destination();
-  return error_destination_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+inline ::std::string* Carrier_status::release_error_description() {
+  // @@protoc_insertion_point(field_release:message.Carrier_status.error_description)
+  clear_has_error_description();
+  return error_description_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
 }
-inline void Carrier_status::set_allocated_error_destination(::std::string* error_destination) {
-  if (error_destination != NULL) {
-    set_has_error_destination();
+inline void Carrier_status::set_allocated_error_description(::std::string* error_description) {
+  if (error_description != NULL) {
+    set_has_error_description();
   } else {
-    clear_has_error_destination();
+    clear_has_error_description();
   }
-  error_destination_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_destination);
-  // @@protoc_insertion_point(field_set_allocated:message.Carrier_status.error_destination)
+  error_description_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_description);
+  // @@protoc_insertion_point(field_set_allocated:message.Carrier_status.error_description)
 }
 
-// optional .message.Position position = 4;
+// required .message.Position position = 4;
 inline bool Carrier_status::has_position() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000002u) != 0;
 }
 inline void Carrier_status::set_has_position() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000002u;
 }
 inline void Carrier_status::clear_has_position() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000002u;
 }
 inline void Carrier_status::clear_position() {
   if (position_ != NULL) position_->Clear();
@@ -1155,7 +1178,7 @@ inline void Harware_statu_msg::clear_has_msg_type() {
   _has_bits_[0] &= ~0x00000008u;
 }
 inline void Harware_statu_msg::clear_msg_type() {
-  msg_type_ = 1;
+  msg_type_ = 0;
   clear_has_msg_type();
 }
 inline ::message::Message_type Harware_statu_msg::msg_type() const {
@@ -1335,193 +1358,290 @@ inline void Harware_statu_msg::set_allocated_carrier3_statu(::message::Carrier_s
 
 // Execute_request_msg
 
-// required .message.Message_type msg_type = 1;
-inline bool Execute_request_msg::has_msg_type() const {
-  return (_has_bits_[0] & 0x00000002u) != 0;
-}
-inline void Execute_request_msg::set_has_msg_type() {
-  _has_bits_[0] |= 0x00000002u;
-}
-inline void Execute_request_msg::clear_has_msg_type() {
-  _has_bits_[0] &= ~0x00000002u;
-}
-inline void Execute_request_msg::clear_msg_type() {
-  msg_type_ = 1;
-  clear_has_msg_type();
-}
-inline ::message::Message_type Execute_request_msg::msg_type() const {
-  // @@protoc_insertion_point(field_get:message.Execute_request_msg.msg_type)
-  return static_cast< ::message::Message_type >(msg_type_);
-}
-inline void Execute_request_msg::set_msg_type(::message::Message_type value) {
-  assert(::message::Message_type_IsValid(value));
-  set_has_msg_type();
-  msg_type_ = value;
-  // @@protoc_insertion_point(field_set:message.Execute_request_msg.msg_type)
-}
-
-// required .message.Command_message cmd_msg = 2;
-inline bool Execute_request_msg::has_cmd_msg() const {
+// required .message.Base_msg msg_base = 1;
+inline bool Execute_request_msg::has_msg_base() const {
   return (_has_bits_[0] & 0x00000001u) != 0;
 }
-inline void Execute_request_msg::set_has_cmd_msg() {
+inline void Execute_request_msg::set_has_msg_base() {
   _has_bits_[0] |= 0x00000001u;
 }
-inline void Execute_request_msg::clear_has_cmd_msg() {
+inline void Execute_request_msg::clear_has_msg_base() {
   _has_bits_[0] &= ~0x00000001u;
 }
-inline const ::message::Command_message& Execute_request_msg::cmd_msg() const {
-  const ::message::Command_message* p = cmd_msg_;
-  // @@protoc_insertion_point(field_get:message.Execute_request_msg.cmd_msg)
-  return p != NULL ? *p : *reinterpret_cast<const ::message::Command_message*>(
-      &::message::_Command_message_default_instance_);
-}
-inline ::message::Command_message* Execute_request_msg::release_cmd_msg() {
-  // @@protoc_insertion_point(field_release:message.Execute_request_msg.cmd_msg)
-  clear_has_cmd_msg();
-  ::message::Command_message* temp = cmd_msg_;
-  cmd_msg_ = NULL;
+inline const ::message::Base_msg& Execute_request_msg::msg_base() const {
+  const ::message::Base_msg* p = msg_base_;
+  // @@protoc_insertion_point(field_get:message.Execute_request_msg.msg_base)
+  return p != NULL ? *p : *reinterpret_cast<const ::message::Base_msg*>(
+      &::message::_Base_msg_default_instance_);
+}
+inline ::message::Base_msg* Execute_request_msg::release_msg_base() {
+  // @@protoc_insertion_point(field_release:message.Execute_request_msg.msg_base)
+  clear_has_msg_base();
+  ::message::Base_msg* temp = msg_base_;
+  msg_base_ = NULL;
   return temp;
 }
-inline ::message::Command_message* Execute_request_msg::mutable_cmd_msg() {
-  set_has_cmd_msg();
-  if (cmd_msg_ == NULL) {
-    cmd_msg_ = new ::message::Command_message;
+inline ::message::Base_msg* Execute_request_msg::mutable_msg_base() {
+  set_has_msg_base();
+  if (msg_base_ == NULL) {
+    msg_base_ = new ::message::Base_msg;
   }
-  // @@protoc_insertion_point(field_mutable:message.Execute_request_msg.cmd_msg)
-  return cmd_msg_;
+  // @@protoc_insertion_point(field_mutable:message.Execute_request_msg.msg_base)
+  return msg_base_;
 }
-inline void Execute_request_msg::set_allocated_cmd_msg(::message::Command_message* cmd_msg) {
+inline void Execute_request_msg::set_allocated_msg_base(::message::Base_msg* msg_base) {
   ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
   if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(cmd_msg_);
+    delete reinterpret_cast< ::google::protobuf::MessageLite*>(msg_base_);
   }
-  if (cmd_msg) {
+  if (msg_base) {
     ::google::protobuf::Arena* submessage_arena = NULL;
     if (message_arena != submessage_arena) {
-      cmd_msg = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, cmd_msg, submessage_arena);
+      msg_base = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, msg_base, submessage_arena);
     }
-    set_has_cmd_msg();
+    set_has_msg_base();
   } else {
-    clear_has_cmd_msg();
+    clear_has_msg_base();
   }
-  cmd_msg_ = cmd_msg;
-  // @@protoc_insertion_point(field_set_allocated:message.Execute_request_msg.cmd_msg)
+  msg_base_ = msg_base;
+  // @@protoc_insertion_point(field_set_allocated:message.Execute_request_msg.msg_base)
 }
 
-// optional int32 time_out = 3 [default = 200000];
-inline bool Execute_request_msg::has_time_out() const {
+// required int32 command_id = 2;
+inline bool Execute_request_msg::has_command_id() const {
   return (_has_bits_[0] & 0x00000004u) != 0;
 }
-inline void Execute_request_msg::set_has_time_out() {
+inline void Execute_request_msg::set_has_command_id() {
   _has_bits_[0] |= 0x00000004u;
 }
-inline void Execute_request_msg::clear_has_time_out() {
+inline void Execute_request_msg::clear_has_command_id() {
   _has_bits_[0] &= ~0x00000004u;
 }
-inline void Execute_request_msg::clear_time_out() {
-  time_out_ = 200000;
-  clear_has_time_out();
+inline void Execute_request_msg::clear_command_id() {
+  command_id_ = 0;
+  clear_has_command_id();
 }
-inline ::google::protobuf::int32 Execute_request_msg::time_out() const {
-  // @@protoc_insertion_point(field_get:message.Execute_request_msg.time_out)
-  return time_out_;
+inline ::google::protobuf::int32 Execute_request_msg::command_id() const {
+  // @@protoc_insertion_point(field_get:message.Execute_request_msg.command_id)
+  return command_id_;
 }
-inline void Execute_request_msg::set_time_out(::google::protobuf::int32 value) {
-  set_has_time_out();
-  time_out_ = value;
-  // @@protoc_insertion_point(field_set:message.Execute_request_msg.time_out)
+inline void Execute_request_msg::set_command_id(::google::protobuf::int32 value) {
+  set_has_command_id();
+  command_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Execute_request_msg.command_id)
 }
 
-// -------------------------------------------------------------------
-
-// Execute_response_msg
-
-// required .message.Message_type msg_type = 1;
-inline bool Execute_response_msg::has_msg_type() const {
+// required .message.Action_type action_type = 3;
+inline bool Execute_request_msg::has_action_type() const {
   return (_has_bits_[0] & 0x00000008u) != 0;
 }
-inline void Execute_response_msg::set_has_msg_type() {
+inline void Execute_request_msg::set_has_action_type() {
   _has_bits_[0] |= 0x00000008u;
 }
-inline void Execute_response_msg::clear_has_msg_type() {
+inline void Execute_request_msg::clear_has_action_type() {
   _has_bits_[0] &= ~0x00000008u;
 }
-inline void Execute_response_msg::clear_msg_type() {
-  msg_type_ = 1;
-  clear_has_msg_type();
+inline void Execute_request_msg::clear_action_type() {
+  action_type_ = 0;
+  clear_has_action_type();
 }
-inline ::message::Message_type Execute_response_msg::msg_type() const {
-  // @@protoc_insertion_point(field_get:message.Execute_response_msg.msg_type)
-  return static_cast< ::message::Message_type >(msg_type_);
+inline ::message::Action_type Execute_request_msg::action_type() const {
+  // @@protoc_insertion_point(field_get:message.Execute_request_msg.action_type)
+  return static_cast< ::message::Action_type >(action_type_);
 }
-inline void Execute_response_msg::set_msg_type(::message::Message_type value) {
-  assert(::message::Message_type_IsValid(value));
-  set_has_msg_type();
-  msg_type_ = value;
-  // @@protoc_insertion_point(field_set:message.Execute_response_msg.msg_type)
+inline void Execute_request_msg::set_action_type(::message::Action_type value) {
+  assert(::message::Action_type_IsValid(value));
+  set_has_action_type();
+  action_type_ = value;
+  // @@protoc_insertion_point(field_set:message.Execute_request_msg.action_type)
+}
+
+// required int32 from_id = 4;
+inline bool Execute_request_msg::has_from_id() const {
+  return (_has_bits_[0] & 0x00000010u) != 0;
+}
+inline void Execute_request_msg::set_has_from_id() {
+  _has_bits_[0] |= 0x00000010u;
+}
+inline void Execute_request_msg::clear_has_from_id() {
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline void Execute_request_msg::clear_from_id() {
+  from_id_ = 0;
+  clear_has_from_id();
+}
+inline ::google::protobuf::int32 Execute_request_msg::from_id() const {
+  // @@protoc_insertion_point(field_get:message.Execute_request_msg.from_id)
+  return from_id_;
+}
+inline void Execute_request_msg::set_from_id(::google::protobuf::int32 value) {
+  set_has_from_id();
+  from_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Execute_request_msg.from_id)
+}
+
+// required int32 destination = 5;
+inline bool Execute_request_msg::has_destination() const {
+  return (_has_bits_[0] & 0x00000020u) != 0;
+}
+inline void Execute_request_msg::set_has_destination() {
+  _has_bits_[0] |= 0x00000020u;
+}
+inline void Execute_request_msg::clear_has_destination() {
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline void Execute_request_msg::clear_destination() {
+  destination_ = 0;
+  clear_has_destination();
+}
+inline ::google::protobuf::int32 Execute_request_msg::destination() const {
+  // @@protoc_insertion_point(field_get:message.Execute_request_msg.destination)
+  return destination_;
+}
+inline void Execute_request_msg::set_destination(::google::protobuf::int32 value) {
+  set_has_destination();
+  destination_ = value;
+  // @@protoc_insertion_point(field_set:message.Execute_request_msg.destination)
 }
 
-// required .message.Command_message cmd_msg = 2;
-inline bool Execute_response_msg::has_cmd_msg() const {
+// required .message.Locate_information locate_information = 6;
+inline bool Execute_request_msg::has_locate_information() const {
   return (_has_bits_[0] & 0x00000002u) != 0;
 }
-inline void Execute_response_msg::set_has_cmd_msg() {
+inline void Execute_request_msg::set_has_locate_information() {
   _has_bits_[0] |= 0x00000002u;
 }
-inline void Execute_response_msg::clear_has_cmd_msg() {
+inline void Execute_request_msg::clear_has_locate_information() {
   _has_bits_[0] &= ~0x00000002u;
 }
-inline const ::message::Command_message& Execute_response_msg::cmd_msg() const {
-  const ::message::Command_message* p = cmd_msg_;
-  // @@protoc_insertion_point(field_get:message.Execute_response_msg.cmd_msg)
-  return p != NULL ? *p : *reinterpret_cast<const ::message::Command_message*>(
-      &::message::_Command_message_default_instance_);
-}
-inline ::message::Command_message* Execute_response_msg::release_cmd_msg() {
-  // @@protoc_insertion_point(field_release:message.Execute_response_msg.cmd_msg)
-  clear_has_cmd_msg();
-  ::message::Command_message* temp = cmd_msg_;
-  cmd_msg_ = NULL;
+inline const ::message::Locate_information& Execute_request_msg::locate_information() const {
+  const ::message::Locate_information* p = locate_information_;
+  // @@protoc_insertion_point(field_get:message.Execute_request_msg.locate_information)
+  return p != NULL ? *p : *reinterpret_cast<const ::message::Locate_information*>(
+      &::message::_Locate_information_default_instance_);
+}
+inline ::message::Locate_information* Execute_request_msg::release_locate_information() {
+  // @@protoc_insertion_point(field_release:message.Execute_request_msg.locate_information)
+  clear_has_locate_information();
+  ::message::Locate_information* temp = locate_information_;
+  locate_information_ = NULL;
   return temp;
 }
-inline ::message::Command_message* Execute_response_msg::mutable_cmd_msg() {
-  set_has_cmd_msg();
-  if (cmd_msg_ == NULL) {
-    cmd_msg_ = new ::message::Command_message;
+inline ::message::Locate_information* Execute_request_msg::mutable_locate_information() {
+  set_has_locate_information();
+  if (locate_information_ == NULL) {
+    locate_information_ = new ::message::Locate_information;
   }
-  // @@protoc_insertion_point(field_mutable:message.Execute_response_msg.cmd_msg)
-  return cmd_msg_;
+  // @@protoc_insertion_point(field_mutable:message.Execute_request_msg.locate_information)
+  return locate_information_;
 }
-inline void Execute_response_msg::set_allocated_cmd_msg(::message::Command_message* cmd_msg) {
+inline void Execute_request_msg::set_allocated_locate_information(::message::Locate_information* locate_information) {
   ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
   if (message_arena == NULL) {
-    delete reinterpret_cast< ::google::protobuf::MessageLite*>(cmd_msg_);
+    delete reinterpret_cast< ::google::protobuf::MessageLite*>(locate_information_);
   }
-  if (cmd_msg) {
+  if (locate_information) {
     ::google::protobuf::Arena* submessage_arena = NULL;
     if (message_arena != submessage_arena) {
-      cmd_msg = ::google::protobuf::internal::GetOwnedMessage(
-          message_arena, cmd_msg, submessage_arena);
+      locate_information = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, locate_information, submessage_arena);
     }
-    set_has_cmd_msg();
+    set_has_locate_information();
   } else {
-    clear_has_cmd_msg();
+    clear_has_locate_information();
   }
-  cmd_msg_ = cmd_msg;
-  // @@protoc_insertion_point(field_set_allocated:message.Execute_response_msg.cmd_msg)
+  locate_information_ = locate_information;
+  // @@protoc_insertion_point(field_set_allocated:message.Execute_request_msg.locate_information)
+}
+
+// -------------------------------------------------------------------
+
+// Execute_response_msg
+
+// required .message.Base_msg msg_base = 1;
+inline bool Execute_response_msg::has_msg_base() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void Execute_response_msg::set_has_msg_base() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void Execute_response_msg::clear_has_msg_base() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline const ::message::Base_msg& Execute_response_msg::msg_base() const {
+  const ::message::Base_msg* p = msg_base_;
+  // @@protoc_insertion_point(field_get:message.Execute_response_msg.msg_base)
+  return p != NULL ? *p : *reinterpret_cast<const ::message::Base_msg*>(
+      &::message::_Base_msg_default_instance_);
+}
+inline ::message::Base_msg* Execute_response_msg::release_msg_base() {
+  // @@protoc_insertion_point(field_release:message.Execute_response_msg.msg_base)
+  clear_has_msg_base();
+  ::message::Base_msg* temp = msg_base_;
+  msg_base_ = NULL;
+  return temp;
+}
+inline ::message::Base_msg* Execute_response_msg::mutable_msg_base() {
+  set_has_msg_base();
+  if (msg_base_ == NULL) {
+    msg_base_ = new ::message::Base_msg;
+  }
+  // @@protoc_insertion_point(field_mutable:message.Execute_response_msg.msg_base)
+  return msg_base_;
+}
+inline void Execute_response_msg::set_allocated_msg_base(::message::Base_msg* msg_base) {
+  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
+  if (message_arena == NULL) {
+    delete reinterpret_cast< ::google::protobuf::MessageLite*>(msg_base_);
+  }
+  if (msg_base) {
+    ::google::protobuf::Arena* submessage_arena = NULL;
+    if (message_arena != submessage_arena) {
+      msg_base = ::google::protobuf::internal::GetOwnedMessage(
+          message_arena, msg_base, submessage_arena);
+    }
+    set_has_msg_base();
+  } else {
+    clear_has_msg_base();
+  }
+  msg_base_ = msg_base;
+  // @@protoc_insertion_point(field_set_allocated:message.Execute_response_msg.msg_base)
+}
+
+// required int32 command_id = 2;
+inline bool Execute_response_msg::has_command_id() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void Execute_response_msg::set_has_command_id() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void Execute_response_msg::clear_has_command_id() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void Execute_response_msg::clear_command_id() {
+  command_id_ = 0;
+  clear_has_command_id();
+}
+inline ::google::protobuf::int32 Execute_response_msg::command_id() const {
+  // @@protoc_insertion_point(field_get:message.Execute_response_msg.command_id)
+  return command_id_;
+}
+inline void Execute_response_msg::set_command_id(::google::protobuf::int32 value) {
+  set_has_command_id();
+  command_id_ = value;
+  // @@protoc_insertion_point(field_set:message.Execute_response_msg.command_id)
 }
 
 // required int32 error_code = 3;
 inline bool Execute_response_msg::has_error_code() const {
-  return (_has_bits_[0] & 0x00000004u) != 0;
+  return (_has_bits_[0] & 0x00000008u) != 0;
 }
 inline void Execute_response_msg::set_has_error_code() {
-  _has_bits_[0] |= 0x00000004u;
+  _has_bits_[0] |= 0x00000008u;
 }
 inline void Execute_response_msg::clear_has_error_code() {
-  _has_bits_[0] &= ~0x00000004u;
+  _has_bits_[0] &= ~0x00000008u;
 }
 inline void Execute_response_msg::clear_error_code() {
   error_code_ = 0;
@@ -1624,6 +1744,11 @@ template <>
 inline const EnumDescriptor* GetEnumDescriptor< ::message::Hardware_statu>() {
   return ::message::Hardware_statu_descriptor();
 }
+template <> struct is_proto_enum< ::message::Action_type> : ::google::protobuf::internal::true_type {};
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< ::message::Action_type>() {
+  return ::message::Action_type_descriptor();
+}
 
 }  // namespace protobuf
 }  // namespace google

+ 19 - 9
message/hardware_message.proto

@@ -17,40 +17,50 @@ message Position
     required float x=1;
     required float y=2;
     required float z=3;
+
 }
 
 //搬运器状态
 message Carrier_status
 {
     required Hardware_statu             statu=1;                   //状态
-    optional Command_message            cmd_msg=2;                 //正在执行的指令信息(可无)
-    optional string                     error_destination=3;       //搬运器错误信息(可无)
-    optional Position                   position=4;                //搬运器位置(z表示电梯位置)
+    optional int32                      command_id=2;                   //指令唯一标识符id
+    optional string                     error_description=3;       //搬运器错误信息(可无)
+    required Position                   position=4;                //搬运器位置(z表示电梯位置)
     required bool                       empty=5;                   //是否空载
 }
 
 //搬运机构各个零部件状态
 message Harware_statu_msg
 {
-    required Message_type               msg_type=1;         //消息类型
+    required Message_type               msg_type=1;                 //消息类型
     required Carrier_status             carrier1_statu=2;           //搬运器1状态
     required Carrier_status             carrier2_statu=3;           //搬运器2状态
     required Carrier_status             carrier3_statu=4;           //搬运器3状态
 }
 
+enum Action_type
+{
+    ePark=0;
+    ePick=1;
+}
+
 //执行搬运请求
 message Execute_request_msg
 {
-    required Message_type               msg_type=1;         //消息类型
-    required Command_message            cmd_msg=2;                              //指令信息
-    optional int32                      time_out=3 [default=200000];           //定位测量超时设置,默认200s
+    required Base_msg                   msg_base=1;         //消息类型                         //消息类型
+    required int32                      command_id=2;                   //指令唯一标识符id
+    required Action_type                action_type=3;
+    required int32                      from_id=4;
+    required int32                      destination=5;
+    required Locate_information         locate_information=6;
 }
 
 //搬运动作执行完成后反馈结果
 message Execute_response_msg
 {
-    required Message_type               msg_type=1;         //消息类型
-    required Command_message            cmd_msg=2;
+    required Base_msg                   msg_base=1;                     //消息类型
+    required int32                      command_id=2;                   //指令唯一标识符id
     required int32                      error_code=3;
     optional string                     error_description=4;
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1661 - 0
message/measure_message.pb.cc


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1123 - 0
message/measure_message.pb.h


+ 67 - 0
message/measure_message.proto

@@ -0,0 +1,67 @@
+syntax = "proto2";
+package message;
+import "message_base.proto";
+
+//雷达管理模块的工作状态
+enum Laser_manager_status
+{
+    LASER_MANAGER_UNKNOW               	= 0;    //未知
+    LASER_MANAGER_READY               	= 1;    //准备,待机
+	LASER_MANAGER_ISSUED_TASK			= 2;	//工作下发任务
+	LASER_MANAGER_WAIT_REPLY			= 3;	//工作等待答复
+	LASER_MANAGER_FAULT					= 4;	//故障
+}
+	
+//子雷达状态
+enum Laser_statu
+{
+	LASER_DISCONNECT	=0;	        //雷达断连
+	LASER_READY			=1;			//雷达正常待机,空闲
+	LASER_BUSY			=2;	        //雷达正在工作,正忙
+	LASER_FAULT			=3;         //雷达错误
+}
+
+//定位管理模块的工作状态
+enum Locate_manager_status
+{
+	LOCATE_MANAGER_UNKNOW               	= 0;    //未知
+	LOCATE_MANAGER_READY               		= 1;    //准备,待机
+	LOCATE_MANAGER_SIFT						= 2;	//sift点云筛选; 将车身和轮胎的点剥离出来
+	LOCATE_MANAGER_CAR						= 3;	//通过车身 计算汽车的定位信息.
+	LOCATE_MANAGER_WHEEL					= 4;	//通过车轮 计算汽车的定位信息.
+	LOCATE_MANAGER_FAULT					= 5;	//故障
+}
+	
+	
+//定位模块状态
+message Locate_status_msg
+{
+    required Base_msg                   msg_type=1;                 //消息类型
+
+    required Laser_manager_status       laser_manager_status = 2;
+    repeated Laser_statu                laser_statu_vector = 3;
+    required Locate_manager_status      locate_manager_status = 4;
+
+    required Locate_information         locate_information_realtime=5;  //地面雷达的 实时定位信息
+}
+
+
+//定位请求消息
+message Locate_request_msg
+{
+    required Base_msg                   msg_base=1;         //消息类型
+    required int32                      command_id=2;                   //指令唯一标识符id
+    required int32                      terminal_id=3;          //终端id
+}
+
+//定位测量返回消息
+message Locate_response_msg
+{
+    required Base_msg                   msg_base=1;                          //消息类型
+    required int32                      command_id=2;                   //指令唯一标识符id
+    required int32                      terminal_id=3;
+    required Locate_information         locate_information=4;
+    required Error_manager              error_manager = 5;
+}
+
+

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1175 - 206
message/message_base.pb.cc


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 843 - 164
message/message_base.pb.h


+ 68 - 17
message/message_base.proto

@@ -4,29 +4,80 @@ package message;
 //消息类型定义;每个在网络上传输的消息必须含有这个属性
 enum Message_type
 {
-	COMMAND_MESSAGE				= 0X01;					//指令消息
+    eBase_msg=0x00;
+    eCommand_msg=0x01;                      //指令消息
 
-	SENSING_STATUS_MESSAGE		= 0X11;                	//定位模块状态消息
-	SENSING_REQUEST_MESSAGE		= 0X12;               	//定位请求消息
-	SENSING_RESPONSE_MESSAGE	= 0X13;              	//定位反馈消息
 
-	HARWARE_STATU_MESSAGE		= 0X21;                	//调度模块硬件状态消息
-	EXECUTE_REQUEST_MESSAGE		= 0X22;              	//请求调度消息
-	EXECUTE_RESPONSE_MESSAGE	= 0X23;             	//调度结果反馈消息
+    eLocate_status_msg=0x11;                //定位模块状态消息
+    eLocate_request_msg=0x12;               //定位请求消息
+    eLocate_response_msg=0x13;              //定位反馈消息
+
+
+    eHarware_statu_msg=0x21;                //调度模块硬件状态消息
+    eExecute_request_msg=0x22;              //请求调度消息
+    eExecute_response_msg=0x23;             //调度结果反馈消息
+
 }
 
-enum Action_type
+//通讯单元
+enum Communicator
+{
+    eEmpty=0x0000;
+    eMain=0x0001;    //主流程
+
+    eTerminor=0x0100;
+    //数据表
+    eTable=0x0200;
+    //测量单元
+    eMeasurer=0x0300;
+    //调度机构
+    eProcess=0x0400;
+    //...
+
+
+}
+////base message 用于解析未知类型的消息
+message Base_msg
 {
-    ePark=0;
-    ePick=1;
+    required Message_type               msg_type=1;
+    optional int32                      timeout_ms=2;
+    required Communicator               sender=3;                       //发送者
+    required Communicator               receiver=4;                     //接收者
 }
 
-//指令信息
-message Command_message
+
+//错误等级,用来做故障处理
+enum Error_level
 {
-    required Message_type               msg_type=1;         //消息类型
-    required int32                      command_id=2;                //指令唯一标识符id
-    required Action_type                act_type=3;                  //指令类型
-    required int32                      from_id=4;                   //指令动作出发地
-    required int32                      destination_id=5;            //指令动作目的地
+    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;		    //整车的校准标记位
 }

+ 0 - 81
message/sensing_message.proto

@@ -1,81 +0,0 @@
-syntax = "proto2";
-package message;
-import "message_base.proto";
-
-//雷达管理模块的工作状态
-enum Laser_manager_status
-{
-    LASER_MANAGER_UNKNOW               	= 0;    //未知
-    LASER_MANAGER_READY               	= 1;    //准备,待机
-	LASER_MANAGER_ISSUED_TASK			= 2;	//工作下发任务
-	LASER_MANAGER_WAIT_REPLY			= 3;	//工作等待答复
-	LASER_MANAGER_FAULT					= 4;	//故障
-}
-	
-//子雷达状态
-enum Laser_statu
-{
-	LASER_DISCONNECT	=0;	        //雷达断连
-	LASER_READY			=1;			//雷达正常待机,空闲
-	LASER_BUSY			=2;	        //雷达正在工作,正忙
-	LASER_FAULT			=3;         //雷达错误
-}
-
-//定位管理模块的工作状态
-enum Locate_manager_status
-{
-	LOCATE_MANAGER_UNKNOW               	= 0;    //未知
-	LOCATE_MANAGER_READY               		= 1;    //准备,待机
-	LOCATE_MANAGER_SIFT						= 2;	//sift点云筛选; 将车身和轮胎的点剥离出来
-	LOCATE_MANAGER_CAR						= 3;	//通过车身 计算汽车的定位信息.
-	LOCATE_MANAGER_WHEEL					= 4;	//通过车轮 计算汽车的定位信息.
-	LOCATE_MANAGER_FAULT					= 5;	//故障
-}
-	
-	
-//定位模块状态
-message Locate_status_msg
-{
-    required Message_type               msg_type=1;                 //消息类型
-    optional Command_message            cmd_msg=2;                  //正在执行的指令信息(可无)
-
-    required Laser_manager_status       laser_manager_status = 3;
-    repeated Laser_statu                laser_statu_vector = 4;
-    required Locate_manager_status      locate_manager_status = 5;
-}
-
-//定位类型
-enum Locate_type
-{
-    eReal_time=0;           //实时定位;返回地面雷达实时数据
-    eTrigger=1;             //触发式定位;返回综合测量结果
-    eStop = 2;
-}
-
-//定位请求消息
-message Locate_request_msg
-{
-    required Message_type               msg_type=1;         //消息类型
-    required Command_message            cmd_msg=2;                 //指令信息
-    required Locate_type                locate_type=3;
-    optional int32                      time_out=4 [default=5000];           //定位测量超时设置
-}
-
-//定位测量返回消息
-message Locate_response_msg
-{
-    required Message_type               msg_type=1;         //消息类型
-    required Command_message            cmd_msg=2;
-    required int32                      error_code=3;
-    optional string                     error_description=4;
-    optional float                      length=5;
-    optional float                      width=6;
-    optional float                      height=7;
-    optional float                      wheel_base=8;
-    optional float                      x=9;
-    optional float                      y=10;
-    optional float                      theta=11;
-
-}
-
-

+ 1 - 1
proto.sh

@@ -1,4 +1,4 @@
 protoc -I=./message message_base.proto --cpp_out=./message
-protoc -I=./message sensing_message.proto --cpp_out=./message
+protoc -I=./message measure_message.proto --cpp_out=./message
 protoc -I=./message hardware_message.proto --cpp_out=./message
 protoc -I=./ setting.proto --cpp_out=./

+ 13 - 0
test.txt

@@ -0,0 +1,13 @@
+//消息类型定义,每个在网络上传输的消息必须含有这个属性
+	enum Message_type
+	{
+		COMMAND_MESSAGE				= 0X01,                //指令消息
+
+		LOCATE_STATUS_MESSAGE		= 0X11,                	//定位模块状态消息
+		LOCATE_REQUEST_MESSAGE		= 0X12,               	//定位请求消息
+		LOCATE_RESPONSE_MESSAGE		= 0X13,              	//定位反馈消息
+
+		HARWARE_STATU_MESSAGE		= 0X21,                	//调度模块硬件状态消息
+		EXECUTE_REQUEST_MESSAGE		= 0X22,              	//请求调度消息
+		EXECUTE_RESPONSE_MESSAGE	= 0X23,             	//调度结果反馈消息
+	},