ROS2ModuleInterface.cpp 1.8 KB

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