2
0

CameraSensorDescription.h 2.1 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 <ROS2/Sensor/SensorConfiguration.h>
  10. #include <ROS2Sensors/Camera/CameraSensorConfiguration.h>
  11. #include <AzCore/Math/Matrix4x4.h>
  12. #include <AzCore/std/containers/array.h>
  13. #include <AzCore/std/string/string.h>
  14. namespace ROS2Sensors
  15. {
  16. //! Structure containing all information required to create the camera sensor.
  17. struct CameraSensorDescription
  18. {
  19. //! Type of camera channel.
  20. enum class CameraChannelType
  21. {
  22. RGB = 0,
  23. DEPTH = 1
  24. };
  25. //! Constructor to create the description
  26. //! @param cameraName - name of the camera; used to differentiate cameras in a multi-camera setup.
  27. //! @param effectiveNamespace - namespace for camera frames and topics.
  28. //! @param configuration - configuration structure for the camera, defining its characteristics.
  29. //! @param sensorConfiguration - generic configuration for this sensor.
  30. CameraSensorDescription(
  31. const AZStd::string& cameraName,
  32. const AZStd::string& effectiveNamespace,
  33. const CameraSensorConfiguration& configuration,
  34. const ROS2::SensorConfiguration& sensorConfiguration);
  35. const CameraSensorConfiguration m_cameraConfiguration; //!< Configuration of the camera.
  36. const ROS2::SensorConfiguration m_sensorConfiguration; //!< Generic sensor configuration.
  37. const AZStd::string m_cameraName; //!< Camera name to differentiate cameras in a multi-camera setup.
  38. const AZStd::string m_cameraNamespace; //!< Effective camera namespace for frames and topics.
  39. const AZ::Matrix4x4 m_viewToClipMatrix; //!< Camera view to clip space transform matrix; derived from other parameters.
  40. const AZ::Matrix3x3 m_cameraIntrinsics; //!< Camera intrinsics; derived from other parameters.
  41. private:
  42. void ValidateParameters() const;
  43. };
  44. } // namespace ROS2Sensors