Browse Source

1.添加手动操作sevice

gf 1 year ago
parent
commit
98fa08e322

+ 3 - 2
MPC/custom_type.h

@@ -16,12 +16,13 @@ enum MpcError {
 //////////////////////////////////////////////////
 
 //////////////////////////////////////////////////
-/// MPC Rotate 可选方向
-enum MpcRotateDirection{
+/// 基准可选方向
+enum Direction{
     eForward = 0x0001,
     eBackward= 0x0002,
     eLeft    = 0x0004,
     eRight   = 0x0008,
 };
 //////////////////////////////////////////////////
+
 #endif //NAVIGATION_CUSTOM_TYPE_H

+ 42 - 0
MPC/monitor/emqx/message.grpc.pb.cc

@@ -24,6 +24,7 @@ namespace NavMessage {
 static const char* NavExcutor_method_names[] = {
   "/NavMessage.NavExcutor/Start",
   "/NavMessage.NavExcutor/Cancel",
+  "/NavMessage.NavExcutor/ManualOperation",
 };
 
 std::unique_ptr< NavExcutor::Stub> NavExcutor::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
@@ -35,6 +36,7 @@ std::unique_ptr< NavExcutor::Stub> NavExcutor::NewStub(const std::shared_ptr< ::
 NavExcutor::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options)
   : channel_(channel), rpcmethod_Start_(NavExcutor_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
   , rpcmethod_Cancel_(NavExcutor_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
+  , rpcmethod_ManualOperation_(NavExcutor_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
   {}
 
 ::grpc::Status NavExcutor::Stub::Start(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::NavMessage::NavResponse* response) {
@@ -83,6 +85,29 @@ void NavExcutor::Stub::async::Cancel(::grpc::ClientContext* context, const ::Nav
   return result;
 }
 
+::grpc::Status NavExcutor::Stub::ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::NavMessage::NavResponse* response) {
+  return ::grpc::internal::BlockingUnaryCall< ::NavMessage::ManualCmd, ::NavMessage::NavResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_ManualOperation_, context, request, response);
+}
+
+void NavExcutor::Stub::async::ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response, std::function<void(::grpc::Status)> f) {
+  ::grpc::internal::CallbackUnaryCall< ::NavMessage::ManualCmd, ::NavMessage::NavResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ManualOperation_, context, request, response, std::move(f));
+}
+
+void NavExcutor::Stub::async::ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response, ::grpc::ClientUnaryReactor* reactor) {
+  ::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_ManualOperation_, context, request, response, reactor);
+}
+
+::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>* NavExcutor::Stub::PrepareAsyncManualOperationRaw(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) {
+  return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::NavMessage::NavResponse, ::NavMessage::ManualCmd, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_ManualOperation_, context, request);
+}
+
+::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>* NavExcutor::Stub::AsyncManualOperationRaw(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) {
+  auto* result =
+    this->PrepareAsyncManualOperationRaw(context, request, cq);
+  result->StartCall();
+  return result;
+}
+
 NavExcutor::Service::Service() {
   AddMethod(new ::grpc::internal::RpcServiceMethod(
       NavExcutor_method_names[0],
@@ -104,6 +129,16 @@ NavExcutor::Service::Service() {
              ::NavMessage::NavResponse* resp) {
                return service->Cancel(ctx, req, resp);
              }, this)));
+  AddMethod(new ::grpc::internal::RpcServiceMethod(
+      NavExcutor_method_names[2],
+      ::grpc::internal::RpcMethod::NORMAL_RPC,
+      new ::grpc::internal::RpcMethodHandler< NavExcutor::Service, ::NavMessage::ManualCmd, ::NavMessage::NavResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
+          [](NavExcutor::Service* service,
+             ::grpc::ServerContext* ctx,
+             const ::NavMessage::ManualCmd* req,
+             ::NavMessage::NavResponse* resp) {
+               return service->ManualOperation(ctx, req, resp);
+             }, this)));
 }
 
 NavExcutor::Service::~Service() {
@@ -123,6 +158,13 @@ NavExcutor::Service::~Service() {
   return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
 }
 
+::grpc::Status NavExcutor::Service::ManualOperation(::grpc::ServerContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response) {
+  (void) context;
+  (void) request;
+  (void) response;
+  return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+}
+
 
 }  // namespace NavMessage
 

+ 161 - 4
MPC/monitor/emqx/message.grpc.pb.h

@@ -49,6 +49,13 @@ class NavExcutor final {
     std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>> PrepareAsyncCancel(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::grpc::CompletionQueue* cq) {
       return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>>(PrepareAsyncCancelRaw(context, request, cq));
     }
+    virtual ::grpc::Status ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::NavMessage::NavResponse* response) = 0;
+    std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>> AsyncManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>>(AsyncManualOperationRaw(context, request, cq));
+    }
+    std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>> PrepareAsyncManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>>(PrepareAsyncManualOperationRaw(context, request, cq));
+    }
     class async_interface {
      public:
       virtual ~async_interface() {}
@@ -56,6 +63,8 @@ class NavExcutor final {
       virtual void Start(::grpc::ClientContext* context, const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0;
       virtual void Cancel(::grpc::ClientContext* context, const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response, std::function<void(::grpc::Status)>) = 0;
       virtual void Cancel(::grpc::ClientContext* context, const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0;
+      virtual void ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response, std::function<void(::grpc::Status)>) = 0;
+      virtual void ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response, ::grpc::ClientUnaryReactor* reactor) = 0;
     };
     typedef class async_interface experimental_async_interface;
     virtual class async_interface* async() { return nullptr; }
@@ -65,6 +74,8 @@ class NavExcutor final {
     virtual ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>* PrepareAsyncStartRaw(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::grpc::CompletionQueue* cq) = 0;
     virtual ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>* AsyncCancelRaw(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::grpc::CompletionQueue* cq) = 0;
     virtual ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>* PrepareAsyncCancelRaw(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::grpc::CompletionQueue* cq) = 0;
+    virtual ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>* AsyncManualOperationRaw(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) = 0;
+    virtual ::grpc::ClientAsyncResponseReaderInterface< ::NavMessage::NavResponse>* PrepareAsyncManualOperationRaw(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) = 0;
   };
   class Stub final : public StubInterface {
    public:
@@ -83,6 +94,13 @@ class NavExcutor final {
     std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>> PrepareAsyncCancel(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::grpc::CompletionQueue* cq) {
       return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>>(PrepareAsyncCancelRaw(context, request, cq));
     }
+    ::grpc::Status ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::NavMessage::NavResponse* response) override;
+    std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>> AsyncManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>>(AsyncManualOperationRaw(context, request, cq));
+    }
+    std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>> PrepareAsyncManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) {
+      return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>>(PrepareAsyncManualOperationRaw(context, request, cq));
+    }
     class async final :
       public StubInterface::async_interface {
      public:
@@ -90,6 +108,8 @@ class NavExcutor final {
       void Start(::grpc::ClientContext* context, const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response, ::grpc::ClientUnaryReactor* reactor) override;
       void Cancel(::grpc::ClientContext* context, const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response, std::function<void(::grpc::Status)>) override;
       void Cancel(::grpc::ClientContext* context, const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response, ::grpc::ClientUnaryReactor* reactor) override;
+      void ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response, std::function<void(::grpc::Status)>) override;
+      void ManualOperation(::grpc::ClientContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response, ::grpc::ClientUnaryReactor* reactor) override;
      private:
       friend class Stub;
       explicit async(Stub* stub): stub_(stub) { }
@@ -105,8 +125,11 @@ class NavExcutor final {
     ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>* PrepareAsyncStartRaw(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::grpc::CompletionQueue* cq) override;
     ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>* AsyncCancelRaw(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::grpc::CompletionQueue* cq) override;
     ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>* PrepareAsyncCancelRaw(::grpc::ClientContext* context, const ::NavMessage::NavCmd& request, ::grpc::CompletionQueue* cq) override;
+    ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>* AsyncManualOperationRaw(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) override;
+    ::grpc::ClientAsyncResponseReader< ::NavMessage::NavResponse>* PrepareAsyncManualOperationRaw(::grpc::ClientContext* context, const ::NavMessage::ManualCmd& request, ::grpc::CompletionQueue* cq) override;
     const ::grpc::internal::RpcMethod rpcmethod_Start_;
     const ::grpc::internal::RpcMethod rpcmethod_Cancel_;
+    const ::grpc::internal::RpcMethod rpcmethod_ManualOperation_;
   };
   static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
 
@@ -116,6 +139,7 @@ class NavExcutor final {
     virtual ~Service();
     virtual ::grpc::Status Start(::grpc::ServerContext* context, const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response);
     virtual ::grpc::Status Cancel(::grpc::ServerContext* context, const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response);
+    virtual ::grpc::Status ManualOperation(::grpc::ServerContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response);
   };
   template <class BaseClass>
   class WithAsyncMethod_Start : public BaseClass {
@@ -157,7 +181,27 @@ class NavExcutor final {
       ::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag);
     }
   };
