Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Create Load Config For Server #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ add_library(${PROJECT_NAME} SHARED
"src/${PROJECT_NAME}/config/grpc/config.cpp"
"src/${PROJECT_NAME}/config/grpc/call_data_get_capture_setting.cpp"
"src/${PROJECT_NAME}/config/grpc/call_data_get_image.cpp"
"src/${PROJECT_NAME}/config/grpc/call_data_load_config.cpp"
"src/${PROJECT_NAME}/config/grpc/call_data_save_capture_setting.cpp"
"src/${PROJECT_NAME}/config/grpc/call_data_set_capture_setting.cpp"
"src/${PROJECT_NAME}/config/utils/config.cpp"
Expand Down
8 changes: 4 additions & 4 deletions include/shisen_cpp/camera/node/camera_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#ifndef SHISEN_CPP__CAMERA__NODE__CAMERA_NODE_HPP_
#define SHISEN_CPP__CAMERA__NODE__CAMERA_NODE_HPP_

#include <rclcpp/rclcpp.hpp>
#include <shisen_cpp/camera/provider/camera_config_provider.hpp>
#include <shisen_cpp/camera/provider/image_provider.hpp>
#include <shisen_cpp/utility.hpp>
#include "rclcpp/rclcpp.hpp"
#include "shisen_cpp/camera/provider/camera_config_provider.hpp"
#include "shisen_cpp/camera/provider/image_provider.hpp"
#include "shisen_cpp/utility.hpp"
threeal marked this conversation as resolved.
Show resolved Hide resolved

#include <memory>
#include <string>
Expand Down
6 changes: 3 additions & 3 deletions include/shisen_cpp/camera/provider/camera_config_provider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef SHISEN_CPP__CAMERA__PROVIDER__CAMERA_CONFIG_PROVIDER_HPP_
#define SHISEN_CPP__CAMERA__PROVIDER__CAMERA_CONFIG_PROVIDER_HPP_

#include <keisan/keisan.hpp>
#include <shisen_cpp/utility/options.hpp>
#include <shisen_interfaces/msg/camera_config.hpp>
#include "keisan/keisan.hpp"
#include "shisen_cpp/utility/options.hpp"
#include "shisen_interfaces/msg/camera_config.hpp"

#include <memory>
#include <string>
Expand Down
10 changes: 5 additions & 5 deletions include/shisen_cpp/camera/provider/image_provider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
#ifndef SHISEN_CPP__CAMERA__PROVIDER__IMAGE_PROVIDER_HPP_
#define SHISEN_CPP__CAMERA__PROVIDER__IMAGE_PROVIDER_HPP_

#include "sensor_msgs/msg/image.hpp"
#include "shisen_cpp/utility.hpp"
#include "std_msgs/msg/header.hpp"

#include <cv_bridge/cv_bridge.hpp>
#include <memory>
#include <opencv2/core.hpp>
#include <opencv2/videoio.hpp>
#include <sensor_msgs/msg/image.hpp>
#include <shisen_cpp/utility.hpp>
#include <std_msgs/msg/header.hpp>

#include <memory>
#include <string>

namespace shisen_cpp::camera
Expand Down
6 changes: 3 additions & 3 deletions include/shisen_cpp/config/grpc/call_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef __SHISEN_CPP__CONFIG__GRPC__CALL_DATA_HPP__
#define __SHISEN_CPP__CONFIG__GRPC__CALL_DATA_HPP__

#include <shisen_cpp/config/grpc/call_data_base.hpp>
#include <shisen_interfaces/shisen.grpc.pb.h>
#include <shisen_interfaces/shisen.pb.h>
#include "shisen_cpp/config/grpc/call_data_base.hpp"
#include "shisen_interfaces/shisen.grpc.pb.h"
#include "shisen_interfaces/shisen.pb.h"

enum class CallStatus
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef SHISEN_CPP__CONFIG__GRPC__CALL_DATA_GET_CAPTURE_SETTING_HPP__
#define SHISEN_CPP__CONFIG__GRPC__CALL_DATA_GET_CAPTURE_SETTING_HPP__

#include <shisen_cpp/config/grpc/call_data.hpp>
#include "shisen_cpp/config/grpc/call_data.hpp"

