LidarSystemBus.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/Component/EntityId.h>
  10. #include <AzCore/EBus/EBus.h>
  11. #include <ROS2Sensors/Lidar/LidarRaycasterBus.h>
  12. #include <ROS2Sensors/ROS2SensorsTypeIds.h>
  13. namespace ROS2Sensors
  14. {
  15. //! Interface class that allows for communication with a given Lidar System (implementation).
  16. class LidarSystemRequests
  17. {
  18. public:
  19. AZ_RTTI(LidarSystemRequests, LidarSystemBusTypeId);
  20. //! Creates a new Lidar.
  21. //! @param lidarEntityId EntityId holding the ROS2LidarSensorComponent.
  22. //! @return A unique Id of the newly created Lidar.
  23. virtual LidarId CreateLidar(AZ::EntityId lidarEntityId) = 0;
  24. //! Destroys a no longer used Lidar.
  25. //! @param lidarId Id of the lidar to be destroyed.
  26. virtual void DestroyLidar(LidarId lidarId) = 0;
  27. protected:
  28. ~LidarSystemRequests() = default;
  29. };
  30. class LidarSystemBusTraits : public AZ::EBusTraits
  31. {
  32. public:
  33. //////////////////////////////////////////////////////////////////////////
  34. // EBusTraits overrides
  35. using BusIdType = AZ::Crc32;
  36. static constexpr AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
  37. static constexpr AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
  38. //////////////////////////////////////////////////////////////////////////
  39. };
  40. using LidarSystemRequestBus = AZ::EBus<LidarSystemRequests, LidarSystemBusTraits>;
  41. } // namespace ROS2Sensors