SyncSensorCalibrationData.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /*
  2. * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of NVIDIA CORPORATION nor the names of its
  13. * contributors may be used to endorse or promote products derived
  14. * from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  20. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  21. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  23. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  24. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  26. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. /**
  29. * @file
  30. * <b>Libargus Extension: Sync Sensor Calibration Data API</b>
  31. *
  32. * @b Description: This file defines the SyncSensorCalibrationData extension.
  33. */
  34. #ifndef _ARGUS_SYNC_SENSOR_CALIBRATION_DATA_H
  35. #define _ARGUS_SYNC_SENSOR_CALIBRATION_DATA_H
  36. namespace Argus
  37. {
  38. /**
  39. * The DistortionType of a sync sensor defines the type of distortion model.
  40. */
  41. DEFINE_NAMED_UUID_CLASS(DistortionType);
  42. DEFINE_UUID(DistortionType, DISTORTION_TYPE_POLYNOMIAL, 23e59580,17ff,11eb,8b6f,08,00,20,0c,9a,66);
  43. DEFINE_UUID(DistortionType, DISTORTION_TYPE_FISHEYE, 23e59581,17ff,11eb,8b6f,08,00,20,0c,9a,66);
  44. DEFINE_UUID(DistortionType, DISTORTION_TYPE_OMINI_DIRECTIONAL, 23e5bc90,17ff,11eb,8b6f,08,00,20,0c,9a,66);
  45. /**
  46. * The MappingType of a sync sensor defines the type of mapping used for fisheye distortion model.
  47. */
  48. DEFINE_NAMED_UUID_CLASS(MappingType);
  49. DEFINE_UUID(MappingType, MAPPING_TYPE_EQUIDISTANT, 9e7f3c10,17ff,11eb,8b6f,08,00,20,0c,9a,66);
  50. DEFINE_UUID(MappingType, MAPPING_TYPE_EQUISOLID, 9e7f3c11,17ff,11eb,8b6f,08,00,20,0c,9a,66);
  51. DEFINE_UUID(MappingType, MAPPING_TYPE_ORTHOGRAPHIC, 9e7f3c12,17ff,11eb,8b6f,08,00,20,0c,9a,66);
  52. DEFINE_UUID(MappingType, MAPPING_TYPE_STEREOGRAPHIC, 9e7f3c13,17ff,11eb,8b6f,08,00,20,0c,9a,66);
  53. /**
  54. * Adds accessors for sync sensor calibration data.
  55. * - Ext::ISyncSensorCalibrationData : Accesses the sync sensor calibration data.
  56. *
  57. * @defgroup ArgusExtSyncSensorCalibrationData Ext::SyncSensorCalibrationData
  58. * @ingroup ArgusExtensions
  59. */
  60. DEFINE_UUID(ExtensionName, EXT_SYNC_SENSOR_CALIBRATION_DATA, 10845a70,d52f,11ea,8b6e,08,00,20,0c,9a,66);
  61. namespace Ext
  62. {
  63. /**
  64. * @class ISyncSensorCalibrationData
  65. *
  66. * Interface used to access sync sensor calibration data.
  67. *
  68. * @ingroup ArgusCameraDevice ArgusExtSyncSensorCalibrationData
  69. */
  70. DEFINE_UUID(InterfaceID, IID_SYNC_SENSOR_CALIBRATION_DATA, 5925f360,d52f,11ea,8b6e,08,00,20,0c,9a,66);
  71. class ISyncSensorCalibrationData : public Interface
  72. {
  73. public:
  74. static const InterfaceID& id() { return IID_SYNC_SENSOR_CALIBRATION_DATA; }
  75. /**
  76. * Returns the sync sensor module id in the provided memory location.
  77. * The maximum supported length of sync sensor id string is 32.
  78. * @param [in,out] syncSensorId Pointer for getting the sync sensor id string associated
  79. * with sensor.
  80. * @param [in] size The size of the syncSensorId.
  81. */
  82. virtual Status getSyncSensorModuleId(void* syncSensorId, size_t size) const = 0;
  83. /**
  84. * Returns the size of the image in pixels.
  85. */
  86. virtual Size2D<uint32_t> getImageSizeInPixels() const = 0;
  87. /**
  88. * Returns the focal length fx and fy from intrinsic parameters.
  89. */
  90. virtual Point2D<float> getFocalLength() const = 0;
  91. /**
  92. * Returns the skew from intrinsic parameters.
  93. */
  94. virtual float getSkew() const = 0;
  95. /**
  96. * Returns the principal point (optical center) x and y from intrinsic parameters.
  97. */
  98. virtual Point2D<float> getPrincipalPoint() const = 0;
  99. /**
  100. * Returns the lens distortion type as per the model being used.
  101. */
  102. virtual DistortionType getLensDistortionType() const = 0;
  103. /**
  104. * Returns the mapping type in case of fisheye distortion.
  105. */
  106. virtual MappingType getFisheyeMappingType() const = 0;
  107. /**
  108. * Returns the radial coefficients count in case of polynomial or fisheye distortion.
  109. *
  110. * @param[in] distortionType The lens distortion type.
  111. */
  112. virtual uint32_t getRadialCoeffsCount(const DistortionType& distortionType) const = 0;
  113. /**
  114. * Returns the radial coefficients vector as per distortion type and
  115. * size of the vector is given by getRadialCoeffsCount().
  116. *
  117. * @param[out] k The radial coefficient vector from distortion properties.
  118. *
  119. * @param[in] distortionType The lens distortion type.
  120. */
  121. virtual Status getRadialCoeffs(std::vector<float>* k,
  122. const DistortionType& distortionType) const = 0;
  123. /**
  124. * Returns the tangential coefficients count in case of polynomial distortion.
  125. */
  126. virtual uint32_t getTangentialCoeffsCount() const = 0;
  127. /**
  128. * Returns the tangential coefficients in case of polynomial distortion and
  129. * size of the vector is given by getTangentialCoeffsCount().
  130. *
  131. * @param[out] p The tangential coefficient vector from distortion properties.
  132. */
  133. virtual Status getTangentialCoeffs(std::vector<float>* p) const = 0;
  134. /**
  135. * Returns the rotation parameter expressed in Rodrigues notation from extrinsic parameters.
  136. * angle = sqrt(rx^2+ry^2+rz^2).
  137. * unit axis = [rx,ry,rz]/angle.
  138. */
  139. virtual Point3D<float> getRotationParams() const = 0;
  140. /**
  141. * Returns the translation parameters in x, y and z co-ordinates with respect to a
  142. * reference point from extrinsic params.
  143. */
  144. virtual Point3D<float> getTranslationParams() const = 0;
  145. /**
  146. * Returns the serial number of the sensor module in the provided memory location.
  147. */
  148. virtual Status getModuleSerialNumber(void * serialNumber, size_t size) const = 0;
  149. /**
  150. * Returns whether IMU sensor is present or not.
  151. */
  152. virtual bool isImuSensorAvailable() const = 0;
  153. /**
  154. * Returns the linear acceleration bias for all three axes x, y and z of the IMU device.
  155. */
  156. virtual Point3D<float> getLinearAccBias() const = 0;
  157. /**
  158. * Returns the angular velocity bias for all three axes x, y and z of the IMU device.
  159. */
  160. virtual Point3D<float> getAngularVelocityBias() const = 0;
  161. /**
  162. * Returns the gravity acceleration for all three axes x, y and z of the IMU device.
  163. */
  164. virtual Point3D<float> getGravityAcc() const = 0;
  165. /**
  166. * Returns the IMU rotation parameter expressed in Rodrigues notation from extrinsic parameters.
  167. * angle = sqrt(rx^2+ry^2+rz^2).
  168. * unit axis = [rx,ry,rz]/angle.
  169. */
  170. virtual Point3D<float> getImuRotationParams() const = 0;
  171. /**
  172. * Returns the IMU translation parameters in x, y and z co-ordinates with respect to a
  173. * reference point from extrinsic params.
  174. */
  175. virtual Point3D<float> getImuTranslationParams() const = 0;
  176. /**
  177. * Returns the update rate
  178. */
  179. virtual float getUpdateRate() const = 0;
  180. /**
  181. * Returns the linear acceleration noise density
  182. */
  183. virtual float getLinearAccNoiseDensity() const = 0;
  184. /**
  185. * Returns the linear acceleration random walk
  186. */
  187. virtual float getLinearAccRandomWalk() const = 0;
  188. /**
  189. * Returns the angular velocity noise density
  190. */
  191. virtual float getAngularVelNoiseDensity() const = 0;
  192. /**
  193. * Returns the angular velocity random walk
  194. */
  195. virtual float getAngularVelRandomWalk() const = 0;
  196. protected:
  197. ~ISyncSensorCalibrationData() {}
  198. };
  199. } // namespace Ext
  200. } // namespace Argus
  201. #endif // _ARGUS_SYNC_SENSOR_CALIBRATION_DATA_H