AckermannModelLimits.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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/RTTI/TypeInfo.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. #include <VehicleDynamics/VehicleModelLimits.h>
  12. namespace ROS2Controllers::VehicleDynamics
  13. {
  14. //! A structure holding limits of vehicle, including speed and steering limits
  15. class AckermannModelLimits : public VehicleModelLimits
  16. {
  17. public:
  18. AZ_RTTI(AckermannModelLimits, "{796928D9-436F-472D-B841-E67F28F9CC82}", VehicleModelLimits);
  19. AckermannModelLimits() = default;
  20. AckermannModelLimits(const float speedLimit, const float steeringLimit, const float acceleration);
  21. static void Reflect(AZ::ReflectContext* context);
  22. // VehicleModelLimits overrides
  23. VehicleInputs LimitState(const VehicleInputs& inputState) const;
  24. VehicleInputs GetMaximumState() const;
  25. float GetLinearAcceleration() const;
  26. float GetLinearSpeedLimit() const;
  27. private:
  28. float m_speedLimit = 10.0f; //!< [Mps] Applies to absolute value
  29. float m_steeringLimit = 0.7f; //!< [rad] Applies to absolute value
  30. float m_acceleration = 10.0f; //!< [m*s^(-2)] Linear acceleration limit
  31. };
  32. } // namespace ROS2Controllers::VehicleDynamics