2
0

StepSimulationServiceHandler.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 "ROS2ServiceBase.h"
  10. #include <AzCore/Component/TickBus.h>
  11. #include <AzCore/std/string/string_view.h>
  12. #include <simulation_interfaces/srv/step_simulation.hpp>
  13. namespace ROS2SimulationInterfaces
  14. {
  15. class StepSimulationServiceHandler
  16. : public ROS2ServiceBase<simulation_interfaces::srv::StepSimulation>
  17. , private AZ::TickBus::Handler
  18. {
  19. public:
  20. AZStd::string_view GetTypeName() const override
  21. {
  22. return "StepSimulation";
  23. }
  24. AZStd::string_view GetDefaultName() const override
  25. {
  26. return "step_simulation";
  27. }
  28. AZStd::unordered_set<AZ::u8> GetProvidedFeatures() override;
  29. AZStd::optional<Response> HandleServiceRequest(const std::shared_ptr<rmw_request_id_t> header, const Request& request) override;
  30. private:
  31. // AZ::TickBus::Handler overrides
  32. void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
  33. };
  34. } // namespace ROS2SimulationInterfaces