Libargus API
Libargus Camera API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SyncSensorCalibrationData.h
Go to the documentation of this file.
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 /**
30  * @file
31  * <b>Libargus Extension: Sync Sensor Calibration Data API</b>
32  *
33  * @b Description: This file defines the SyncSensorCalibrationData extension.
34  */
35 
36 #ifndef _ARGUS_SYNC_SENSOR_CALIBRATION_DATA_H
37 #define _ARGUS_SYNC_SENSOR_CALIBRATION_DATA_H
38 
39 namespace Argus
40 {
41 
42 /**
43  * The DistortionType of a sync sensor defines the type of distortion model.
44  */
45 DEFINE_NAMED_UUID_CLASS(DistortionType);
46 DEFINE_UUID(DistortionType, DISTORTION_TYPE_POLYNOMIAL, 23e59580,17ff,11eb,8b6f,08,00,20,0c,9a,66);
47 DEFINE_UUID(DistortionType, DISTORTION_TYPE_FISHEYE, 23e59581,17ff,11eb,8b6f,08,00,20,0c,9a,66);
48 DEFINE_UUID(DistortionType, DISTORTION_TYPE_OMINI_DIRECTIONAL, 23e5bc90,17ff,11eb,8b6f,08,00,20,0c,9a,66);
49 
50 /**
51  * The MappingType of a sync sensor defines the type of mapping used for fisheye distortion model.
52  */
53 DEFINE_NAMED_UUID_CLASS(MappingType);
54 DEFINE_UUID(MappingType, MAPPING_TYPE_EQUIDISTANT, 9e7f3c10,17ff,11eb,8b6f,08,00,20,0c,9a,66);
55 DEFINE_UUID(MappingType, MAPPING_TYPE_EQUISOLID, 9e7f3c11,17ff,11eb,8b6f,08,00,20,0c,9a,66);
56 DEFINE_UUID(MappingType, MAPPING_TYPE_ORTHOGRAPHIC, 9e7f3c12,17ff,11eb,8b6f,08,00,20,0c,9a,66);
57 DEFINE_UUID(MappingType, MAPPING_TYPE_STEREOGRAPHIC, 9e7f3c13,17ff,11eb,8b6f,08,00,20,0c,9a,66);
58 
59 /**
60  * Adds accessors for sync sensor calibration data.
61  * - Ext::ISyncSensorCalibrationData : Accesses the sync sensor calibration data.
62  *
63  * @defgroup ArgusExtSyncSensorCalibrationData Ext::SyncSensorCalibrationData
64  * @ingroup ArgusExtensions
65  */
66 DEFINE_UUID(ExtensionName, EXT_SYNC_SENSOR_CALIBRATION_DATA, 10845a70,d52f,11ea,8b6e,08,00,20,0c,9a,66);
67 namespace Ext
68 {
69 /**
70  * @class ISyncSensorCalibrationData
71  *
72  * Interface used to access sync sensor calibration data.
73  *
74  * @ingroup ArgusCameraDevice ArgusExtSyncSensorCalibrationData
75  */
76 DEFINE_UUID(InterfaceID, IID_SYNC_SENSOR_CALIBRATION_DATA, 5925f360,d52f,11ea,8b6e,08,00,20,0c,9a,66);
78 {
79 public:
80  static const InterfaceID& id() { return IID_SYNC_SENSOR_CALIBRATION_DATA; }
81 
82  /**
83  * Returns the sync sensor module id in the provided memory location.
84  * The maximum supported length of sync sensor id string is 32.
85  * @param [in,out] syncSensorId Pointer for getting the sync sensor id string associated
86  * with sensor.
87  * @param [in] size The size of the syncSensorId.
88  */
89  virtual Status getSyncSensorModuleId(void* syncSensorId, size_t size) const = 0;
90 
91  /**
92  * Returns the size of the image in pixels.
93  */
94  virtual Size2D<uint32_t> getImageSizeInPixels() const = 0;
95 
96  /**
97  * Returns the focal length fx and fy from intrinsic parameters.
98  */
99  virtual Point2D<float> getFocalLength() const = 0;
100 
101  /**
102  * Returns the skew from intrinsic parameters.
103  */
104  virtual float getSkew() const = 0;
105 
106  /**
107  * Returns the principal point (optical center) x and y from intrinsic parameters.
108  */
109  virtual Point2D<float> getPrincipalPoint() const = 0;
110 
111  /**
112  * Returns the lens distortion type as per the model being used.
113  */
114  virtual DistortionType getLensDistortionType() const = 0;
115 
116  /**
117  * Returns the mapping type in case of fisheye distortion.
118  */
119  virtual MappingType getFisheyeMappingType() const = 0;
120 
121  /**
122  * Returns the radial coefficients count in case of polynomial or fisheye distortion.
123  *
124  * @param[in] distortionType The lens distortion type.
125  */
126  virtual uint32_t getRadialCoeffsCount(const DistortionType& distortionType) const = 0;
127 
128  /**
129  * Returns the radial coefficients vector as per distortion type and
130  * size of the vector is given by getRadialCoeffsCount().
131  *
132  * @param[out] k The radial coefficient vector from distortion properties.
133  *
134  * @param[in] distortionType The lens distortion type.
135  */
136  virtual Status getRadialCoeffs(std::vector<float>* k,
137  const DistortionType& distortionType) const = 0;
138 
139  /**
140  * Returns the tangential coefficients count in case of polynomial distortion.
141  */
142  virtual uint32_t getTangentialCoeffsCount() const = 0;
143 
144  /**
145  * Returns the tangential coefficients in case of polynomial distortion and
146  * size of the vector is given by getTangentialCoeffsCount().
147  *
148  * @param[out] p The tangential coefficient vector from distortion properties.
149  */
150  virtual Status getTangentialCoeffs(std::vector<float>* p) const = 0;
151 
152  /**
153  * Returns the rotation parameter expressed in Rodrigues notation from extrinsic parameters.
154  * angle = sqrt(rx^2+ry^2+rz^2).
155  * unit axis = [rx,ry,rz]/angle.
156  */
157  virtual Point3D<float> getRotationParams() const = 0;
158 
159  /**
160  * Returns the translation parameters in x, y and z co-ordinates with respect to a
161  * reference point from extrinsic params.
162  */
163  virtual Point3D<float> getTranslationParams() const = 0;
164 
165  /**
166  * Returns the serial number of the sensor module in the provided memory location.
167  */
168  virtual Status getModuleSerialNumber(void * serialNumber, size_t size) const = 0;
169 
170  /**
171  * Returns whether IMU sensor is present or not.
172  */
173  virtual bool isImuSensorAvailable() const = 0;
174 
175  /**
176  * Returns the linear acceleration bias for all three axes x, y and z of the IMU device.
177  */
178  virtual Point3D<float> getLinearAccBias() const = 0;
179 
180  /**
181  * Returns the angular velocity bias for all three axes x, y and z of the IMU device.
182  */
183  virtual Point3D<float> getAngularVelocityBias() const = 0;
184 
185  /**
186  * Returns the gravity acceleration for all three axes x, y and z of the IMU device.
187  */
188  virtual Point3D<float> getGravityAcc() const = 0;
189 
190  /**
191  * Returns the IMU rotation parameter expressed in Rodrigues notation from extrinsic parameters.
192  * angle = sqrt(rx^2+ry^2+rz^2).
193  * unit axis = [rx,ry,rz]/angle.
194  */
195  virtual Point3D<float> getImuRotationParams() const = 0;
196 
197  /**
198  * Returns the IMU translation parameters in x, y and z co-ordinates with respect to a
199  * reference point from extrinsic params.
200  */
201  virtual Point3D<float> getImuTranslationParams() const = 0;
202 
203  /**
204  * Returns the update rate
205  */
206  virtual float getUpdateRate() const = 0;
207 
208  /**
209  * Returns the linear acceleration noise density
210  */
211  virtual float getLinearAccNoiseDensity() const = 0;
212 
213  /**
214  * Returns the linear acceleration random walk
215  */
216  virtual float getLinearAccRandomWalk() const = 0;
217 
218  /**
219  * Returns the angular velocity noise density
220  */
221  virtual float getAngularVelNoiseDensity() const = 0;
222 
223  /**
224  * Returns the angular velocity random walk
225  */
226  virtual float getAngularVelRandomWalk() const = 0;
227 
228 protected:
230 
231 };
232 
233 } // namespace Ext
234 
235 } // namespace Argus
236 
237 #endif // _ARGUS_SYNC_SENSOR_CALIBRATION_DATA_H