CameraCalibrationRequestBus.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/EntityId.h>
  10. #include <AzCore/EBus/EBus.h>
  11. #include <AzCore/Interface/Interface.h>
  12. #include <AzCore/Math/Matrix4x4.h>
  13. namespace ROS2Sensors
  14. {
  15. //! Interface allows to obtain intrinsic parameters of the camera. To obtain extrinsic parameters use TransformProviderRequestBus.
  16. class CameraCalibrationRequest : public AZ::EBusTraits
  17. {
  18. public:
  19. using BusIdType = AZ::EntityId;
  20. static constexpr AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
  21. //! Returns the intrinsic calibration matrix of the camera as:
  22. //! [fx 0 cx]
  23. //! [ 0 fy cy]
  24. //! [ 0 0 1]
  25. //! where:
  26. //! - fx, fy : the focal lengths in meters
  27. //! - cx, cy : principal point in pixels.
  28. virtual AZ::Matrix3x3 GetCameraMatrix() const = 0;
  29. //! Returns the width of the camera sensor in pixels
  30. virtual int GetWidth() const = 0;
  31. //! Returns the height of the camera sensor in pixels
  32. virtual int GetHeight() const = 0;
  33. //! Returns the vertical field of view of the camera in degrees
  34. virtual float GetVerticalFOV() const = 0;
  35. };
  36. using CameraCalibrationRequestBus = AZ::EBus<CameraCalibrationRequest>;
  37. } // namespace ROS2Sensors