ROS2SpawnPointComponentController.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include <AzCore/Component/Component.h>
  10. #include <AzCore/Component/ComponentBus.h>
  11. #include <AzCore/Math/Transform.h>
  12. #include <ROS2/Spawner/SpawnerInfo.h>
  13. namespace ROS2
  14. {
  15. class ROS2SpawnPointComponentConfig final : public AZ::ComponentConfig
  16. {
  17. public:
  18. AZ_RTTI(ROS2SpawnPointComponentConfig, "{eb3e6937-0d1d-4a31-87d7-6d6663e3cf35}");
  19. ROS2SpawnPointComponentConfig() = default;
  20. ~ROS2SpawnPointComponentConfig() = default;
  21. static void Reflect(AZ::ReflectContext* context);
  22. AZStd::string m_name;
  23. AZStd::string m_info;
  24. AZ::EntityId m_editorEntityId;
  25. };
  26. //! SpawnPoint indicates a place which is suitable to spawn a robot.
  27. class ROS2SpawnPointComponentController
  28. {
  29. public:
  30. AZ_TYPE_INFO(ROS2SpawnPointComponentController, "{cd29d626-0205-4ca0-ac0f-5377e4fd84dd}");
  31. ROS2SpawnPointComponentController() = default;
  32. explicit ROS2SpawnPointComponentController(const ROS2SpawnPointComponentConfig& config);
  33. ~ROS2SpawnPointComponentController() = default;
  34. static void Reflect(AZ::ReflectContext* context);
  35. //////////////////////////////////////////////////////////////////////////
  36. // Controller component
  37. void Activate(AZ::EntityId entityId);
  38. void Deactivate();
  39. void SetConfiguration(const ROS2SpawnPointComponentConfig& config);
  40. const ROS2SpawnPointComponentConfig& GetConfiguration() const;
  41. //////////////////////////////////////////////////////////////////////////
  42. AZStd::pair<AZStd::string, SpawnPointInfo> GetInfo() const;
  43. private:
  44. ROS2SpawnPointComponentConfig m_config;
  45. };
  46. } // namespace ROS2