13
13
// limitations under the License.
14
14
15
15
#include " lanelet2_extension/utility/query.hpp"
16
- #include " tier4_autoware_utils/math/normalization.hpp"
17
16
18
17
#include < gtest/gtest.h>
19
18
#include < math.h>
@@ -25,51 +24,6 @@ using lanelet::Point3d;
25
24
using lanelet::Points3d;
26
25
using lanelet::utils::getId;
27
26
28
- // Copyright 2020 Tier IV, Inc.
29
- //
30
- // Licensed under the Apache License, Version 2.0 (the "License");
31
- // you may not use this file except in compliance with the License.
32
- // You may obtain a copy of the License at
33
- //
34
- // http://www.apache.org/licenses/LICENSE-2.0
35
- //
36
- // Unless required by applicable law or agreed to in writing, software
37
- // distributed under the License is distributed on an "AS IS" BASIS,
38
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
- // See the License for the specific language governing permissions and
40
- // limitations under the License.
41
-
42
- TEST (normalizedAngleDifference, getAngleDifference)
43
- {
44
- using lanelet::utils::getAngleDifference;
45
-
46
- constexpr double eps = 0.1 ;
47
- constexpr double pi = M_PI;
48
- constexpr double pi2 = 2.0 *M_PI;
49
- // case normal
50
- {
51
- // abs diff
52
- EXPECT_FLOAT_EQ (getAngleDifference (-pi , 0 ), pi );
53
- // abs diff
54
- EXPECT_FLOAT_EQ (getAngleDifference (pi , 0 ), pi );
55
- }
56
- // case inverse angle
57
- {
58
- // return normalized angle diff
59
- EXPECT_FLOAT_EQ (getAngleDifference (-pi - eps, pi ), eps);
60
- // return 0 if same direction
61
- EXPECT_FLOAT_EQ (getAngleDifference (-pi , pi ), 0 );
62
- }
63
- // case more than 2PI angle
64
- {
65
- // return normalized angle diff
66
- EXPECT_FLOAT_EQ (getAngleDifference (-pi2 - eps, pi2), eps);
67
- // return pi if invert direction
68
- EXPECT_FLOAT_EQ (getAngleDifference (-pi2, pi ), pi );
69
- }
70
- }
71
-
72
-
73
27
class TestSuite : public ::testing::Test
74
28
{
75
29
public:
0 commit comments