ROS2ModuleInterface.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 <AzCore/Memory/SystemAllocator.h>
  9. #include <AzCore/Module/Module.h>
  10. #include <ROS2SystemComponent.h>
  11. #include <Lidar/ROS2LidarSensorComponent.h>
  12. #include <RobotControl/ROS2RobotControlComponent.h>
  13. namespace ROS2
  14. {
  15. class ROS2ModuleInterface
  16. : public AZ::Module
  17. {
  18. public:
  19. AZ_RTTI(ROS2ModuleInterface, "{8b5567cb-1de9-49af-9cd4-9750d4abcd6b}", AZ::Module);
  20. AZ_CLASS_ALLOCATOR(ROS2ModuleInterface, AZ::SystemAllocator, 0);
  21. ROS2ModuleInterface()
  22. {
  23. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  24. // Add ALL components descriptors associated with this gem to m_descriptors.
  25. // This will associate the AzTypeInfo information for the components with the the SerializeContext, BehaviorContext and EditContext.
  26. // This happens through the [MyComponent]::Reflect() function.
  27. m_descriptors.insert(m_descriptors.end(), {
  28. ROS2SystemComponent::CreateDescriptor(),
  29. ROS2LidarSensorComponent::CreateDescriptor(),
  30. ROS2RobotControlComponent::CreateDescriptor(),
  31. });
  32. }
  33. /**
  34. * Add required SystemComponents to the SystemEntity.
  35. */
  36. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  37. {
  38. return AZ::ComponentTypeList{
  39. azrtti_typeid<ROS2SystemComponent>(),
  40. };
  41. }
  42. };
  43. }// namespace ROS2