SimulationInterfacesROS2SystemComponent.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/GetSpawnablesServiceHandler.h"
  17. #include "Services/ROS2ServiceBase.h"
  18. #include "Services/SetEntityStateServiceHandler.h"
  19. #include "Services/SpawnEntityServiceHandler.h"
  20. #include "Services/ResetSimulationServiceHandler.h"
  21. #include "SimulationInterfacesROS2/SimulationInterfacesROS2RequestBus.h"
  22. #include <AzCore/std/containers/unordered_map.h>
  23. #include <AzCore/std/optional.h>
  24. #include <AzCore/std/smart_ptr/shared_ptr.h>
  25. #include <AzCore/std/string/string.h>
  26. namespace SimulationInterfacesROS2
  27. {
  28. class SimulationInterfacesROS2SystemComponent
  29. : public AZ::Component
  30. , public SimulationInterfacesROS2RequestBus::Handler
  31. {
  32. public:
  33. AZ_COMPONENT_DECL(SimulationInterfacesROS2SystemComponent);
  34. static void Reflect(AZ::ReflectContext* context);
  35. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
  36. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
  37. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  38. static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
  39. SimulationInterfacesROS2SystemComponent() = default;
  40. ~SimulationInterfacesROS2SystemComponent() = default;
  41. protected:
  42. // AZ::Component interface implementation
  43. void Init() override;
  44. void Activate() override;
  45. void Deactivate() override;
  46. // SimulationInterfacesROS2RequestBus override
  47. AZStd::unordered_set<AZ::u8> GetSimulationFeatures() override;
  48. private:
  49. AZStd::unordered_map<AZStd::string, AZStd::shared_ptr<IROS2HandlerBase>> m_availableRos2Interface;
  50. };
  51. } // namespace SimulationInterfacesROS2