-  typedef WithAsyncMethod_Start<WithAsyncMethod_Cancel<Service > > AsyncService;
+  template <class BaseClass>
+  class WithAsyncMethod_ManualOperation : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithAsyncMethod_ManualOperation() {
+      ::grpc::Service::MarkMethodAsync(2);
+    }
+    ~WithAsyncMethod_ManualOperation() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status ManualOperation(::grpc::ServerContext* /*context*/, const ::NavMessage::ManualCmd* /*request*/, ::NavMessage::NavResponse* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    void RequestManualOperation(::grpc::ServerContext* context, ::NavMessage::ManualCmd* request, ::grpc::ServerAsyncResponseWriter< ::NavMessage::NavResponse>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+      ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag);
+    }
+  };
+  typedef WithAsyncMethod_Start<WithAsyncMethod_Cancel<WithAsyncMethod_ManualOperation<Service > > > AsyncService;
   template <class BaseClass>
   class WithCallbackMethod_Start : public BaseClass {
    private:
@@ -212,7 +256,34 @@ class NavExcutor final {
     virtual ::grpc::ServerUnaryReactor* Cancel(
       ::grpc::CallbackServerContext* /*context*/, const ::NavMessage::NavCmd* /*request*/, ::NavMessage::NavResponse* /*response*/)  { return nullptr; }
   };
-  typedef WithCallbackMethod_Start<WithCallbackMethod_Cancel<Service > > CallbackService;
+  template <class BaseClass>
+  class WithCallbackMethod_ManualOperation : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithCallbackMethod_ManualOperation() {
+      ::grpc::Service::MarkMethodCallback(2,
+          new ::grpc::internal::CallbackUnaryHandler< ::NavMessage::ManualCmd, ::NavMessage::NavResponse>(
+            [this](
+                   ::grpc::CallbackServerContext* context, const ::NavMessage::ManualCmd* request, ::NavMessage::NavResponse* response) { return this->ManualOperation(context, request, response); }));}
+    void SetMessageAllocatorFor_ManualOperation(
+        ::grpc::MessageAllocator< ::NavMessage::ManualCmd, ::NavMessage::NavResponse>* allocator) {
+      ::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2);
+      static_cast<::grpc::internal::CallbackUnaryHandler< ::NavMessage::ManualCmd, ::NavMessage::NavResponse>*>(handler)
+              ->SetMessageAllocator(allocator);
+    }
+    ~WithCallbackMethod_ManualOperation() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status ManualOperation(::grpc::ServerContext* /*context*/, const ::NavMessage::ManualCmd* /*request*/, ::NavMessage::NavResponse* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    virtual ::grpc::ServerUnaryReactor* ManualOperation(
+      ::grpc::CallbackServerContext* /*context*/, const ::NavMessage::ManualCmd* /*request*/, ::NavMessage::NavResponse* /*response*/)  { return nullptr; }
+  };
+  typedef WithCallbackMethod_Start<WithCallbackMethod_Cancel<WithCallbackMethod_ManualOperation<Service > > > CallbackService;
   typedef CallbackService ExperimentalCallbackService;
   template <class BaseClass>
   class WithGenericMethod_Start : public BaseClass {
@@ -249,6 +320,23 @@ class NavExcutor final {
     }
   };
   template <class BaseClass>
+  class WithGenericMethod_ManualOperation : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithGenericMethod_ManualOperation() {
+      ::grpc::Service::MarkMethodGeneric(2);
+    }
+    ~WithGenericMethod_ManualOperation() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status ManualOperation(::grpc::ServerContext* /*context*/, const ::NavMessage::ManualCmd* /*request*/, ::NavMessage::NavResponse* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+  };
+  template <class BaseClass>
   class WithRawMethod_Start : public BaseClass {
    private:
     void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -289,6 +377,26 @@ class NavExcutor final {
     }
   };
   template <class BaseClass>
+  class WithRawMethod_ManualOperation : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithRawMethod_ManualOperation() {
+      ::grpc::Service::MarkMethodRaw(2);
+    }
+    ~WithRawMethod_ManualOperation() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status ManualOperation(::grpc::ServerContext* /*context*/, const ::NavMessage::ManualCmd* /*request*/, ::NavMessage::NavResponse* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    void RequestManualOperation(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
+      ::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag);
+    }
+  };
+  template <class BaseClass>
   class WithRawCallbackMethod_Start : public BaseClass {
    private:
     void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -333,6 +441,28 @@ class NavExcutor final {
       ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/)  { return nullptr; }
   };
   template <class BaseClass>
+  class WithRawCallbackMethod_ManualOperation : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithRawCallbackMethod_ManualOperation() {
+      ::grpc::Service::MarkMethodRawCallback(2,
+          new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
+            [this](
+                   ::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->ManualOperation(context, request, response); }));
+    }
+    ~WithRawCallbackMethod_ManualOperation() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable synchronous version of this method
+    ::grpc::Status ManualOperation(::grpc::ServerContext* /*context*/, const ::NavMessage::ManualCmd* /*request*/, ::NavMessage::NavResponse* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    virtual ::grpc::ServerUnaryReactor* ManualOperation(
+      ::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/)  { return nullptr; }
+  };
+  template <class BaseClass>
   class WithStreamedUnaryMethod_Start : public BaseClass {
    private:
     void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
@@ -386,9 +516,36 @@ class NavExcutor final {
     // replace default version of method with streamed unary
     virtual ::grpc::Status StreamedCancel(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::NavMessage::NavCmd,::NavMessage::NavResponse>* server_unary_streamer) = 0;
   };
-  typedef WithStreamedUnaryMethod_Start<WithStreamedUnaryMethod_Cancel<Service > > StreamedUnaryService;
+  template <class BaseClass>
+  class WithStreamedUnaryMethod_ManualOperation : public BaseClass {
+   private:
+    void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
+   public:
+    WithStreamedUnaryMethod_ManualOperation() {
+      ::grpc::Service::MarkMethodStreamed(2,
+        new ::grpc::internal::StreamedUnaryHandler<
+          ::NavMessage::ManualCmd, ::NavMessage::NavResponse>(
+            [this](::grpc::ServerContext* context,
+                   ::grpc::ServerUnaryStreamer<
+                     ::NavMessage::ManualCmd, ::NavMessage::NavResponse>* streamer) {
+                       return this->StreamedManualOperation(context,
+                         streamer);
+                  }));
+    }
+    ~WithStreamedUnaryMethod_ManualOperation() override {
+      BaseClassMustBeDerivedFromService(this);
+    }
+    // disable regular version of this method
+    ::grpc::Status ManualOperation(::grpc::ServerContext* /*context*/, const ::NavMessage::ManualCmd* /*request*/, ::NavMessage::NavResponse* /*response*/) override {
+      abort();
+      return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
+    }
+    // replace default version of method with streamed unary
+    virtual ::grpc::Status StreamedManualOperation(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::NavMessage::ManualCmd,::NavMessage::NavResponse>* server_unary_streamer) = 0;
+  };
+  typedef WithStreamedUnaryMethod_Start<WithStreamedUnaryMethod_Cancel<WithStreamedUnaryMethod_ManualOperation<Service > > > StreamedUnaryService;
   typedef Service SplitStreamedService;
-  typedef WithStreamedUnaryMethod_Start<WithStreamedUnaryMethod_Cancel<Service > > StreamedService;
+  typedef WithStreamedUnaryMethod_Start<WithStreamedUnaryMethod_Cancel<WithStreamedUnaryMethod_ManualOperation<Service > > > StreamedService;
 };
 
 }  // namespace NavMessage

