1 /*
2 * Copyright (C) 2020 Alberto Irurueta Carro (alberto@irurueta.com)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package com.irurueta.navigation.inertial.calibration.gyroscope;
17
18 import com.irurueta.navigation.LockedException;
19 import com.irurueta.navigation.inertial.calibration.FrameBodyKinematics;
20
21 import java.util.Collection;
22
23 /**
24 * Interface defining gyroscope calibrators to estimate biases, cross coupling and
25 * scaling factors and g-dependant cross biases.
26 */
27 public interface KnownFrameGyroscopeCalibrator<T extends FrameBodyKinematics,
28 L extends KnownFrameGyroscopeCalibratorListener<?>>
29 extends UnknownBiasGyroscopeCalibrator, GyroscopeCalibrator {
30
31 /**
32 * Gets a collection of body kinematics measurements taken at different
33 * frames (positions, orientations and velocities).
34 * If a single device IMU needs to be calibrated, typically all measurements are
35 * taken at the same position, with zero velocity and multiple orientations.
36 * However, if we just want to calibrate a given IMU model (e.g. obtain
37 * an average and less precise calibration for the IMU of a given phone model),
38 * we could take measurements collected throughout the planet at multiple positions
39 * while the phone remains static (e.g. while charging), hence each measurement
40 * position will change, velocity will remain zero and orientation will be
41 * typically constant at horizontal orientation while the phone remains on a
42 * flat surface.
43 *
44 * @return a collection of body kinematics measurements taken at different
45 * frames (positions, orientations and velocities).
46 */
47 Collection<T> getMeasurements();
48
49 /**
50 * Sets a collection of body kinematics measurements taken at different
51 * frames (positions, orientations and velocities).
52 * If a single device IMU needs to be calibrated, typically all measurements are
53 * taken at the same position, with zero velocity and multiple orientations.
54 * However, if we just want to calibrate the a given IMU model (e.g. obtain
55 * an average and less precise calibration for the IMU of a given phone model),
56 * we could take measurements collected throughout the planet at multiple positions
57 * while the phone remains static (e.g. while charging), hence each measurement
58 * position will change, velocity will remain zero and orientation will be
59 * typically constant at horizontal orientation while the phone remains on a
60 * flat surface.
61 *
62 * @param measurements collection of body kinematics measurements taken at different
63 * frames (positions, orientations and velocities).
64 * @throws LockedException if calibrator is currently running.
65 */
66 void setMeasurements(final Collection<? extends T> measurements) throws LockedException;
67
68 /**
69 * Gets listener to handle events raised by this calibrator.
70 *
71 * @return listener to handle events raised by this calibrator.
72 */
73 L getListener();
74
75 /**
76 * Sets listener to handle events raised by this calibrator.
77 *
78 * @param listener listener to handle events raised by this calibrator.
79 * @throws LockedException if calibrator is currently running.
80 */
81 void setListener(final L listener) throws LockedException;
82 }