QoS.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/RTTI/RTTI.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. #include <ROS2/ROS2TypeIds.h>
  12. #include <rclcpp/qos.hpp>
  13. namespace ROS2
  14. {
  15. //! A wrapper for rclcpp::QoS (Quality of Service for DDS) with reflection.
  16. //! @see <a href="https://design.ros2.org/articles/qos.html">Quality of Service policies</a>.
  17. struct QoS
  18. {
  19. public:
  20. AZ_TYPE_INFO(QoS, QoSTypeId);
  21. QoS(const rclcpp::QoS& qos = rclcpp::QoS(rmw_qos_profile_default.depth));
  22. static void Reflect(AZ::ReflectContext* context);
  23. //! Convert and return a rclcpp::QoS instance based on member values (Editor combos selection).
  24. //! @return a <a href="https://docs.ros2.org/latest/api/rclcpp/classrclcpp_1_1QoS.html">ROS2 QoS struct</a>.
  25. rclcpp::QoS GetQoS() const;
  26. private:
  27. AZ::Crc32 OnQoSSelected() const;
  28. rclcpp::ReliabilityPolicy m_reliabilityPolicy;
  29. rclcpp::DurabilityPolicy m_durabilityPolicy;
  30. uint32_t m_depth;
  31. };
  32. } // namespace ROS2