Ocean
Loading...
Searching...
No Matches
TestGravityTracker3DOF.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TEST_TESTDEVICES_TEST_GRAVITY_TRACKER_3DOF_H
9#define META_OCEAN_TEST_TESTDEVICES_TEST_GRAVITY_TRACKER_3DOF_H
10
12
14
15#include "ocean/math/Vector3.h"
16
18
19namespace Ocean
20{
21
22namespace Test
23{
24
25namespace TestDevices
26{
27
28/**
29 * This class implements tests for the GravityTracker3DOF class.
30 * @ingroup testdevices
31 */
32class OCEAN_TEST_DEVICES_EXPORT TestGravityTracker3DOF
33{
34 public:
35
36 /**
37 * Invokes all tests.
38 * @param testDuration Number of seconds for each test, with range (0, infinity)
39 * @param selector The selector defining which tests will be executed
40 * @return True, if succeeded
41 */
42 static bool test(const double testDuration, const TestSelector& selector);
43
44 /**
45 * Tests the sample() function with random measurements and all interpolation strategies.
46 * @param testDuration Number of seconds for each test, with range (0, infinity)
47 * @return True, if succeeded
48 */
49 static bool testSampleInterpolation(const double testDuration);
50
51 protected:
52
53 /**
54 * Computes the expected interpolated gravity vector for a given query timestamp.
55 * Uses spherical linear interpolation (slerp) between the two bounding samples.
56 * @param queryTime The query timestamp
57 * @param timestamps The sample timestamps (must be sorted)
58 * @param gravities The gravity vectors (unit vectors)
59 * @return The expected interpolated gravity vector
60 */
61 static Vector3 expectedInterpolatedGravity(const double queryTime, const Timestamps& timestamps, const Vectors3& gravities);
62};
63
64} // namespace TestDevices
65
66} // namespace Test
67
68} // namespace Ocean
69
70#endif // META_OCEAN_TEST_TESTDEVICES_TEST_GRAVITY_TRACKER_3DOF_H
This class implements tests for the GravityTracker3DOF class.
Definition TestGravityTracker3DOF.h:33
static bool test(const double testDuration, const TestSelector &selector)
Invokes all tests.
static Vector3 expectedInterpolatedGravity(const double queryTime, const Timestamps &timestamps, const Vectors3 &gravities)
Computes the expected interpolated gravity vector for a given query timestamp.
static bool testSampleInterpolation(const double testDuration)
Tests the sample() function with random measurements and all interpolation strategies.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
std::vector< Timestamp > Timestamps
Definition of a vector holding Timestamp objects.
Definition Timestamp.h:54
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition Vector3.h:65
The namespace covering the entire Ocean framework.
Definition Accessor.h:15