ROS2SimulationInterfacesSystemComponent.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 <AzFramework/API/ApplicationAPI.h>
  11. #include "Services/DeleteEntityServiceHandler.h"
  12. #include "Services/GetEntitiesServiceHandler.h"
  13. #include "Services/GetEntitiesStatesServiceHandler.h"
  14. #include "Services/GetEntityStateServiceHandler.h"
  15. #include "Services/GetSimulationFeaturesServiceHandler.h"
  16. #include "Services/GetSimulationStateServiceHandler.h"
  17. #include "Services/GetSpawnablesServiceHandler.h"
  18. #include "Services/ROS2ServiceBase.h"
  19. #include "Services/ResetSimulationServiceHandler.h"
  20. #include "Services/SetEntityStateServiceHandler.h"
  21. #include "Services/SetSimulationStateServiceHandler.h"
  22. #include "Services/SpawnEntityServiceHandler.h"
  23. #include "Services/StepSimulationServiceHandler.h"
  24. #include "SimulationInterfaces/ROS2SimulationInterfacesRequestBus.h"
  25. #include <AzCore/std/containers/unordered_map.h>
  26. #include <AzCore/std/optional.h>
  27. #include <AzCore/std/smart_ptr/shared_ptr.h>
  28. #include <AzCore/std/string/string.h>
  29. namespace ROS2SimulationInterfaces
  30. {
  31. class ROS2SimulationInterfacesSystemComponent
  32. : public AZ::Component
  33. , public ROS2SimulationInterfacesRequestBus::Handler
  34. {
  35. public:
  36. AZ_COMPONENT_DECL(ROS2SimulationInterfacesSystemComponent);
  37. static void Reflect(AZ::ReflectContext* context);
  38. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  39. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  40. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  41. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  42. ROS2SimulationInterfacesSystemComponent() = default;
  43. ~ROS2SimulationInterfacesSystemComponent() = default;
  44. protected:
  45. // AZ::Component interface implementation
  46. void Init() override;
  47. void Activate() override;
  48. void Deactivate() override;
  49. // ROS2SimulationInterfacesRequestBus override
  50. AZStd::unordered_set<SimulationFeatureType> GetSimulationFeatures() override;
  51. private:
  52. AZStd::unordered_map<AZStd::string, AZStd::shared_ptr<IROS2HandlerBase>> m_availableRos2Interface;
  53. };
  54. } // namespace ROS2SimulationInterfaces