ros_utils.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 <iostream>
  16. #include <vector>
  17. #include "ros_node_base.h"
  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. const stream_index_pair SAFETY{RS2_STREAM_SAFETY, 0};
  31. const stream_index_pair LABELED_POINT_CLOUD{RS2_STREAM_LABELED_POINT_CLOUD, 0};
  32. const stream_index_pair OCCUPANCY{RS2_STREAM_OCCUPANCY, 0};
  33. const stream_index_pair MOTION{RS2_STREAM_MOTION, 0};
  34. bool isValidCharInName(char c);
  35. std::string rs2_to_ros(std::string rs2_name);
  36. std::string ros_stream_to_string(rs2_stream stream);
  37. std::string create_graph_resource_name(const std::string &original_name);
  38. const rmw_qos_profile_t qos_string_to_qos(std::string str);
  39. const std::string list_available_qos_strings();
  40. rs2_format string_to_rs2_format(std::string str);
  41. std::string vectorToJsonString(const std::vector<uint8_t>& vec);
  42. }