AckermannControlComponent.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 <ROS2/RobotControl/Ackermann/AckermannBus.h>
  11. namespace ROS2
  12. {
  13. //! A simple component which translates ackermann commands to vehicle dynamics inputs
  14. class AckermannControlComponent
  15. : public AZ::Component
  16. , private AckermannNotificationBus::Handler
  17. {
  18. public:
  19. AZ_COMPONENT(AckermannControlComponent, "{16EC2F18-F579-414C-8B3B-DB47078729BC}", AZ::Component);
  20. AckermannControlComponent() = default;
  21. //////////////////////////////////////////////////////////////////////////
  22. // Component overrides
  23. void Activate() override;
  24. void Deactivate() override;
  25. //////////////////////////////////////////////////////////////////////////
  26. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
  27. static void Reflect(AZ::ReflectContext* context);
  28. private:
  29. //////////////////////////////////////////////////////////////////////////
  30. // AckermannNotificationBus::Handler overrides
  31. void AckermannReceived(const AckermannCommandStruct& angular) override;
  32. //////////////////////////////////////////////////////////////////////////
  33. };
  34. } // namespace ROS2