ROS2SpawnerEditorComponent.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #pragma once
  9. #ifndef WITH_GAZEBO_MSGS
  10. static_assert(false, "This file should not be included in the build, without WITH_GAZEBO_MSGS defined.");
  11. #endif
  12. #include "Spawner/ROS2SpawnerComponent.h"
  13. #include "Spawner/ROS2SpawnerComponentController.h"
  14. #include <AzToolsFramework/ToolsComponents/EditorComponentAdapter.h>
  15. #include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
  16. #include <ROS2/Spawner/SpawnerBus.h>
  17. namespace ROS2
  18. {
  19. using ROS2SpawnerEditorComponentBase = AzToolsFramework::Components::
  20. EditorComponentAdapter<ROS2SpawnerComponentController, ROS2SpawnerComponent, ROS2SpawnerComponentConfig>;
  21. class ROS2SpawnerEditorComponent
  22. : public ROS2SpawnerEditorComponentBase
  23. , public SpawnerRequestsBus::Handler
  24. {
  25. public:
  26. AZ_EDITOR_COMPONENT(
  27. ROS2SpawnerEditorComponent, "{5950AC6B-75F3-4E0F-BA5C-17C877013710}", AzToolsFramework::Components::EditorComponentBase);
  28. ROS2SpawnerEditorComponent() = default;
  29. explicit ROS2SpawnerEditorComponent(const ROS2SpawnerComponentConfig& configuration);
  30. ~ROS2SpawnerEditorComponent() = default;
  31. static void Reflect(AZ::ReflectContext* context);
  32. //////////////////////////////////////////////////////////////////////////
  33. // ROS2SpawnerEditorComponentBase interface overrides.
  34. void Activate() override;
  35. void Deactivate() override;
  36. bool ShouldActivateController() const override;
  37. //////////////////////////////////////////////////////////////////////////
  38. //////////////////////////////////////////////////////////////////////////
  39. // SpawnerRequestsBus::Handler overrides.
  40. const AZ::Transform& GetDefaultSpawnPose() const override;
  41. AZStd::unordered_map<AZStd::string, SpawnPointInfo> GetAllSpawnPointInfos() const override;
  42. //////////////////////////////////////////////////////////////////////////
  43. AZStd::unordered_map<AZStd::string, SpawnPointInfo> GetSpawnPoints() const;
  44. };
  45. } // namespace ROS2