ROS2EditorModule.cpp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 "Spawner/ROS2SpawnPointEditorComponent.h"
  9. #include "Spawner/ROS2SpawnerEditorComponent.h"
  10. #include <Camera/ROS2CameraSensorEditorComponent.h>
  11. #include <Lidar/LidarRegistrarEditorSystemComponent.h>
  12. #include <Manipulation/JointsManipulationEditorComponent.h>
  13. #include <ROS2EditorSystemComponent.h>
  14. #include <ROS2ModuleInterface.h>
  15. #include <RobotImporter/ROS2RobotImporterEditorSystemComponent.h>
  16. #include <SdfAssetBuilder/SdfAssetBuilderSystemComponent.h>
  17. #include <QtCore/qglobal.h>
  18. void InitROS2Resources()
  19. {
  20. // Registration of Qt (ROS2.qrc) resources
  21. Q_INIT_RESOURCE(ROS2);
  22. }
  23. namespace ROS2
  24. {
  25. class ROS2EditorModule : public ROS2ModuleInterface
  26. {
  27. public:
  28. AZ_RTTI(ROS2EditorModule, "{3DDFC98F-D1CC-4658-BAF8-2CC34A9D39F3}", ROS2ModuleInterface);
  29. AZ_CLASS_ALLOCATOR(ROS2EditorModule, AZ::SystemAllocator);
  30. ROS2EditorModule()
  31. {
  32. InitROS2Resources();
  33. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  34. // Add ALL components descriptors associated with this gem to m_descriptors.
  35. // This will associate the AzTypeInfo information for the components with the SerializeContext, BehaviorContext and
  36. // EditContext. This happens through the [MyComponent]::Reflect() function.
  37. m_descriptors.insert(
  38. m_descriptors.end(),
  39. { ROS2EditorSystemComponent::CreateDescriptor(),
  40. LidarRegistrarEditorSystemComponent::CreateDescriptor(),
  41. ROS2RobotImporterEditorSystemComponent::CreateDescriptor(),
  42. ROS2CameraSensorEditorComponent::CreateDescriptor(),
  43. ROS2SpawnerEditorComponent::CreateDescriptor(),
  44. ROS2SpawnPointEditorComponent::CreateDescriptor(),
  45. SdfAssetBuilderSystemComponent::CreateDescriptor(),
  46. JointsManipulationEditorComponent::CreateDescriptor() });
  47. }
  48. /**
  49. * Add required SystemComponents to the SystemEntity.
  50. * Non-SystemComponents should not be added here
  51. */
  52. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  53. {
  54. return AZ::ComponentTypeList{
  55. azrtti_typeid<ROS2EditorSystemComponent>(),
  56. azrtti_typeid<LidarRegistrarEditorSystemComponent>(),
  57. azrtti_typeid<ROS2RobotImporterEditorSystemComponent>(),
  58. azrtti_typeid<SdfAssetBuilderSystemComponent>(),
  59. };
  60. }
  61. };
  62. } // namespace ROS2
  63. AZ_DECLARE_MODULE_CLASS(Gem_ROS2, ROS2::ROS2EditorModule)