LidarTemplate.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/RTTI.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. #include <AzCore/std/string/string.h>
  12. namespace ROS2
  13. {
  14. //! Configuration reflecting a specific Lidar model.
  15. //! This is meant to capture differences between different Lidars available on the market.
  16. //! @note Current implementation is simplified. Rays in real lidars are often not uniformly
  17. //! distributed among angular range, there is noise etc.
  18. struct LidarTemplate
  19. {
  20. public:
  21. AZ_TYPE_INFO(LidarTemplate, "{9E9EF583-733D-4450-BBA0-ADD4D1BEFBF2}");
  22. static void Reflect(AZ::ReflectContext* context);
  23. enum class LidarModel
  24. {
  25. Generic3DLidar
  26. };
  27. LidarModel m_model;
  28. //! Name of lidar template
  29. AZStd::string m_name;
  30. //! Minimum horizontal angle (altitude of the ray), in degrees
  31. float m_minHAngle = 0.0f;
  32. //! Maximum horizontal angle (altitude of the ray), in degrees
  33. float m_maxHAngle = 0.0f;
  34. //! Minimum vertical angle (azimuth of the ray), in degrees
  35. float m_minVAngle = 0.0f;
  36. //! Maximum vertical angle (azimuth of the ray), in degrees
  37. float m_maxVAngle = 0.0f;
  38. //! Number of lasers layers (resolution in horizontal direction)
  39. unsigned int m_layers = 0;
  40. //! Resolution in vertical direction
  41. unsigned int m_numberOfIncrements = 0;
  42. //! Maximum range of simulated LiDAR
  43. float m_maxRange = 0.0f;
  44. //! Adds point with maximum range when ray does not hit obstacle
  45. bool m_addPointsAtMax = false;
  46. };
  47. } // namespace ROS2