Ocean
Loading...
Searching...
No Matches
TestTracker6DOF.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_TRACKER_6DOF_H
9#define META_OCEAN_TEST_TESTDEVICES_TEST_TRACKER_6DOF_H
10
12
14
16#include "ocean/math/Vector3.h"
17
19
20namespace Ocean
21{
22
23namespace Test
24{
25
26namespace TestDevices
27{
28
29/**
30 * This class implements tests for the Tracker6DOF class.
31 * @ingroup testdevices
32 */
33class OCEAN_TEST_DEVICES_EXPORT TestTracker6DOF
34{
35 public:
36
37 /**
38 * Invokes all tests.
39 * @param testDuration Number of seconds for each test, with range (0, infinity)
40 * @param selector The selector defining which tests will be executed
41 * @return True, if succeeded
42 */
43 static bool test(const double testDuration, const TestSelector& selector);
44
45 /**
46 * Tests the sample() function with random measurements and all interpolation strategies.
47 * @param testDuration Number of seconds for each test, with range (0, infinity)
48 * @return True, if succeeded
49 */
50 static bool testSampleInterpolation(const double testDuration);
51
52 protected:
53
54 /**
55 * Computes the expected interpolated orientation for a given query timestamp.
56 * @param queryTime The query timestamp
57 * @param timestamps The sample timestamps (must be sorted)
58 * @param orientations The orientation quaternions
59 * @return The expected interpolated orientation
60 */
61 static Quaternion expectedInterpolatedOrientation(const double queryTime, const Timestamps& timestamps, const Quaternions& orientations);
62
63 /**
64 * Computes the expected interpolated position for a given query timestamp.
65 * @param queryTime The query timestamp
66 * @param timestamps The sample timestamps (must be sorted)
67 * @param positions The position vectors
68 * @return The expected interpolated position
69 */
70 static Vector3 expectedInterpolatedPosition(const double queryTime, const Timestamps& timestamps, const Vectors3& positions);
71};
72
73} // namespace TestDevices
74
75} // namespace Test
76
77} // namespace Ocean
78
79#endif // META_OCEAN_TEST_TESTDEVICES_TEST_TRACKER_6DOF_H
This class implements tests for the Tracker6DOF class.
Definition TestTracker6DOF.h:34
static bool test(const double testDuration, const TestSelector &selector)
Invokes all tests.
static bool testSampleInterpolation(const double testDuration)
Tests the sample() function with random measurements and all interpolation strategies.
static Vector3 expectedInterpolatedPosition(const double queryTime, const Timestamps &timestamps, const Vectors3 &positions)
Computes the expected interpolated position for a given query timestamp.
static Quaternion expectedInterpolatedOrientation(const double queryTime, const Timestamps &timestamps, const Quaternions &orientations)
Computes the expected interpolated orientation for a given query timestamp.
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< Quaternion > Quaternions
Definition of a vector holding quaternion objects.
Definition Quaternion.h:69
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