+ 339 - 19
MPC/monitor/emqx/message.pb.cc

@@ -223,6 +223,28 @@ struct NavResponseDefaultTypeInternal {
 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
     PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NavResponseDefaultTypeInternal _NavResponse_default_instance_;
 template <typename>
+PROTOBUF_CONSTEXPR ManualCmd::ManualCmd(
+    ::_pbi::ConstantInitialized): _impl_{
+    /*decltype(_impl_.key_)*/ {
+    &::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized {}
+  }
+
+  , /*decltype(_impl_.operation_type_)*/ 0
+
+  , /*decltype(_impl_.velocity_)*/ 0
+
+  , /*decltype(_impl_._cached_size_)*/{}} {}
+struct ManualCmdDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR ManualCmdDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
+  ~ManualCmdDefaultTypeInternal() {}
+  union {
+    ManualCmd _instance;
+  };
+};
+
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
+    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ManualCmdDefaultTypeInternal _ManualCmd_default_instance_;
+template <typename>
 PROTOBUF_CONSTEXPR NavStatu::NavStatu(
     ::_pbi::ConstantInitialized): _impl_{
     /*decltype(_impl_._has_bits_)*/{}
@@ -279,7 +301,7 @@ struct RobotStatuDefaultTypeInternal {
 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
     PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RobotStatuDefaultTypeInternal _RobotStatu_default_instance_;
 }  // namespace NavMessage
-static ::_pb::Metadata file_level_metadata_message_2eproto[11];
+static ::_pb::Metadata file_level_metadata_message_2eproto[12];
 static constexpr const ::_pb::EnumDescriptor**
     file_level_enum_descriptors_message_2eproto = nullptr;
 static constexpr const ::_pb::ServiceDescriptor**
@@ -403,6 +425,17 @@ const ::uint32_t TableStruct_message_2eproto::offsets[] PROTOBUF_SECTION_VARIABL
     ~0u,  // no sizeof(Split)
     PROTOBUF_FIELD_OFFSET(::NavMessage::NavResponse, _impl_.ret_),
     PROTOBUF_FIELD_OFFSET(::NavMessage::NavResponse, _impl_.info_),
+    ~0u,  // no _has_bits_
+    PROTOBUF_FIELD_OFFSET(::NavMessage::ManualCmd, _internal_metadata_),
+    ~0u,  // no _extensions_
+    ~0u,  // no _oneof_case_
+    ~0u,  // no _weak_field_map_
+    ~0u,  // no _inlined_string_donated_
+    ~0u,  // no _split_
+    ~0u,  // no sizeof(Split)
+    PROTOBUF_FIELD_OFFSET(::NavMessage::ManualCmd, _impl_.key_),
+    PROTOBUF_FIELD_OFFSET(::NavMessage::ManualCmd, _impl_.operation_type_),
+    PROTOBUF_FIELD_OFFSET(::NavMessage::ManualCmd, _impl_.velocity_),
     PROTOBUF_FIELD_OFFSET(::NavMessage::NavStatu, _impl_._has_bits_),
     PROTOBUF_FIELD_OFFSET(::NavMessage::NavStatu, _internal_metadata_),
     ~0u,  // no _extensions_
@@ -458,8 +491,9 @@ static const ::_pbi::MigrationSchema
         { 74, 89, -1, sizeof(::NavMessage::NewAction)},
         { 96, -1, -1, sizeof(::NavMessage::NavCmd)},
         { 107, -1, -1, sizeof(::NavMessage::NavResponse)},
-        { 117, 134, -1, sizeof(::NavMessage::NavStatu)},
-        { 143, 155, -1, sizeof(::NavMessage::RobotStatu)},
+        { 117, -1, -1, sizeof(::NavMessage::ManualCmd)},
+        { 128, 145, -1, sizeof(::NavMessage::NavStatu)},
+        { 154, 166, -1, sizeof(::NavMessage::RobotStatu)},
 };
 
 static const ::_pb::Message* const file_default_instances[] = {
@@ -472,6 +506,7 @@ static const ::_pb::Message* const file_default_instances[] = {
     &::NavMessage::_NewAction_default_instance_._instance,
     &::NavMessage::_NavCmd_default_instance_._instance,
     &::NavMessage::_NavResponse_default_instance_._instance,
+    &::NavMessage::_ManualCmd_default_instance_._instance,
     &::NavMessage::_NavStatu_default_instance_._instance,
     &::NavMessage::_RobotStatu_default_instance_._instance,
 };
@@ -496,30 +531,34 @@ const char descriptor_table_protodef_message_2eproto[] PROTOBUF_SECTION_VARIABLE
     "\n\006NavCmd\022\016\n\006action\030\001 \001(\005\022\013\n\003key\030\002 \001(\t\022)\n"
     "\nnewActions\030\005 \003(\0132\025.NavMessage.NewAction"
     "\"(\n\013NavResponse\022\013\n\003ret\030\001 \001(\005\022\014\n\004info\030\002 \001"
-    "(\t\"\366\001\n\010NavStatu\022\r\n\005statu\030\001 \001(\005\022\020\n\010main_a"
-    "gv\030\002 \001(\010\022\021\n\tmove_mode\030\003 \001(\005\022(\n\004odom\030\004 \001("
-    "\0132\032.NavMessage.LidarOdomStatu\022\013\n\003key\030\005 \001"
-    "(\t\022-\n\rselected_traj\030\006 \001(\0132\026.NavMessage.T"
-    "rajectory\022,\n\014predict_traj\030\007 \001(\0132\026.NavMes"
-    "sage.Trajectory\022\020\n\010in_space\030\010 \001(\010\022\020\n\010spa"
-    "ce_id\030\t \001(\t\"Y\n\nRobotStatu\022\t\n\001x\030\001 \001(\002\022\t\n\001"
-    "y\030\002 \001(\002\022\r\n\005theta\030\003 \001(\002\022&\n\010agvStatu\030\004 \001(\013"
-    "2\024.NavMessage.AgvStatu2}\n\nNavExcutor\0226\n\005"
-    "Start\022\022.NavMessage.NavCmd\032\027.NavMessage.N"
-    "avResponse\"\000\0227\n\006Cancel\022\022.NavMessage.NavC"
-    "md\032\027.NavMessage.NavResponse\"\000b\006proto3"
+    "(\t\"B\n\tManualCmd\022\013\n\003key\030\001 \001(\t\022\026\n\016operatio"
+    "n_type\030\002 \001(\005\022\020\n\010velocity\030\003 \001(\002\"\366\001\n\010NavSt"
+    "atu\022\r\n\005statu\030\001 \001(\005\022\020\n\010main_agv\030\002 \001(\010\022\021\n\t"
+    "move_mode\030\003 \001(\005\022(\n\004odom\030\004 \001(\0132\032.NavMessa"
+    "ge.LidarOdomStatu\022\013\n\003key\030\005 \001(\t\022-\n\rselect"
+    "ed_traj\030\006 \001(\0132\026.NavMessage.Trajectory\022,\n"
+    "\014predict_traj\030\007 \001(\0132\026.NavMessage.Traject"
+    "ory\022\020\n\010in_space\030\010 \001(\010\022\020\n\010space_id\030\t \001(\t\""
+    "Y\n\nRobotStatu\022\t\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\022\r\n\005t"
+    "heta\030\003 \001(\002\022&\n\010agvStatu\030\004 \001(\0132\024.NavMessag"
+    "e.AgvStatu2\302\001\n\nNavExcutor\0226\n\005Start\022\022.Nav"
+    "Message.NavCmd\032\027.NavMessage.NavResponse\""
+    "\000\0227\n\006Cancel\022\022.NavMessage.NavCmd\032\027.NavMes"
+    "sage.NavResponse\"\000\022C\n\017ManualOperation\022\025."
+    "NavMessage.ManualCmd\032\027.NavMessage.NavRes"
+    "ponse\"\000b\006proto3"
 };
 static ::absl::once_flag descriptor_table_message_2eproto_once;
 const ::_pbi::DescriptorTable descriptor_table_message_2eproto = {
     false,
     false,
-    1277,
+    1415,
     descriptor_table_protodef_message_2eproto,
     "message.proto",
     &descriptor_table_message_2eproto_once,
     nullptr,
     0,
-    11,
+    12,
     schemas,
     file_default_instances,
     TableStruct_message_2eproto::offsets,
@@ -3345,6 +3384,283 @@ void NavResponse::InternalSwap(NavResponse* other) {
 }
 // ===================================================================
 
+class ManualCmd::_Internal {
+ public:
+};
+
+ManualCmd::ManualCmd(::PROTOBUF_NAMESPACE_ID::Arena* arena)
+  : ::PROTOBUF_NAMESPACE_ID::Message(arena) {
+  SharedCtor(arena);
+  // @@protoc_insertion_point(arena_constructor:NavMessage.ManualCmd)
+}
+ManualCmd::ManualCmd(const ManualCmd& from)
+  : ::PROTOBUF_NAMESPACE_ID::Message() {
+  ManualCmd* const _this = this; (void)_this;
+  new (&_impl_) Impl_{
+      decltype(_impl_.key_) {}
+
+    , decltype(_impl_.operation_type_) {}
+
+    , decltype(_impl_.velocity_) {}
+
+    , /*decltype(_impl_._cached_size_)*/{}};
+
+  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+  _impl_.key_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+        _impl_.key_.Set("", GetArenaForAllocation());
+  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (!from._internal_key().empty()) {
+    _this->_impl_.key_.Set(from._internal_key(), _this->GetArenaForAllocation());
+  }
+  ::memcpy(&_impl_.operation_type_, &from._impl_.operation_type_,
+    static_cast<::size_t>(reinterpret_cast<char*>(&_impl_.velocity_) -
+    reinterpret_cast<char*>(&_impl_.operation_type_)) + sizeof(_impl_.velocity_));
+  // @@protoc_insertion_point(copy_constructor:NavMessage.ManualCmd)
+}
+
+inline void ManualCmd::SharedCtor(::_pb::Arena* arena) {
+  (void)arena;
+  new (&_impl_) Impl_{
+      decltype(_impl_.key_) {}
+
+    , decltype(_impl_.operation_type_) { 0 }
+
+    , decltype(_impl_.velocity_) { 0 }
+
+    , /*decltype(_impl_._cached_size_)*/{}
+  };
+  _impl_.key_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+        _impl_.key_.Set("", GetArenaForAllocation());
+  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+}
+
+ManualCmd::~ManualCmd() {
+  // @@protoc_insertion_point(destructor:NavMessage.ManualCmd)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
+  (void)arena;
+    return;
+  }
+  SharedDtor();
+}
+
+inline void ManualCmd::SharedDtor() {
+  ABSL_DCHECK(GetArenaForAllocation() == nullptr);
+  _impl_.key_.Destroy();
+}
+
+void ManualCmd::SetCachedSize(int size) const {
+  _impl_._cached_size_.Set(size);
+}
+
+void ManualCmd::Clear() {
+// @@protoc_insertion_point(message_clear_start:NavMessage.ManualCmd)
+  ::uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  _impl_.key_.ClearToEmpty();
+  ::memset(&_impl_.operation_type_, 0, static_cast<::size_t>(
+      reinterpret_cast<char*>(&_impl_.velocity_) -
+      reinterpret_cast<char*>(&_impl_.operation_type_)) + sizeof(_impl_.velocity_));
+  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
+}
+
+const char* ManualCmd::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
+#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
+  while (!ctx->Done(&ptr)) {
+    ::uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
+    switch (tag >> 3) {
+      // string key = 1;
+      case 1:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
+          auto str = _internal_mutable_key();
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
+          CHK_(ptr);
+          CHK_(::_pbi::VerifyUTF8(str, "NavMessage.ManualCmd.key"));
+        } else {
+          goto handle_unusual;
+        }
+        continue;
+      // int32 operation_type = 2;
+      case 2:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
+          _impl_.operation_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
+          CHK_(ptr);
+        } else {
+          goto handle_unusual;
+        }
+        continue;
+      // float velocity = 3;
+      case 3:
+        if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 29)) {
+          _impl_.velocity_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
+          ptr += sizeof(float);
+        } else {
+          goto handle_unusual;
+        }
+        continue;
+      default:
+        goto handle_unusual;
+    }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
+  }  // while
+message_done:
+  return ptr;
+failure:
+  ptr = nullptr;
+  goto message_done;
+#undef CHK_
+}
+
+::uint8_t* ManualCmd::_InternalSerialize(
+    ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+  // @@protoc_insertion_point(serialize_to_array_start:NavMessage.ManualCmd)
+  ::uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  // string key = 1;
+  if (!this->_internal_key().empty()) {
+    const std::string& _s = this->_internal_key();
+    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
+        _s.data(), static_cast<int>(_s.length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "NavMessage.ManualCmd.key");
+    target = stream->WriteStringMaybeAliased(1, _s, target);
+  }
+
+  // int32 operation_type = 2;
+  if (this->_internal_operation_type() != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(
+        2, this->_internal_operation_type(), target);
+  }
+
+  // float velocity = 3;
+  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
+  float tmp_velocity = this->_internal_velocity();
+  ::uint32_t raw_velocity;
+  memcpy(&raw_velocity, &tmp_velocity, sizeof(tmp_velocity));
+  if (raw_velocity != 0) {
+    target = stream->EnsureSpace(target);
+    target = ::_pbi::WireFormatLite::WriteFloatToArray(
+        3, this->_internal_velocity(), target);
+  }
+
+  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
+    target = ::_pbi::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:NavMessage.ManualCmd)
+  return target;
+}
+
+::size_t ManualCmd::ByteSizeLong() const {
+// @@protoc_insertion_point(message_byte_size_start:NavMessage.ManualCmd)
+  ::size_t total_size = 0;
+
+  ::uint32_t cached_has_bits = 0;
+  // Prevent compiler warnings about cached_has_bits being unused
+  (void) cached_has_bits;
+
+  // string key = 1;
+  if (!this->_internal_key().empty()) {
+    total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
+                                    this->_internal_key());
+  }
+
+  // int32 operation_type = 2;
+  if (this->_internal_operation_type() != 0) {
+    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
+        this->_internal_operation_type());
+  }
+
+  // float velocity = 3;
+  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
+  float tmp_velocity = this->_internal_velocity();
+  ::uint32_t raw_velocity;
+  memcpy(&raw_velocity, &tmp_velocity, sizeof(tmp_velocity));
+  if (raw_velocity != 0) {
+    total_size += 5;
+  }
+
+  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
+}
+
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ManualCmd::_class_data_ = {
+    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
+    ManualCmd::MergeImpl
+};
+const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ManualCmd::GetClassData() const { return &_class_data_; }
+
+
+void ManualCmd::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
+  auto* const _this = static_cast<ManualCmd*>(&to_msg);
+  auto& from = static_cast<const ManualCmd&>(from_msg);
+  // @@protoc_insertion_point(class_specific_merge_from_start:NavMessage.ManualCmd)
+  ABSL_DCHECK_NE(&from, _this);
+  ::uint32_t cached_has_bits = 0;
+  (void) cached_has_bits;
+
+  if (!from._internal_key().empty()) {
+    _this->_internal_set_key(from._internal_key());
+  }
+  if (from._internal_operation_type() != 0) {
+    _this->_internal_set_operation_type(from._internal_operation_type());
+  }
+  static_assert(sizeof(::uint32_t) == sizeof(float), "Code assumes ::uint32_t and float are the same size.");
+  float tmp_velocity = from._internal_velocity();
+  ::uint32_t raw_velocity;
+  memcpy(&raw_velocity, &tmp_velocity, sizeof(tmp_velocity));
+  if (raw_velocity != 0) {
+    _this->_internal_set_velocity(from._internal_velocity());
+  }
+  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
+}
+
+void ManualCmd::CopyFrom(const ManualCmd& from) {
+// @@protoc_insertion_point(class_specific_copy_from_start:NavMessage.ManualCmd)
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool ManualCmd::IsInitialized() const {
+  return true;
+}
+
+void ManualCmd::InternalSwap(ManualCmd* other) {
+  using std::swap;
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
+  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, lhs_arena,
+                                       &other->_impl_.key_, rhs_arena);
+  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
+      PROTOBUF_FIELD_OFFSET(ManualCmd, _impl_.velocity_)
+      + sizeof(ManualCmd::_impl_.velocity_)
+      - PROTOBUF_FIELD_OFFSET(ManualCmd, _impl_.operation_type_)>(
+          reinterpret_cast<char*>(&_impl_.operation_type_),
+          reinterpret_cast<char*>(&other->_impl_.operation_type_));
+}
+
+::PROTOBUF_NAMESPACE_ID::Metadata ManualCmd::GetMetadata() const {
+  return ::_pbi::AssignDescriptors(
+      &descriptor_table_message_2eproto_getter, &descriptor_table_message_2eproto_once,
+      file_level_metadata_message_2eproto[9]);
+}
+// ===================================================================
+
 class NavStatu::_Internal {
  public:
   using HasBits = decltype(std::declval<NavStatu>()._impl_._has_bits_);
@@ -3864,7 +4180,7 @@ void NavStatu::InternalSwap(NavStatu* other) {
 ::PROTOBUF_NAMESPACE_ID::Metadata NavStatu::GetMetadata() const {
   return ::_pbi::AssignDescriptors(
       &descriptor_table_message_2eproto_getter, &descriptor_table_message_2eproto_once,
-      file_level_metadata_message_2eproto[9]);
+      file_level_metadata_message_2eproto[10]);
 }
 // ===================================================================
 
@@ -4200,7 +4516,7 @@ void RobotStatu::InternalSwap(RobotStatu* other) {
 ::PROTOBUF_NAMESPACE_ID::Metadata RobotStatu::GetMetadata() const {
   return ::_pbi::AssignDescriptors(
       &descriptor_table_message_2eproto_getter, &descriptor_table_message_2eproto_once,
-      file_level_metadata_message_2eproto[10]);
+      file_level_metadata_message_2eproto[11]);
 }
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace NavMessage
@@ -4241,6 +4557,10 @@ template<> PROTOBUF_NOINLINE ::NavMessage::NavResponse*
 Arena::CreateMaybeMessage< ::NavMessage::NavResponse >(Arena* arena) {
   return Arena::CreateMessageInternal< ::NavMessage::NavResponse >(arena);
 }
+template<> PROTOBUF_NOINLINE ::NavMessage::ManualCmd*
+Arena::CreateMaybeMessage< ::NavMessage::ManualCmd >(Arena* arena) {
+  return Arena::CreateMessageInternal< ::NavMessage::ManualCmd >(arena);
+}
 template<> PROTOBUF_NOINLINE ::NavMessage::NavStatu*
 Arena::CreateMaybeMessage< ::NavMessage::NavStatu >(Arena* arena) {
   return Arena::CreateMessageInternal< ::NavMessage::NavStatu >(arena);

+ 287 - 2
MPC/monitor/emqx/message.pb.h

@@ -57,6 +57,9 @@ extern AgvStatuDefaultTypeInternal _AgvStatu_default_instance_;
 class LidarOdomStatu;
 struct LidarOdomStatuDefaultTypeInternal;
 extern LidarOdomStatuDefaultTypeInternal _LidarOdomStatu_default_instance_;
+class ManualCmd;
+struct ManualCmdDefaultTypeInternal;
+extern ManualCmdDefaultTypeInternal _ManualCmd_default_instance_;
 class NavCmd;
 struct NavCmdDefaultTypeInternal;
 extern NavCmdDefaultTypeInternal _NavCmd_default_instance_;
@@ -91,6 +94,8 @@ template <>
 template <>
 ::NavMessage::LidarOdomStatu* Arena::CreateMaybeMessage<::NavMessage::LidarOdomStatu>(Arena*);
 template <>
+::NavMessage::ManualCmd* Arena::CreateMaybeMessage<::NavMessage::ManualCmd>(Arena*);
+template <>
 ::NavMessage::NavCmd* Arena::CreateMaybeMessage<::NavMessage::NavCmd>(Arena*);
 template <>
 ::NavMessage::NavResponse* Arena::CreateMaybeMessage<::NavMessage::NavResponse>(Arena*);
@@ -1933,6 +1938,195 @@ class NavResponse final :
   friend struct ::TableStruct_message_2eproto;
 };// -------------------------------------------------------------------
 
+class ManualCmd final :
+    public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:NavMessage.ManualCmd) */ {
+ public:
+  inline ManualCmd() : ManualCmd(nullptr) {}
+  ~ManualCmd() override;
+  template<typename = void>
+  explicit PROTOBUF_CONSTEXPR ManualCmd(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
+
+  ManualCmd(const ManualCmd& from);
+  ManualCmd(ManualCmd&& from) noexcept
+    : ManualCmd() {
+    *this = ::std::move(from);
+  }
+
+  inline ManualCmd& operator=(const ManualCmd& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  inline ManualCmd& operator=(ManualCmd&& from) noexcept {
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      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 default_instance().GetMetadata().descriptor;
+  }
+  static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
+    return default_instance().GetMetadata().reflection;
+  }
+  static const ManualCmd& default_instance() {
+    return *internal_default_instance();
+  }
+  static inline const ManualCmd* internal_default_instance() {
+    return reinterpret_cast<const ManualCmd*>(
+               &_ManualCmd_default_instance_);
+  }
+  static constexpr int kIndexInFileMessages =
+    9;
+
+  friend void swap(ManualCmd& a, ManualCmd& b) {
+    a.Swap(&b);
+  }
+  inline void Swap(ManualCmd* other) {
+    if (other == this) return;
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
+      InternalSwap(other);
+    } else {
+      ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
+    }
+  }
+  void UnsafeArenaSwap(ManualCmd* other) {
+    if (other == this) return;
+    ABSL_DCHECK(GetOwningArena() == other->GetOwningArena());
+    InternalSwap(other);
+  }
+
+  // implements Message ----------------------------------------------
+
+  ManualCmd* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
+    return CreateMaybeMessage<ManualCmd>(arena);
+  }
+  using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
+  void CopyFrom(const ManualCmd& from);
+  using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
+  void MergeFrom( const ManualCmd& from) {
+    ManualCmd::MergeImpl(*this, from);
+  }
+  private:
+  static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
+  public:
+  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;
+  ::uint8_t* _InternalSerialize(
+      ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
+  int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
+
+  private:
+  void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  void SharedDtor();
+  void SetCachedSize(int size) const final;
+  void InternalSwap(ManualCmd* other);
+
+  private:
+  friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
+  static ::absl::string_view FullMessageName() {
+    return "NavMessage.ManualCmd";
+  }
+  protected:
+  explicit ManualCmd(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  public:
+
+  static const ClassData _class_data_;
+  const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
+
+  ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  enum : int {
+    kKeyFieldNumber = 1,
+    kOperationTypeFieldNumber = 2,
+    kVelocityFieldNumber = 3,
+  };
+  // string key = 1;
+  void clear_key() ;
+  const std::string& key() const;
+
+
+
+
+  template <typename Arg_ = const std::string&, typename... Args_>
+  void set_key(Arg_&& arg, Args_... args);
+  std::string* mutable_key();
+  PROTOBUF_NODISCARD std::string* release_key();
+  void set_allocated_key(std::string* ptr);
+
+  private:
+  const std::string& _internal_key() const;
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_key(
+      const std::string& value);
+  std::string* _internal_mutable_key();
+
+  public:
+  // int32 operation_type = 2;
+  void clear_operation_type() ;
+  ::int32_t operation_type() const;
+  void set_operation_type(::int32_t value);
+
+  private:
+  ::int32_t _internal_operation_type() const;
+  void _internal_set_operation_type(::int32_t value);
+
+  public:
+  // float velocity = 3;
+  void clear_velocity() ;
+  float velocity() const;
+  void set_velocity(float value);
+
+  private:
+  float _internal_velocity() const;
+  void _internal_set_velocity(float value);
+
+  public:
+  // @@protoc_insertion_point(class_scope:NavMessage.ManualCmd)
+ private:
+  class _Internal;
+
+  template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
+  typedef void InternalArenaConstructable_;
+  typedef void DestructorSkippable_;
+  struct Impl_ {
+    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_;
+    ::int32_t operation_type_;
+    float velocity_;
+    mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
+  };
+  union { Impl_ _impl_; };
+  friend struct ::TableStruct_message_2eproto;
+};// -------------------------------------------------------------------
+
 class NavStatu final :
     public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:NavMessage.NavStatu) */ {
  public:
@@ -1989,7 +2183,7 @@ class NavStatu final :
                &_NavStatu_default_instance_);
   }
   static constexpr int kIndexInFileMessages =
