From 8e093ce062ac643eaba61f5c005b599e8b3cdd85 Mon Sep 17 00:00:00 2001 From: mbsaloka Date: Wed, 12 Jun 2024 00:41:33 +0700 Subject: [PATCH 1/3] feat: add load config service --- CMakeLists.txt | 1 + .../config/grpc/call_data_load_config.hpp | 48 +++++++++++++++ .../config/grpc/call_data_load_config.cpp | 59 +++++++++++++++++++ src/ninshiki_cpp/config/grpc/config.cpp | 2 + 4 files changed, 110 insertions(+) create mode 100644 include/ninshiki_cpp/config/grpc/call_data_load_config.hpp create mode 100644 src/ninshiki_cpp/config/grpc/call_data_load_config.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ce0adc..7dce9f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ message(STATUS "Using gRPC ${gRPC_VERSION}") add_library(${PROJECT_NAME} SHARED "src/${PROJECT_NAME}/config/grpc/config.cpp" "src/${PROJECT_NAME}/config/grpc/call_data_get_color_setting.cpp" + "src/${PROJECT_NAME}/config/grpc/call_data_load_config.cpp" "src/${PROJECT_NAME}/config/grpc/call_data_save_color_setting.cpp" "src/${PROJECT_NAME}/config/grpc/call_data_set_color_setting.cpp" "src/${PROJECT_NAME}/config/utils/config.cpp" diff --git a/include/ninshiki_cpp/config/grpc/call_data_load_config.hpp b/include/ninshiki_cpp/config/grpc/call_data_load_config.hpp new file mode 100644 index 0000000..a5d4433 --- /dev/null +++ b/include/ninshiki_cpp/config/grpc/call_data_load_config.hpp @@ -0,0 +1,48 @@ +// Copyright (c) 2024 Ichiro ITS +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#ifndef NINSHIKI_CPP_CONFIG__GRPC__CALL_DATA_LOAD_CONFIG_HPP__ +#define NINSHIKI_CPP_CONFIG__GRPC__CALL_DATA_LOAD_CONFIG_HPP__ + +#include +#include +#include +#include + +namespace ninshiki_cpp +{ +class CallDataLoadConfig +: CallData +{ +public: + CallDataLoadConfig( + ninshiki_interfaces::proto::Config::AsyncService * service, grpc::ServerCompletionQueue * cq, + const std::string & path, std::shared_ptr color_detection); + using ColorDetector = ninshiki_cpp::detector::ColorDetector; + +protected: + void AddNextToCompletionQueue() override; + void WaitForRequest() override; + void HandleRequest() override; + std::shared_ptr color_detection_; +}; +} // namespace ninshiki_cpp + +#endif // NINSHIKI_CPP__CONFIG__GRPC__CALL_DATA_LOAD_CONFIG_HPP__ diff --git a/src/ninshiki_cpp/config/grpc/call_data_load_config.cpp b/src/ninshiki_cpp/config/grpc/call_data_load_config.cpp new file mode 100644 index 0000000..3844123 --- /dev/null +++ b/src/ninshiki_cpp/config/grpc/call_data_load_config.cpp @@ -0,0 +1,59 @@ +// Copyright (c) 2024 Ichiro ITS +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include +#include +#include +#include +#include + +namespace ninshiki_cpp +{ +CallDataLoadConfig::CallDataLoadConfig( + ninshiki_interfaces::proto::Config::AsyncService * service, grpc::ServerCompletionQueue * cq, + const std::string & path, std::shared_ptr color_detection) +: CallData(service, cq, path), color_detection_(color_detection) +{ + Proceed(); +} + +void CallDataLoadConfig::AddNextToCompletionQueue() +{ + new CallDataLoadConfig(service_, cq_, path_, color_detection_); +} + +void CallDataLoadConfig::WaitForRequest() +{ + service_->RequestLoadConfig(&ctx_, &request_, &responder_, cq_, cq_, this); +} + +void CallDataLoadConfig::HandleRequest() +{ + try { + color_detection_->load_configuration(path_); + + RCLCPP_INFO( + rclcpp::get_logger("Load config"), "config has been loaded!" + ); + } catch (nlohmann::json::exception e) { + RCLCPP_ERROR(rclcpp::get_logger("Load config"), e.what()); + } +} +} // namespace ninshiki_cpp diff --git a/src/ninshiki_cpp/config/grpc/config.cpp b/src/ninshiki_cpp/config/grpc/config.cpp index 31805a6..7b35515 100644 --- a/src/ninshiki_cpp/config/grpc/config.cpp +++ b/src/ninshiki_cpp/config/grpc/config.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ void ConfigGrpc::Run(const std::string & path, std::shared_ptr Date: Sat, 15 Jun 2024 22:10:06 +0700 Subject: [PATCH 2/3] fix: use "" for include --- .../config/grpc/call_data_get_color_setting.hpp | 2 +- .../config/grpc/call_data_load_config.hpp | 8 ++++---- .../config/grpc/call_data_save_color_setting.hpp | 4 ++-- .../config/grpc/call_data_set_color_setting.hpp | 8 ++++---- include/ninshiki_cpp/config/grpc/config.hpp | 8 ++++---- .../config/grpc/call_data_get_color_setting.cpp | 10 +++++----- .../config/grpc/call_data_load_config.cpp | 10 +++++----- .../config/grpc/call_data_save_color_setting.cpp | 12 ++++++------ .../config/grpc/call_data_set_color_setting.cpp | 10 +++++----- src/ninshiki_cpp/config/grpc/config.cpp | 16 ++++++++-------- src/ninshiki_cpp/config/utils/config.cpp | 4 ++-- src/ninshiki_cpp_detector.cpp | 4 ++-- 12 files changed, 48 insertions(+), 48 deletions(-) diff --git a/include/ninshiki_cpp/config/grpc/call_data_get_color_setting.hpp b/include/ninshiki_cpp/config/grpc/call_data_get_color_setting.hpp index ff46e38..a64ad62 100644 --- a/include/ninshiki_cpp/config/grpc/call_data_get_color_setting.hpp +++ b/include/ninshiki_cpp/config/grpc/call_data_get_color_setting.hpp @@ -21,7 +21,7 @@ #ifndef NINSHIKI_CPP__CONFIG__GRPC__CALL_DATA_GET_COLOR_SETTING_HPP__ #define NINSHIKI_CPP__CONFIG__GRPC__CALL_DATA_GET_COLOR_SETTING_HPP__ -#include +#include "ninshiki_cpp/config/grpc/call_data.hpp" namespace ninshiki_cpp { diff --git a/include/ninshiki_cpp/config/grpc/call_data_load_config.hpp b/include/ninshiki_cpp/config/grpc/call_data_load_config.hpp index a5d4433..951158c 100644 --- a/include/ninshiki_cpp/config/grpc/call_data_load_config.hpp +++ b/include/ninshiki_cpp/config/grpc/call_data_load_config.hpp @@ -21,10 +21,10 @@ #ifndef NINSHIKI_CPP_CONFIG__GRPC__CALL_DATA_LOAD_CONFIG_HPP__ #define NINSHIKI_CPP_CONFIG__GRPC__CALL_DATA_LOAD_CONFIG_HPP__ -#include -#include -#include -#include +#include "rclcpp/rclcpp.hpp" +#include "ninshiki_cpp/config/grpc/call_data.hpp" +#include "ninshiki_cpp/detector/color_detector.hpp" +#include "ninshiki_cpp/utils/color.hpp" namespace ninshiki_cpp { diff --git a/include/ninshiki_cpp/config/grpc/call_data_save_color_setting.hpp b/include/ninshiki_cpp/config/grpc/call_data_save_color_setting.hpp index 966a66e..acf18b6 100644 --- a/include/ninshiki_cpp/config/grpc/call_data_save_color_setting.hpp +++ b/include/ninshiki_cpp/config/grpc/call_data_save_color_setting.hpp @@ -21,8 +21,8 @@ #ifndef NINSHIKI_CPP__CONFIG__GRPC__CALL_DATA_SAVE_COLOR_SETTING_HPP__ #define NINSHIKI_CPP__CONFIG__GRPC__CALL_DATA_SAVE_COLOR_SETTING_HPP__ -#include -#include +#include "ninshiki_cpp/config/grpc/call_data.hpp" +#include "rclcpp/rclcpp.hpp" namespace ninshiki_cpp { diff --git a/include/ninshiki_cpp/config/grpc/call_data_set_color_setting.hpp b/include/ninshiki_cpp/config/grpc/call_data_set_color_setting.hpp index f7bf63c..5e3c220 100644 --- a/include/ninshiki_cpp/config/grpc/call_data_set_color_setting.hpp +++ b/include/ninshiki_cpp/config/grpc/call_data_set_color_setting.hpp @@ -21,10 +21,10 @@ #ifndef NINSHIKI_CPP_CONFIG__GRPC__CALL_DATA_SET_COLOR_SETTING_HPP__ #define NINSHIKI_CPP_CONFIG__GRPC__CALL_DATA_SET_COLOR_SETTING_HPP__ -#include -#include -#include -#include +#include "rclcpp/rclcpp.hpp" +#include "ninshiki_cpp/config/grpc/call_data.hpp" +#include "ninshiki_cpp/detector/color_detector.hpp" +#include "ninshiki_cpp/utils/color.hpp" namespace ninshiki_cpp { diff --git a/include/ninshiki_cpp/config/grpc/config.hpp b/include/ninshiki_cpp/config/grpc/config.hpp index 65a7463..08ba596 100644 --- a/include/ninshiki_cpp/config/grpc/config.hpp +++ b/include/ninshiki_cpp/config/grpc/config.hpp @@ -21,10 +21,10 @@ #ifndef NINSHIKI_CPP__CONFIG__GRPC__CONFIG_HPP_ #define NINSHIKI_CPP__CONFIG__GRPC__CONFIG_HPP_ -#include -#include -#include -#include +#include "grpcpp/grpcpp.h" +#include "ninshiki_cpp/detector/color_detector.hpp" +#include "ninshiki_interfaces/ninshiki.grpc.pb.h" +#include "ninshiki_interfaces/ninshiki.pb.h" #include #include diff --git a/src/ninshiki_cpp/config/grpc/call_data_get_color_setting.cpp b/src/ninshiki_cpp/config/grpc/call_data_get_color_setting.cpp index 6ffa1e6..094fa2b 100644 --- a/src/ninshiki_cpp/config/grpc/call_data_get_color_setting.cpp +++ b/src/ninshiki_cpp/config/grpc/call_data_get_color_setting.cpp @@ -18,11 +18,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include -#include -#include -#include -#include +#include "ninshiki_cpp/config/grpc/call_data_get_color_setting.hpp" +#include "ninshiki_cpp/config/utils/config.hpp" +#include "ninshiki_interfaces/ninshiki.grpc.pb.h" +#include "ninshiki_interfaces/ninshiki.pb.h" +#include "rclcpp/rclcpp.hpp" namespace ninshiki_cpp { diff --git a/src/ninshiki_cpp/config/grpc/call_data_load_config.cpp b/src/ninshiki_cpp/config/grpc/call_data_load_config.cpp index 3844123..737fe0e 100644 --- a/src/ninshiki_cpp/config/grpc/call_data_load_config.cpp +++ b/src/ninshiki_cpp/config/grpc/call_data_load_config.cpp @@ -18,11 +18,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include -#include -#include -#include -#include +#include "ninshiki_cpp/config/grpc/call_data_load_config.hpp" +#include "ninshiki_cpp/config/utils/config.hpp" +#include "ninshiki_interfaces/ninshiki.grpc.pb.h" +#include "ninshiki_interfaces/ninshiki.pb.h" +#include "rclcpp/rclcpp.hpp" namespace ninshiki_cpp { diff --git a/src/ninshiki_cpp/config/grpc/call_data_save_color_setting.cpp b/src/ninshiki_cpp/config/grpc/call_data_save_color_setting.cpp index 1e18d4b..cf01241 100644 --- a/src/ninshiki_cpp/config/grpc/call_data_save_color_setting.cpp +++ b/src/ninshiki_cpp/config/grpc/call_data_save_color_setting.cpp @@ -18,12 +18,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include -#include -#include -#include -#include -#include +#include "ninshiki_cpp/config/grpc/call_data_save_color_setting.hpp" +#include "ninshiki_cpp/config/utils/config.hpp" +#include "ninshiki_interfaces/ninshiki.grpc.pb.h" +#include "ninshiki_interfaces/ninshiki.pb.h" +#include "nlohmann/json.hpp" +#include "rclcpp/rclcpp.hpp" namespace ninshiki_cpp { diff --git a/src/ninshiki_cpp/config/grpc/call_data_set_color_setting.cpp b/src/ninshiki_cpp/config/grpc/call_data_set_color_setting.cpp index e7e4c0f..bb48e4e 100644 --- a/src/ninshiki_cpp/config/grpc/call_data_set_color_setting.cpp +++ b/src/ninshiki_cpp/config/grpc/call_data_set_color_setting.cpp @@ -18,11 +18,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include -#include -#include -#include -#include +#include "ninshiki_cpp/config/grpc/call_data_set_color_setting.hpp" +#include "ninshiki_cpp/config/utils/config.hpp" +#include "ninshiki_interfaces/ninshiki.grpc.pb.h" +#include "ninshiki_interfaces/ninshiki.pb.h" +#include "rclcpp/rclcpp.hpp" namespace ninshiki_cpp { diff --git a/src/ninshiki_cpp/config/grpc/config.cpp b/src/ninshiki_cpp/config/grpc/config.cpp index 7b35515..b7b4a77 100644 --- a/src/ninshiki_cpp/config/grpc/config.cpp +++ b/src/ninshiki_cpp/config/grpc/config.cpp @@ -18,14 +18,14 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include -#include -#include -#include -#include -#include -#include -#include +#include "rclcpp/rclcpp.hpp" +#include "ninshiki_cpp/config/grpc/call_data_base.hpp" +#include "ninshiki_cpp/config/grpc/call_data_get_color_setting.hpp" +#include "ninshiki_cpp/config/grpc/call_data_load_config.hpp" +#include "ninshiki_cpp/config/grpc/call_data_save_color_setting.hpp" +#include "ninshiki_cpp/config/grpc/call_data_set_color_setting.hpp" +#include "ninshiki_cpp/config/grpc/config.hpp" +#include "ninshiki_cpp/config/utils/config.hpp" #include #include diff --git a/src/ninshiki_cpp/config/utils/config.cpp b/src/ninshiki_cpp/config/utils/config.cpp index 0e8f81c..27fe48c 100644 --- a/src/ninshiki_cpp/config/utils/config.cpp +++ b/src/ninshiki_cpp/config/utils/config.cpp @@ -18,8 +18,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include -#include +#include "ninshiki_cpp/config/utils/config.hpp" +#include "nlohmann/json.hpp" #include #include diff --git a/src/ninshiki_cpp_detector.cpp b/src/ninshiki_cpp_detector.cpp index 85f2750..61c2ca3 100644 --- a/src/ninshiki_cpp_detector.cpp +++ b/src/ninshiki_cpp_detector.cpp @@ -18,8 +18,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include -#include +#include "ninshiki_cpp/ninshiki_cpp.hpp" +#include "rclcpp/rclcpp.hpp" #include #include From 8f19d4f48a3398c1613b4ee48a0d02a4098bd637 Mon Sep 17 00:00:00 2001 From: mbsaloka Date: Sat, 15 Jun 2024 15:37:39 +0700 Subject: [PATCH 3/3] fix: reorder include library --- .../ninshiki_cpp/detector/color_detector.hpp | 23 +++++++++---------- include/ninshiki_cpp/detector/detector.hpp | 10 ++++---- .../ninshiki_cpp/detector/dnn_detector.hpp | 15 ++++++------ .../ninshiki_cpp/detector/lbp_detector.hpp | 12 +++++----- .../ninshiki_cpp/node/ninshiki_cpp_node.hpp | 17 +++++++------- include/ninshiki_cpp/utils/contours.hpp | 6 ++--- src/ninshiki_cpp/detector/dnn_detector.cpp | 4 ++-- src/ninshiki_cpp/detector/lbp_detector.cpp | 5 ++-- src/ninshiki_cpp/node/ninshiki_cpp_node.cpp | 5 ++-- src/ninshiki_cpp/utils/color.cpp | 3 ++- src/ninshiki_cpp/utils/contours.cpp | 12 +++++----- src/ninshiki_cpp/utils/utils.cpp | 11 ++++----- 12 files changed, 60 insertions(+), 63 deletions(-) diff --git a/include/ninshiki_cpp/detector/color_detector.hpp b/include/ninshiki_cpp/detector/color_detector.hpp index 964a125..2e0b297 100644 --- a/include/ninshiki_cpp/detector/color_detector.hpp +++ b/include/ninshiki_cpp/detector/color_detector.hpp @@ -21,22 +21,21 @@ #ifndef NINSHIKI_CPP__DETECTOR__COLOR_DETECTOR_HPP_ #define NINSHIKI_CPP__DETECTOR__COLOR_DETECTOR_HPP_ -#include -#include - -#include -#include -#include -#include -#include - #include "keisan/geometry/point_2.hpp" +#include "ninshiki_cpp/detector/detector.hpp" +#include "ninshiki_cpp/utils/color.hpp" +#include "ninshiki_cpp/utils/utils.hpp" #include "ninshiki_interfaces/msg/point.hpp" #include "ninshiki_interfaces/msg/contour.hpp" #include "ninshiki_interfaces/msg/contours.hpp" -#include "ninshiki_cpp/utils/color.hpp" -#include "ninshiki_cpp/utils/utils.hpp" -#include "ninshiki_cpp/detector/detector.hpp" + +#include +#include +#include +#include +#include +#include +#include namespace ninshiki_cpp::detector { diff --git a/include/ninshiki_cpp/detector/detector.hpp b/include/ninshiki_cpp/detector/detector.hpp index 102ebc6..43ba000 100644 --- a/include/ninshiki_cpp/detector/detector.hpp +++ b/include/ninshiki_cpp/detector/detector.hpp @@ -21,15 +21,15 @@ #ifndef NINSHIKI_CPP__DETECTOR__DETECTOR_HPP_ #define NINSHIKI_CPP__DETECTOR__DETECTOR_HPP_ -#include -#include -#include -#include - #include "ninshiki_cpp/utils/utils.hpp" #include "ninshiki_interfaces/msg/detected_object.hpp" #include "ninshiki_interfaces/msg/detected_objects.hpp" +#include +#include +#include +#include + namespace ninshiki_cpp::detector { diff --git a/include/ninshiki_cpp/detector/dnn_detector.hpp b/include/ninshiki_cpp/detector/dnn_detector.hpp index 73dab1c..4af2403 100644 --- a/include/ninshiki_cpp/detector/dnn_detector.hpp +++ b/include/ninshiki_cpp/detector/dnn_detector.hpp @@ -21,19 +21,18 @@ #ifndef NINSHIKI_CPP__DETECTOR__DNN_DETECTOR_HPP_ #define NINSHIKI_CPP__DETECTOR__DNN_DETECTOR_HPP_ -#include -#include -#include +#include "ninshiki_cpp/detector/detector.hpp" +#include "ninshiki_cpp/utils/utils.hpp" +#include "ninshiki_interfaces/msg/detected_object.hpp" +#include "ninshiki_interfaces/msg/detected_objects.hpp" #include +#include +#include +#include #include #include -#include "ninshiki_cpp/detector/detector.hpp" -#include "ninshiki_interfaces/msg/detected_object.hpp" -#include "ninshiki_interfaces/msg/detected_objects.hpp" -#include "ninshiki_cpp/utils/utils.hpp" - namespace ninshiki_cpp::detector { diff --git a/include/ninshiki_cpp/detector/lbp_detector.hpp b/include/ninshiki_cpp/detector/lbp_detector.hpp index d1b78ae..5e6baa2 100644 --- a/include/ninshiki_cpp/detector/lbp_detector.hpp +++ b/include/ninshiki_cpp/detector/lbp_detector.hpp @@ -21,16 +21,16 @@ #ifndef NINSHIKI_CPP__DETECTOR__LBP_DETECTOR_HPP_ #define NINSHIKI_CPP__DETECTOR__LBP_DETECTOR_HPP_ -#include -#include -#include -#include - -#include "ninshiki_cpp/utils/utils.hpp" #include "ninshiki_cpp/detector/detector.hpp" +#include "ninshiki_cpp/utils/utils.hpp" #include "ninshiki_interfaces/msg/detected_object.hpp" #include "ninshiki_interfaces/msg/detected_objects.hpp" +#include +#include +#include +#include + namespace ninshiki_cpp::detector { class LBPDetector : public Detector diff --git a/include/ninshiki_cpp/node/ninshiki_cpp_node.hpp b/include/ninshiki_cpp/node/ninshiki_cpp_node.hpp index 887806d..8c1386a 100644 --- a/include/ninshiki_cpp/node/ninshiki_cpp_node.hpp +++ b/include/ninshiki_cpp/node/ninshiki_cpp_node.hpp @@ -21,23 +21,22 @@ #ifndef NINSHIKI_CPP__NODE__NINSHIKI_CPP_NODE_HPP_ #define NINSHIKI_CPP__NODE__NINSHIKI_CPP_NODE_HPP_ -#include -#include -#include - -#include -#include - -#include "rclcpp/rclcpp.hpp" -#include "sensor_msgs/msg/image.hpp" #include "ninshiki_cpp/config/grpc/config.hpp" #include "ninshiki_cpp/detector/color_detector.hpp" #include "ninshiki_cpp/detector/detector.hpp" #include "ninshiki_cpp/detector/dnn_detector.hpp" #include "ninshiki_cpp/detector/lbp_detector.hpp" #include "ninshiki_interfaces/msg/detected_objects.hpp" +#include "rclcpp/rclcpp.hpp" +#include "sensor_msgs/msg/image.hpp" #include "shisen_cpp/shisen_cpp.hpp" +#include +#include +#include +#include +#include + namespace ninshiki_cpp::node { diff --git a/include/ninshiki_cpp/utils/contours.hpp b/include/ninshiki_cpp/utils/contours.hpp index 74c5846..fc6322a 100644 --- a/include/ninshiki_cpp/utils/contours.hpp +++ b/include/ninshiki_cpp/utils/contours.hpp @@ -21,12 +21,12 @@ #ifndef NINSHIKI_CPP__UTILS__CONTOURS_HPP_ #define NINSHIKI_CPP__UTILS__CONTOURS_HPP_ -#include -#include - #include "opencv2/opencv.hpp" #include "keisan/keisan.hpp" +#include +#include + namespace ninshiki_cpp::utils { diff --git a/src/ninshiki_cpp/detector/dnn_detector.cpp b/src/ninshiki_cpp/detector/dnn_detector.cpp index 475f7c5..8b6dbe7 100644 --- a/src/ninshiki_cpp/detector/dnn_detector.cpp +++ b/src/ninshiki_cpp/detector/dnn_detector.cpp @@ -18,12 +18,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +#include "ninshiki_cpp/detector/dnn_detector.hpp" + #include #include #include -#include "ninshiki_cpp/detector/dnn_detector.hpp" - namespace ninshiki_cpp { namespace detector diff --git a/src/ninshiki_cpp/detector/lbp_detector.cpp b/src/ninshiki_cpp/detector/lbp_detector.cpp index fd084f5..2b61bce 100644 --- a/src/ninshiki_cpp/detector/lbp_detector.cpp +++ b/src/ninshiki_cpp/detector/lbp_detector.cpp @@ -18,14 +18,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include +#include "ninshiki_cpp/detector/lbp_detector.hpp" #include +#include #include #include -#include "ninshiki_cpp/detector/lbp_detector.hpp" - namespace ninshiki_cpp { namespace detector diff --git a/src/ninshiki_cpp/node/ninshiki_cpp_node.cpp b/src/ninshiki_cpp/node/ninshiki_cpp_node.cpp index bea9da7..5d730cd 100644 --- a/src/ninshiki_cpp/node/ninshiki_cpp_node.cpp +++ b/src/ninshiki_cpp/node/ninshiki_cpp_node.cpp @@ -18,11 +18,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +#include "ninshiki_cpp/node/ninshiki_cpp_node.hpp" + +#include #include #include #include -#include -#include "ninshiki_cpp/node/ninshiki_cpp_node.hpp" using namespace std::chrono_literals; diff --git a/src/ninshiki_cpp/utils/color.cpp b/src/ninshiki_cpp/utils/color.cpp index 1ff56d9..b049ec2 100644 --- a/src/ninshiki_cpp/utils/color.cpp +++ b/src/ninshiki_cpp/utils/color.cpp @@ -18,9 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include #include "ninshiki_cpp/utils/color.hpp" +#include + namespace ninshiki_cpp::utils { diff --git a/src/ninshiki_cpp/utils/contours.cpp b/src/ninshiki_cpp/utils/contours.cpp index 55b6bc0..bf17426 100644 --- a/src/ninshiki_cpp/utils/contours.cpp +++ b/src/ninshiki_cpp/utils/contours.cpp @@ -18,15 +18,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +#include "keisan/keisan.hpp" +#include "ninshiki_cpp/utils/contours.hpp" +#include "opencv2/opencv.hpp" + +#include +#include #include #include #include -#include -#include - -#include "ninshiki_cpp/utils/contours.hpp" -#include "opencv2/opencv.hpp" -#include "keisan/keisan.hpp" namespace ninshiki_cpp::utils { diff --git a/src/ninshiki_cpp/utils/utils.cpp b/src/ninshiki_cpp/utils/utils.cpp index 4173b9b..0a9f5e2 100644 --- a/src/ninshiki_cpp/utils/utils.cpp +++ b/src/ninshiki_cpp/utils/utils.cpp @@ -18,18 +18,17 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#include -#include -#include +#include "ninshiki_cpp/utils/utils.hpp" #include #include -#include #include +#include +#include +#include +#include #include -#include "ninshiki_cpp/utils/utils.hpp" - namespace ninshiki_cpp::utils {