ros_utils.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2023 Intel Corporation. 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 <iostream>
  16. #include <vector>
  17. #include <rclcpp/rclcpp.hpp>
  18. #include <librealsense2/rs.hpp>
  19. #include <librealsense2/rsutil.h>
  20. namespace realsense2_camera
  21. {
  22. typedef std::pair<rs2_stream, int> stream_index_pair;
  23. const stream_index_pair COLOR{RS2_STREAM_COLOR, 0};
  24. const stream_index_pair DEPTH{RS2_STREAM_DEPTH, 0};
  25. const stream_index_pair INFRA0{RS2_STREAM_INFRARED, 0};
  26. const stream_index_pair INFRA1{RS2_STREAM_INFRARED, 1};
  27. const stream_index_pair INFRA2{RS2_STREAM_INFRARED, 2};
  28. const stream_index_pair GYRO{RS2_STREAM_GYRO, 0};
  29. const stream_index_pair ACCEL{RS2_STREAM_ACCEL, 0};
  30. bool isValidCharInName(char c);
  31. std::string rs2_to_ros(std::string rs2_name);
  32. std::string ros_stream_to_string(rs2_stream stream);
  33. std::string create_graph_resource_name(const std::string &original_name);
  34. const rmw_qos_profile_t qos_string_to_qos(std::string str);
  35. const std::string list_available_qos_strings();
  36. rs2_format string_to_rs2_format(std::string str);
  37. }