-    9;
+    10;
 
   friend void swap(NavStatu& a, NavStatu& b) {
     a.Swap(&b);
@@ -2273,7 +2467,7 @@ class RobotStatu final :
                &_RobotStatu_default_instance_);
   }
   static constexpr int kIndexInFileMessages =
-    10;
+    11;
 
   friend void swap(RobotStatu& a, RobotStatu& b) {
     a.Swap(&b);
@@ -3589,6 +3783,97 @@ inline void NavResponse::set_allocated_info(std::string* value) {
 
 // -------------------------------------------------------------------
 
+// ManualCmd
+
+// string key = 1;
+inline void ManualCmd::clear_key() {
+  _impl_.key_.ClearToEmpty();
+}
+inline const std::string& ManualCmd::key() const {
+  // @@protoc_insertion_point(field_get:NavMessage.ManualCmd.key)
+  return _internal_key();
+}
+template <typename Arg_, typename... Args_>
+inline PROTOBUF_ALWAYS_INLINE void ManualCmd::set_key(Arg_&& arg,
+                                                     Args_... args) {
+  ;
+  _impl_.key_.Set(static_cast<Arg_&&>(arg), args..., GetArenaForAllocation());
+  // @@protoc_insertion_point(field_set:NavMessage.ManualCmd.key)
+}
+inline std::string* ManualCmd::mutable_key() {
+  std::string* _s = _internal_mutable_key();
+  // @@protoc_insertion_point(field_mutable:NavMessage.ManualCmd.key)
+  return _s;
+}
+inline const std::string& ManualCmd::_internal_key() const {
+  return _impl_.key_.Get();
+}
+inline void ManualCmd::_internal_set_key(const std::string& value) {
+  ;
+
+
+  _impl_.key_.Set(value, GetArenaForAllocation());
+}
+inline std::string* ManualCmd::_internal_mutable_key() {
+  ;
+  return _impl_.key_.Mutable( GetArenaForAllocation());
+}
+inline std::string* ManualCmd::release_key() {
+  // @@protoc_insertion_point(field_release:NavMessage.ManualCmd.key)
+  return _impl_.key_.Release();
+}
+inline void ManualCmd::set_allocated_key(std::string* value) {
+  _impl_.key_.SetAllocated(value, GetArenaForAllocation());
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+        if (_impl_.key_.IsDefault()) {
+          _impl_.key_.Set("", GetArenaForAllocation());
+        }
+  #endif  // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  // @@protoc_insertion_point(field_set_allocated:NavMessage.ManualCmd.key)
+}
+
+// int32 operation_type = 2;
+inline void ManualCmd::clear_operation_type() {
+  _impl_.operation_type_ = 0;
+}
+inline ::int32_t ManualCmd::operation_type() const {
+  // @@protoc_insertion_point(field_get:NavMessage.ManualCmd.operation_type)
+  return _internal_operation_type();
+}
+inline void ManualCmd::set_operation_type(::int32_t value) {
+  _internal_set_operation_type(value);
+  // @@protoc_insertion_point(field_set:NavMessage.ManualCmd.operation_type)
+}
+inline ::int32_t ManualCmd::_internal_operation_type() const {
+  return _impl_.operation_type_;
+}
+inline void ManualCmd::_internal_set_operation_type(::int32_t value) {
+  ;
+  _impl_.operation_type_ = value;
+}
+
+// float velocity = 3;
+inline void ManualCmd::clear_velocity() {
+  _impl_.velocity_ = 0;
+}
+inline float ManualCmd::velocity() const {
+  // @@protoc_insertion_point(field_get:NavMessage.ManualCmd.velocity)
+  return _internal_velocity();
+}
+inline void ManualCmd::set_velocity(float value) {
+  _internal_set_velocity(value);
+  // @@protoc_insertion_point(field_set:NavMessage.ManualCmd.velocity)
+}
+inline float ManualCmd::_internal_velocity() const {
+  return _impl_.velocity_;
+}
+inline void ManualCmd::_internal_set_velocity(float value) {
+  ;
+  _impl_.velocity_ = value;
+}
+
+// -------------------------------------------------------------------
+
 // NavStatu
 
 // int32 statu = 1;

+ 0 - 2
MPC/monitor/monitor_emqx.h

@@ -23,8 +23,6 @@ public:
         eVertical=3,
         eClampClode=5,
         eClampOpen=6
-
-
     };
  public:
     Monitor_emqx(std::string nodeId);

+ 53 - 9
MPC/navigation.cpp

@@ -439,18 +439,18 @@ Navigation::MpcResult Navigation::RotateReferToTarget(NavMessage::PathNode node,
         // 自由方向
         if (directions) {
             std::vector<double> yaw_diffs;
-            if (directions & MpcRotateDirection::eForward) {
+            if (directions & Direction::eForward) {
                 yaw_diffs.push_back(target_yaw_diff);
             }
-            if (directions & MpcRotateDirection::eBackward) {
+            if (directions & Direction::eBackward) {
                 Pose2d relative_pose = Pose2d::relativePose(targetInPose, Pose2d(0, 0, M_PI));
                 yaw_diffs.push_back(Pose2d::vector2yaw(relative_pose.x(), relative_pose.y()));
             }
-            if (directions & MpcRotateDirection::eLeft) {
+            if (directions & Direction::eLeft) {
                 Pose2d relative_pose = Pose2d::relativePose(targetInPose, Pose2d(0, 0, 1.0 / 2 * M_PI));
                 yaw_diffs.push_back(Pose2d::vector2yaw(relative_pose.x(), relative_pose.y()));
             }
-            if (directions & MpcRotateDirection::eRight) {
+            if (directions & Direction::eRight) {
                 Pose2d relative_pose = Pose2d::relativePose(targetInPose, Pose2d(0, 0, 3.0 / 2 * M_PI));
                 yaw_diffs.push_back(Pose2d::vector2yaw(relative_pose.x(), relative_pose.y()));
             }
@@ -521,10 +521,10 @@ bool Navigation::MoveToTarget(NavMessage::PathNode node, Navigation::stLimit lim
             }
             Pose2d target(node.x(), node.y(), 0);
 //        if (RotateReferToTarget(target, limit_w, anyDirect) == false) {
-            int directions = MpcRotateDirection::eForward;
+            int directions = Direction::eForward;
             if (anyDirect)
-                directions = MpcRotateDirection::eForward | MpcRotateDirection::eBackward |
-                             MpcRotateDirection::eLeft | MpcRotateDirection::eRight;
+                directions = Direction::eForward | Direction::eBackward |
+                             Direction::eLeft | Direction::eRight;
             if (RotateReferToTarget(node, limit_w, directions) != eMpcSuccess) {
                 std::cout << " Rotate refer to target failed,target: " << target <<
                           " directions: " << std::hex << directions << " line_: " << __LINE__ << std::endl;
@@ -1089,7 +1089,7 @@ bool Navigation::PossibleToTarget(NavMessage::PathNode targetNode, bool directY)
                    minR,ax,ay);*/
             return true;
         } else if (nagY && posiY) {
-            std::cout<<"nagY && posiY"<<std::endl;
+            std::cout << "nagY && posiY" << std::endl;
             return true;
         }
         printf("directY:%d targetInPose:%f %f l:%f,w:%f theta:%f  minR:%f ax:%f,ay:%f\n", directY,
@@ -1205,4 +1205,48 @@ float Navigation::compute_cuv(const Pose2d &target) {
     float cuv = atan(y / (x + 1e-8));
     //printf(" ---------------------- cuv:%f\n",cuv);
     return cuv;
-}
+}
+
+void Navigation::ManualOperation(const NavMessage::ManualCmd &cmd, NavMessage::NavResponse &response) {
+    pause_ = false;
+    cancel_ = false;
+    running_ = true;
+    actionType_ = eReady;
+    printf("ManualOperation: %d | start...\n", cmd.operation_type());
+
+    float symbol = cmd.velocity() < 0 ? -1 : 1; // 判断为正方向or负方向
+    double velocity;
+    std::this_thread::sleep_for(std::chrono::milliseconds(100));
+    switch (cmd.operation_type()) {
+        case 1: // 旋转
+            velocity = 2.0 * M_PI / 180.0 * symbol;
+            SendMoveCmd(move_mode_, Monitor_emqx::eRotate, 0, velocity);
+            actionType_ = eRotation;
+            printf(" ManualOperation: %d | input angular_v: %f, down: %f\n",
+                   cmd.operation_type(), timedA_.Get(), velocity);
+            break;
+        case 2: // X平移
+            velocity = 1.0 * symbol;
+            SendMoveCmd(move_mode_, Monitor_emqx::eVertical, velocity, 0);
+            actionType_ = eVertical;
+            printf(" ManualOperation: %d | input line_v   : %f, down: %f\n",
+                   cmd.operation_type(), timedV_.Get(), velocity);
+            break;
+        case 3: // Y平移
+            velocity = 1.0 * symbol;
+            SendMoveCmd(move_mode_, Monitor_emqx::eHorizontal, velocity, 0);
+            actionType_ = eHorizon;
+            printf(" ManualOperation: %d | input line_v: %f, down: %f\n",
+                   cmd.operation_type(), timedV_.Get(), velocity);
+            break;
+        default:
+            break;
+    }
+
+    actionType_ = eReady;
+    response.set_ret(-3);
+    response.set_info("ManualOperation: %d, canceled!!!", cmd.operation_type());
+    printf("ManualOperation: %d | canceled!!!\n", cmd.operation_type());
+    running_ = false;
+}
+

+ 3 - 0
MPC/navigation.h

@@ -77,6 +77,9 @@ public:
 
     virtual void Start(const NavMessage::NavCmd &cmd, NavMessage::NavResponse &response);
 
+    /* 手动旋转 */
+    virtual void ManualOperation(const NavMessage::ManualCmd &cmd, NavMessage::NavResponse &response);
+
     void Cancel(const NavMessage::NavCmd &cmd, NavMessage::NavResponse &response);
 
     bool Stop();

+ 66 - 59
message.proto

@@ -1,102 +1,109 @@
 syntax = "proto3";
+
 package NavMessage;
+
 message LidarOdomStatu {
-  float x=1;
-  float y=2;
-  float theta=3;
-  float v=4;
-  float vth=5;
+    float x = 1;
+    float y = 2;
+    float theta = 3;
+    float v = 4;
+    float vth = 5;
 }
 
-message AgvStatu{
-  float v=1;
-  float w=2;
-  int32 clamp=3;    //夹持状态  0,中间状态,1夹紧到位,2,打开到位,
-  int32 clamp_other=4; //另外一节
+message AgvStatu {
+    float v = 1;
+    float w = 2;
+    int32 clamp = 3;    //夹持状态  0,中间状态,1夹紧到位,2,打开到位,
+    int32 clamp_other = 4; //另外一节
 
 }
 
 message ToAgvCmd {
-  int32 H=1;  //心跳
-  int32 M=2;	//模式:2整车模式,1:单车
-  int32 T=3; // 1:原地旋转,2:横移,3:MPC巡线/前进, 5,夹持,6,松夹持,其他/未接收到:停止
-  float V=4;  //角速度
-  float W=5;  //线速度
-  float L=6;  //轴距
-  int32 end=7;
+    int32 H = 1;  //心跳
+    int32 M = 2;    //模式:2整车模式,1:单车
+    int32 T = 3; // 1:原地旋转,2:横移,3:MPC巡线/前进, 5,夹持,6,松夹持,其他/未接收到:停止
+    float V = 4;  //角速度
+    float W = 5;  //线速度
+    float L = 6;  //轴距
+    int32 end = 7;
 }
 
 message Pose2d
 {
-  float x=1;
-  float y=2;
-  float theta=3;
+    float x = 1;
+    float y = 2;
+    float theta = 3;
 }
 
-message PathNode  //导航路径点及精度
+message PathNode //导航路径点及精度
 {
-  float x=1;    //目标点坐标
-  float y=2;
-  float l=3;    //目标点旋转矩形方程,代表精度范围
-  float w=4;
-  float theta=5;
-  string id=6;
+    float x = 1;    //目标点坐标
+    float y = 2;
+    float l = 3;    //目标点旋转矩形方程,代表精度范围
+    float w = 4;
+    float theta = 5;
+    string id = 6;
 }
 
 message Trajectory
 {
-  repeated Pose2d poses=1;
+    repeated Pose2d poses = 1;
 }
 
 //----------------------------
 message NewAction //进库,出库,轨迹导航,夹持,松夹持
 {
-  int32 type =1; //1,进库,2,出库,3,自动选择动作导航,4,保证agv朝前导航,5,汽车模型导航,6:夹持,7:松夹持,8:切换模式
-  PathNode spaceNode = 2; //进出库起点
-  PathNode passNode=3; //进出库途径点
-  PathNode streetNode = 4; //进出库终点
-  repeated PathNode pathNodes=5;//导航路径点
+    int32 type = 1; //1,进库,2,出库,3,自动选择动作导航,4,保证agv朝前导航,5,汽车模型导航,6:夹持,7:松夹持,8:切换模式
+    PathNode spaceNode = 2; //进出库起点
+    PathNode passNode = 3; //进出库途径点
+    PathNode streetNode = 4; //进出库终点
+    repeated PathNode pathNodes = 5;//导航路径点
 
-  float wheelbase=6;		//切换模式,轴距信息
-  int32 changedMode=7; //1:切换单车模式,2:切换双车模式
+    float wheelbase = 6;        //切换模式,轴距信息
+    int32 changedMode = 7; //1:切换单车模式,2:切换双车模式
 }
 //-----------------------------
 
 message NavCmd
 {
-  int32 action=1;  //  0 开始任务,1 pause, 2 continue ,3 cancel,4:切换到双车模式,5:切换到单车模式,
-  string key=2;
-  repeated NewAction newActions=5;
+    int32 action = 1;  //  0 开始任务,1 pause, 2 continue ,3 cancel,4:切换到双车模式,5:切换到单车模式,
+    string key = 2;
+    repeated NewAction newActions = 5;
+}
+
+message NavResponse {
+    int32 ret = 1;
+    string info = 2;
 }
 
-message NavResponse{
-  int32 ret=1;
-  string info=2;
+message ManualCmd {
+    string key = 1;
+    int32 operation_type = 2; // 1:旋转, 2:前后平移(X方向), 3:左右平移(Y方向):
+    float velocity = 3; // 正数为正方向,负数为负方向
 }
 
-service NavExcutor{
-  rpc Start(NavCmd) returns(NavResponse){}
-  rpc Cancel(NavCmd) returns(NavResponse){}
+service NavExcutor {
+    rpc Start (NavCmd) returns (NavResponse) {}
+    rpc Cancel (NavCmd) returns (NavResponse) {}
+    rpc ManualOperation (ManualCmd) returns (NavResponse) {}
 }
 
 message NavStatu
 {
-  int32 statu = 1; //0:ready  1:原地旋转,2:Horizon,3:vrtical,4:MPC,5:夹持开,6:夹持关
-  bool main_agv=2; //是否是两节控制plc
-  int32 move_mode=3; //运动模式,1:single,2:双车
-  LidarOdomStatu odom=4;
-  string key = 5; // 任务唯一码
-  Trajectory selected_traj = 6;
-  Trajectory predict_traj = 7;
-  bool in_space=8;  //是否在车位/正在进入车位
-  string space_id=9;
+    int32 statu = 1; //0:ready  1:原地旋转,2:Horizon,3:vrtical,4:MPC,5:夹持开,6:夹持关
+    bool main_agv = 2; //是否是两节控制plc
+    int32 move_mode = 3; //运动模式,1:single,2:双车
+    LidarOdomStatu odom = 4;
+    string key = 5; // 任务唯一码
+    Trajectory selected_traj = 6;
+    Trajectory predict_traj = 7;
+    bool in_space = 8;  //是否在车位/正在进入车位
+    string space_id = 9;
 }
 message RobotStatu
 {
-  float x=1;
-  float y=2;
-  float theta=3;
-  AgvStatu agvStatu=4;
+    float x = 1;
+    float y = 2;
+    float theta = 3;
+    AgvStatu agvStatu = 4;
 }
-
-

+ 23 - 14
nav_server.cpp

@@ -5,21 +5,30 @@
 #include "nav_server.h"
 
 
-::grpc::Status NavServer::Start(::grpc::ServerContext* context,
-                             const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response){
-  std::cout << "server received StartCmd: " << request->key() << std::endl;
-  if(navigator_!= nullptr){
-    navigator_->Start(*request,*response);
-  }
-  return ::grpc::Status::OK;
+::grpc::Status NavServer::Start(::grpc::ServerContext *context,
+                                const ::NavMessage::NavCmd *request, ::NavMessage::NavResponse *response) {
+    std::cout << "server received StartCmd: " << request->key() << std::endl;
+    if (navigator_ != nullptr) {
+        navigator_->Start(*request, *response);
+    }
+    return ::grpc::Status::OK;
 }
-::grpc::Status NavServer::Cancel(::grpc::ServerContext* context,
-                              const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response){
-  std::cout << "server received Cancel Cmd: " << request->key() << std::endl;
-  if(navigator_!= nullptr){
-    navigator_->Cancel(*request,*response);
-  }
-  return ::grpc::Status::OK;
+
+::grpc::Status NavServer::Cancel(::grpc::ServerContext *context,
+                                 const ::NavMessage::NavCmd *request, ::NavMessage::NavResponse *response) {
+    std::cout << "server received Cancel Cmd: " << request->key() << std::endl;
+    if (navigator_ != nullptr) {
+        navigator_->Cancel(*request, *response);
+    }
+    return ::grpc::Status::OK;
 }
 
+::grpc::Status NavServer::ManualOperation(::grpc::ServerContext *context,
+                                          const ::NavMessage::ManualCmd *request, ::NavMessage::NavResponse *response) {
+    std::cout << "server received ManualOperation Cmd: " << request->key() << std::endl;
+    if (navigator_ != nullptr) {
+        navigator_->ManualOperation(*request, *response);
+    }
+    return ::grpc::Status::OK;
+}
 

+ 17 - 9
nav_server.h

@@ -4,21 +4,29 @@
 
 #ifndef NAVIGATION_NAV_SERVER_H
 #define NAVIGATION_NAV_SERVER_H
+
 #include "MPC/navigation_main.h"
-class NavServer :public NavMessage::NavExcutor::Service{
+
+class NavServer : public NavMessage::NavExcutor::Service {
 public:
-    NavServer(Navigation* navigator){
-      navigator_=navigator;
+    NavServer(Navigation *navigator) {
+        navigator_ = navigator;
     }
-    virtual ~NavServer(){}
+
+    virtual ~NavServer() {}
+
 private:
-    virtual ::grpc::Status Start(::grpc::ServerContext* context,
-                                 const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response);
-    virtual ::grpc::Status Cancel(::grpc::ServerContext* context,
-                                  const ::NavMessage::NavCmd* request, ::NavMessage::NavResponse* response);
+    virtual ::grpc::Status Start(::grpc::ServerContext *context,
+                                 const ::NavMessage::NavCmd *request, ::NavMessage::NavResponse *response);
+
+    virtual ::grpc::Status Cancel(::grpc::ServerContext *context,
+                                  const ::NavMessage::NavCmd *request, ::NavMessage::NavResponse *response);
+
+    virtual ::grpc::Status ManualOperation(::grpc::ServerContext *context,
+                                           const ::NavMessage::ManualCmd *request, ::NavMessage::NavResponse *response);
 
 protected:
-    Navigation* navigator_= nullptr;
+    Navigation *navigator_ = nullptr;
 
 
 };