namespace shisen_cpp
{
Expand Down
4 changes: 2 additions & 2 deletions include/shisen_cpp/config/grpc/call_data_get_image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#ifndef SHISEN_CPP__CONFIG__GRPC__CALL_DATA_GET_IMAGE_HPP__
#define SHISEN_CPP__CONFIG__GRPC__CALL_DATA_GET_IMAGE_HPP__

#include <shisen_cpp/camera/node/camera_node.hpp>
#include <shisen_cpp/config/grpc/call_data.hpp>
#include "shisen_cpp/camera/node/camera_node.hpp"
#include "shisen_cpp/config/grpc/call_data.hpp"

namespace shisen_cpp
{
Expand Down
46 changes: 46 additions & 0 deletions include/shisen_cpp/config/grpc/call_data_load_config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// 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 SHISEN_CPP__CONFIG__GRPC__CALL_DATA_LOAD_CONFIG_HPP__
#define SHISEN_CPP__CONFIG__GRPC__CALL_DATA_LOAD_CONFIG_HPP__

#include "shisen_cpp/camera/node/camera_node.hpp"
#include "shisen_cpp/config/grpc/call_data.hpp"
#include "shisen_cpp/utility.hpp"

namespace shisen_cpp
{
class CallDataLoadConfig
: CallData<shisen_interfaces::proto::Empty, shisen_interfaces::proto::Empty>
{
public:
CallDataLoadConfig(
shisen_interfaces::proto::Config::AsyncService * service, grpc::ServerCompletionQueue * cq,
const std::string & path, const std::shared_ptr<camera::CameraNode>& camera_node);

protected:
void AddNextToCompletionQueue() override;
void WaitForRequest() override;
void HandleRequest() override;
std::shared_ptr<camera::CameraNode> camera_node_;
};
} // namespace shisen_cpp

#endif // SHISEN_CPP__CONFIG__GRPC__CALL_DATA_LOAD_CONFIG_HPP__
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef SHISEN_CPP__CONFIG__GRPC__CALL_DATA_SAVE_CAPTURE_SETTING_HPP__
#define SHISEN_CPP__CONFIG__GRPC__CALL_DATA_SAVE_CAPTURE_SETTING_HPP__

#include <shisen_cpp/config/grpc/call_data.hpp>
#include "shisen_cpp/config/grpc/call_data.hpp"

namespace shisen_cpp
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef SHISEN_CPP__CONFIG__GRPC__CALL_DATA_SET_CAPTURE_SETTING_HPP__
#define SHISEN_CPP__CONFIG__GRPC__CALL_DATA_SET_CAPTURE_SETTING_HPP__

#include <shisen_cpp/camera/node/camera_node.hpp>
#include <shisen_cpp/config/grpc/call_data.hpp>
#include <shisen_cpp/utility.hpp>
#include "shisen_cpp/camera/node/camera_node.hpp"
#include "shisen_cpp/config/grpc/call_data.hpp"
#include "shisen_cpp/utility.hpp"

namespace shisen_cpp
{
Expand Down
8 changes: 4 additions & 4 deletions include/shisen_cpp/config/grpc/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#ifndef SHISEN_CPP__CONFIG__GRPC__CONFIG_HPP_
#define SHISEN_CPP__CONFIG__GRPC__CONFIG_HPP_

#include <grpcpp/grpcpp.h>
#include <shisen_cpp/camera/node/camera_node.hpp>
#include <shisen_interfaces/shisen.grpc.pb.h>
#include <shisen_interfaces/shisen.pb.h>
#include "grpcpp/grpcpp.h"
#include "shisen_cpp/camera/node/camera_node.hpp"
#include "shisen_interfaces/shisen.grpc.pb.h"
#include "shisen_interfaces/shisen.pb.h"

#include <memory>
#include <thread>
Expand Down
2 changes: 1 addition & 1 deletion include/shisen_cpp/config/utils/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef SHISEN_CPP__CONFIG__UTILS__CONFIG_HPP_
#define SHISEN_CPP__CONFIG__UTILS__CONFIG_HPP_

#include <nlohmann/json.hpp>
#include "nlohmann/json.hpp"

namespace shisen_cpp
{
Expand Down
10 changes: 5 additions & 5 deletions include/shisen_cpp/node/shisen_cpp_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#ifndef SHISEN_CPP__NODE__SHISEN_CPP_NODE_HPP_
#define SHISEN_CPP__NODE__SHISEN_CPP_NODE_HPP_

#include <rclcpp/rclcpp.hpp>
#include <shisen_cpp/camera/node/camera_node.hpp>
#include <shisen_cpp/config/grpc/config.hpp>
#include <shisen_cpp/config/utils/config.hpp>
#include <shisen_cpp/utility.hpp>
#include "rclcpp/rclcpp.hpp"
#include "shisen_cpp/camera/node/camera_node.hpp"
#include "shisen_cpp/config/grpc/config.hpp"
#include "shisen_cpp/config/utils/config.hpp"
#include "shisen_cpp/utility.hpp"

#include <memory>

Expand Down
14 changes: 7 additions & 7 deletions include/shisen_cpp/shisen_cpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
#ifndef SHISEN_CPP__SHISEN_CPP_HPP_
#define SHISEN_CPP__SHISEN_CPP_HPP_

#include <shisen_cpp/camera/node/camera_node.hpp>
#include <shisen_cpp/camera/provider/image_provider.hpp>
#include <shisen_cpp/camera/provider/camera_config_provider.hpp>
#include <shisen_cpp/node/shisen_cpp_node.hpp>
#include <shisen_cpp/viewer/consumer/image_consumer.hpp>
#include <shisen_cpp/viewer/node/viewer_node.hpp>
#include "shisen_cpp/camera/node/camera_node.hpp"
#include "shisen_cpp/camera/provider/image_provider.hpp"
#include "shisen_cpp/camera/provider/camera_config_provider.hpp"
#include "shisen_cpp/node/shisen_cpp_node.hpp"
#include "shisen_cpp/viewer/consumer/image_consumer.hpp"
#include "shisen_cpp/viewer/node/viewer_node.hpp"

#include <shisen_cpp/utility.hpp>
#include "shisen_cpp/utility.hpp"

#endif // SHISEN_CPP__SHISEN_CPP_HPP_
8 changes: 4 additions & 4 deletions include/shisen_cpp/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef SHISEN_CPP__UTILITY_HPP_
#define SHISEN_CPP__UTILITY_HPP_

#include <shisen_cpp/utility/capture_setting.hpp>
#include <shisen_cpp/utility/emptiable.hpp>
#include <shisen_cpp/utility/interface.hpp>
#include <shisen_cpp/utility/options.hpp>
#include "shisen_cpp/utility/capture_setting.hpp"
#include "shisen_cpp/utility/emptiable.hpp"
#include "shisen_cpp/utility/interface.hpp"
#include "shisen_cpp/utility/options.hpp"

#endif // SHISEN_CPP__UTILITY_HPP_
4 changes: 2 additions & 2 deletions include/shisen_cpp/utility/capture_setting.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#ifndef SHISEN_CPP__UTILITY__CAPTURE_SETTING_HPP_
#define SHISEN_CPP__UTILITY__CAPTURE_SETTING_HPP_

#include <shisen_cpp/utility/emptiable.hpp>
#include <shisen_interfaces/msg/capture_setting.hpp>
#include "shisen_cpp/utility/emptiable.hpp"
#include "shisen_interfaces/msg/capture_setting.hpp"

namespace shisen_cpp
{
Expand Down
2 changes: 1 addition & 1 deletion include/shisen_cpp/utility/emptiable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ class Emptiable

} // namespace shisen_cpp

#include <shisen_cpp/utility/emptiable.impl.hpp>
#include "shisen_cpp/utility/emptiable.impl.hpp"

#endif // SHISEN_CPP__UTILITY__EMPTIABLE_HPP_
2 changes: 1 addition & 1 deletion include/shisen_cpp/utility/emptiable.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef SHISEN_CPP__UTILITY__EMPTIABLE_IMPL_HPP_
#define SHISEN_CPP__UTILITY__EMPTIABLE_IMPL_HPP_

#include <shisen_cpp/utility/emptiable.hpp>
#include "shisen_cpp/utility/emptiable.hpp"

namespace shisen_cpp
{
Expand Down
6 changes: 3 additions & 3 deletions include/shisen_cpp/utility/interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef SHISEN_CPP__UTILITY__INTERFACE_HPP_
#define SHISEN_CPP__UTILITY__INTERFACE_HPP_

#include <sensor_msgs/msg/image.hpp>
#include <shisen_interfaces/msg/camera_config.hpp>
#include <shisen_interfaces/srv/configure_capture_setting.hpp>
#include "sensor_msgs/msg/image.hpp"
#include "shisen_interfaces/msg/camera_config.hpp"
#include "shisen_interfaces/srv/configure_capture_setting.hpp"

namespace shisen_cpp
{
Expand Down
8 changes: 4 additions & 4 deletions include/shisen_cpp/viewer/consumer/image_consumer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
#ifndef SHISEN_CPP__VIEWER__CONSUMER__IMAGE_CONSUMER_HPP_
#define SHISEN_CPP__VIEWER__CONSUMER__IMAGE_CONSUMER_HPP_

#include "sensor_msgs/msg/image.hpp"
#include "shisen_cpp/utility.hpp"

#include <cv_bridge/cv_bridge.hpp>
#include <memory>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <sensor_msgs/msg/image.hpp>
#include <shisen_cpp/utility.hpp>

#include <memory>
#include <string>

namespace shisen_cpp::viewer
Expand Down
8 changes: 4 additions & 4 deletions include/shisen_cpp/viewer/node/viewer_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#ifndef SHISEN_CPP__VIEWER__NODE__VIEWER_NODE_HPP_
#define SHISEN_CPP__VIEWER__NODE__VIEWER_NODE_HPP_

#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/image.hpp>
#include <shisen_cpp/utility.hpp>
#include <shisen_cpp/viewer/consumer/image_consumer.hpp>
#include "rclcpp/rclcpp.hpp"
#include "sensor_msgs/msg/image.hpp"
#include "shisen_cpp/utility.hpp"
#include "shisen_cpp/viewer/consumer/image_consumer.hpp"

#include <memory>
#include <string>
Expand Down
8 changes: 2 additions & 6 deletions src/shisen_cpp/camera/node/camera_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#include <fstream>
#include <nlohmann/json.hpp>
#include <fstream>
#include <memory>
#include <nlohmann/json.hpp>
#include <shisen_cpp/camera/node/camera_node.hpp>
#include "nlohmann/json.hpp"
#include "shisen_cpp/camera/node/camera_node.hpp"

#include <fstream>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion src/shisen_cpp/camera/provider/camera_config_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#include <shisen_cpp/camera/provider/camera_config_provider.hpp>
#include "shisen_cpp/camera/provider/camera_config_provider.hpp"

namespace shisen_cpp::camera
{
Expand Down
2 changes: 1 addition & 1 deletion src/shisen_cpp/camera/provider/image_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#include <shisen_cpp/camera/provider/image_provider.hpp>
#include "shisen_cpp/camera/provider/image_provider.hpp"

#include <memory>
#include <opencv2/opencv.hpp>
Expand Down
10 changes: 5 additions & 5 deletions src/shisen_cpp/config/grpc/call_data_get_capture_setting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#include <rclcpp/rclcpp.hpp>
#include <shisen_cpp/config/grpc/call_data_get_capture_setting.hpp>
#include <shisen_cpp/config/utils/config.hpp>
#include <shisen_interfaces/shisen.grpc.pb.h>
#include <shisen_interfaces/shisen.pb.h>
#include "rclcpp/rclcpp.hpp"
#include "shisen_cpp/config/grpc/call_data_get_capture_setting.hpp"
#include "shisen_cpp/config/utils/config.hpp"
#include "shisen_interfaces/shisen.grpc.pb.h"
#include "shisen_interfaces/shisen.pb.h"

namespace shisen_cpp
{
Expand Down
9 changes: 5 additions & 4 deletions src/shisen_cpp/config/grpc/call_data_get_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#include "rclcpp/rclcpp.hpp"
#include "shisen_cpp/config/grpc/call_data_get_image.hpp"
#include "shisen_interfaces/shisen.grpc.pb.h"
#include "shisen_interfaces/shisen.pb.h"

#include <opencv2/opencv.hpp>
#include <rclcpp/rclcpp.hpp>
#include <shisen_cpp/config/grpc/call_data_get_image.hpp>
#include <shisen_interfaces/shisen.grpc.pb.h>
#include <shisen_interfaces/shisen.pb.h>

namespace shisen_cpp
{
Expand Down
Loading
Loading