ROS2ModuleInterface.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #include "ROS2ModuleInterface.h"
  9. #include <AzCore/Memory/Memory.h>
  10. #include <Clients/ROS2SystemComponent.h>
  11. #include <Clock/ROS2ClockSystemComponent.h>
  12. #include <Frame/ROS2FrameGameSystemComponent.h>
  13. #include <ROS2/Frame/ROS2FrameComponent.h>
  14. #include <ROS2/ROS2TypeIds.h>
  15. #include <ROS2/Sensor/Events/PhysicsBasedSource.h>
  16. #include <ROS2/Sensor/Events/TickBasedSource.h>
  17. #include <ROS2/Sensor/ROS2SensorComponentBase.h>
  18. #include <SimulationUtils/FollowingCameraComponent.h>
  19. #ifdef WITH_GAZEBO_MSGS
  20. #include <Spawner/ROS2SpawnPointComponent.h>
  21. #include <Spawner/ROS2SpawnerComponent.h>
  22. #endif
  23. namespace ROS2
  24. {
  25. AZ_TYPE_INFO_WITH_NAME_IMPL(ROS2ModuleInterface, "ROS2ModuleInterface", ROS2ModuleInterfaceTypeId);
  26. AZ_RTTI_NO_TYPE_INFO_IMPL(ROS2ModuleInterface, AZ::Module);
  27. AZ_CLASS_ALLOCATOR_IMPL(ROS2ModuleInterface, AZ::SystemAllocator);
  28. ROS2ModuleInterface::ROS2ModuleInterface()
  29. {
  30. m_descriptors.insert(
  31. m_descriptors.end(),
  32. {
  33. ROS2FrameGameSystemComponent::CreateDescriptor(),
  34. ROS2SystemComponent::CreateDescriptor(),
  35. ROS2ClockSystemComponent::CreateDescriptor(),
  36. ROS2FrameComponent::CreateDescriptor(),
  37. FollowingCameraComponent::CreateDescriptor(),
  38. ROS2SensorComponentBase<TickBasedSource>::CreateDescriptor(),
  39. ROS2SensorComponentBase<PhysicsBasedSource>::CreateDescriptor(),
  40. #ifdef WITH_GAZEBO_MSGS
  41. ROS2SpawnerComponent::CreateDescriptor(),
  42. ROS2SpawnPointComponent::CreateDescriptor(),
  43. #endif
  44. });
  45. }
  46. AZ::ComponentTypeList ROS2ModuleInterface::GetRequiredSystemComponents() const
  47. {
  48. return AZ::ComponentTypeList{ azrtti_typeid<ROS2SystemComponent>(),
  49. azrtti_typeid<ROS2ClockSystemComponent>(),
  50. azrtti_typeid<ROS2FrameGameSystemComponent>() };
  51. }
  52. } // namespace ROS2