diff --git a/src/slam_wrapper.cpp b/src/slam_wrapper.cpp index a99fb45..5f6a3e6 100644 --- a/src/slam_wrapper.cpp +++ b/src/slam_wrapper.cpp @@ -79,7 +79,7 @@ str_ = seq->data().substr(begin_ + 7, end_ - begin_ - 7); const int arrive_ = atoi(str_.c_str()); std::cout << "I arrived node " << arrive_ << ". " << notice_ << std::endl; - if (arrive_ == 1) { + if (arrive_ == 2) { //发送暂停指令 pause_navigation(); @@ -284,11 +284,13 @@ } void SlamWrapper::pause_navigation() { + std::cout << "Pause navigation start" << std::endl; index++; QtCommand_ send_msg; send_msg.seq_().data() = "index:" + std::to_string(index) + ";"; send_msg.command_() = 13; // 13 is the pause navigation command pubQtCommand->Write(send_msg); + std::cout << "Pause navigation end" << std::endl; } void SlamWrapper::recover_navigation() { diff --git a/src/slam_wrapper.cpp b/src/slam_wrapper.cpp index a99fb45..5f6a3e6 100644 --- a/src/slam_wrapper.cpp +++ b/src/slam_wrapper.cpp @@ -79,7 +79,7 @@ str_ = seq->data().substr(begin_ + 7, end_ - begin_ - 7); const int arrive_ = atoi(str_.c_str()); std::cout << "I arrived node " << arrive_ << ". " << notice_ << std::endl; - if (arrive_ == 1) { + if (arrive_ == 2) { //发送暂停指令 pause_navigation(); @@ -284,11 +284,13 @@ } void SlamWrapper::pause_navigation() { + std::cout << "Pause navigation start" << std::endl; index++; QtCommand_ send_msg; send_msg.seq_().data() = "index:" + std::to_string(index) + ";"; send_msg.command_() = 13; // 13 is the pause navigation command pubQtCommand->Write(send_msg); + std::cout << "Pause navigation end" << std::endl; } void SlamWrapper::recover_navigation() { diff --git a/src/tcp_client.cpp b/src/tcp_client.cpp index 15786d8..40a2be3 100644 --- a/src/tcp_client.cpp +++ b/src/tcp_client.cpp @@ -50,7 +50,6 @@ _slam->init_pose(); _slam->default_navigation(); } else if (received_string == "s") { - std::cout << "Pause navigation" << std::endl; _slam->pause_navigation(); } else if (received_string == "d") { std::cout << "Recover navigation" << std::endl;