ros_param_backend.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2023 RealSense, Inc. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include "ros_node_base.h"
  16. namespace realsense2_camera
  17. {
  18. class ParametersBackend
  19. {
  20. public:
  21. ParametersBackend(RosNodeBase& node) :
  22. _node(node),
  23. _logger(node.get_logger())
  24. {}
  25. ~ParametersBackend();
  26. #if defined( RCLCPP_HAS_OnSetParametersCallbackType )
  27. using ros2_param_callback_type = rclcpp::node_interfaces::NodeParametersInterface::OnSetParametersCallbackType;
  28. #else
  29. using ros2_param_callback_type = rclcpp::node_interfaces::NodeParametersInterface::OnParametersSetCallbackType;
  30. #endif
  31. void add_on_set_parameters_callback(ros2_param_callback_type callback);
  32. private:
  33. RosNodeBase& _node;
  34. rclcpp::Logger _logger;
  35. std::shared_ptr<void> _ros_callback;
  36. };
  37. }