ROS2EditorModule.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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/RTTI/RTTIMacros.h>
  9. #include <Camera/ROS2CameraSensorEditorComponent.h>
  10. #include <Camera/ROS2EditorCameraSystemComponent.h>
  11. #include <Frame/ROS2FrameSystemComponent.h>
  12. #include <Lidar/LidarRegistrarEditorSystemComponent.h>
  13. #include <Manipulation/JointsManipulationEditorComponent.h>
  14. #include <Manipulation/JointsPositionsEditorComponent.h>
  15. #include <QtCore/qglobal.h>
  16. #include <ROS2/Frame/ROS2FrameEditorComponent.h>
  17. #include <ROS2ModuleInterface.h>
  18. #include <RobotImporter/ROS2RobotImporterEditorSystemComponent.h>
  19. #include <SdfAssetBuilder/SdfAssetBuilderSystemComponent.h>
  20. #include <SystemComponents/ROS2EditorSystemComponent.h>
  21. #ifdef WITH_GAZEBO_MSGS
  22. #include <Spawner/ROS2SpawnPointEditorComponent.h>
  23. #include <Spawner/ROS2SpawnerEditorComponent.h>
  24. #endif
  25. void InitROS2Resources()
  26. {
  27. // Registration of Qt (ROS2.qrc) resources
  28. Q_INIT_RESOURCE(ROS2);
  29. }
  30. namespace ROS2
  31. {
  32. class ROS2EditorModule : public ROS2ModuleInterface
  33. {
  34. public:
  35. AZ_RTTI(ROS2EditorModule, "{3DDFC98F-D1CC-4658-BAF8-2CC34A9D39F3}", ROS2ModuleInterface);
  36. AZ_CLASS_ALLOCATOR(ROS2EditorModule, AZ::SystemAllocator);
  37. ROS2EditorModule()
  38. {
  39. InitROS2Resources();
  40. m_descriptors.insert(
  41. m_descriptors.end(),
  42. { ROS2EditorSystemComponent::CreateDescriptor(),
  43. ROS2EditorCameraSystemComponent::CreateDescriptor(),
  44. LidarRegistrarEditorSystemComponent::CreateDescriptor(),
  45. ROS2RobotImporterEditorSystemComponent::CreateDescriptor(),
  46. ROS2CameraSensorEditorComponent::CreateDescriptor(),
  47. #ifdef WITH_GAZEBO_MSGS
  48. ROS2SpawnerEditorComponent::CreateDescriptor(),
  49. ROS2SpawnPointEditorComponent::CreateDescriptor(),
  50. #endif
  51. SdfAssetBuilderSystemComponent::CreateDescriptor(),
  52. JointsManipulationEditorComponent::CreateDescriptor(),
  53. JointsPositionsEditorComponent::CreateDescriptor(),
  54. ROS2FrameSystemComponent::CreateDescriptor(),
  55. ROS2FrameEditorComponent::CreateDescriptor() });
  56. }
  57. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  58. {
  59. return AZ::ComponentTypeList{
  60. azrtti_typeid<ROS2EditorSystemComponent>(), azrtti_typeid<ROS2EditorCameraSystemComponent>(),
  61. azrtti_typeid<LidarRegistrarEditorSystemComponent>(), azrtti_typeid<ROS2RobotImporterEditorSystemComponent>(),
  62. azrtti_typeid<SdfAssetBuilderSystemComponent>(), azrtti_typeid<ROS2FrameSystemComponent>(),
  63. };
  64. }
  65. };
  66. } // namespace ROS2
  67. AZ_DECLARE_MODULE_CLASS(Gem_ROS2, ROS2::ROS2EditorModule)