test_timestamp_outlier_remover.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2018 The urg_stamped Authors
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 
17 #include <gtest/gtest.h>
18 
20 
21 TEST(TimestampOutlierRemoval, RemoveOneOutlier)
22 {
24 
25  ASSERT_EQ(remover.update(ros::Time(10.000)), ros::Time(10.000));
26  ASSERT_EQ(remover.update(ros::Time(10.105)), ros::Time(10.105));
27  ASSERT_EQ(remover.update(ros::Time(10.200)), ros::Time(10.200));
28  ASSERT_EQ(remover.update(ros::Time(10.320)), ros::Time(10.300)); // outlier
29  ASSERT_EQ(remover.update(ros::Time(10.400)), ros::Time(10.400));
30  ASSERT_EQ(remover.update(ros::Time(10.500)), ros::Time(10.500));
31 }
32 
33 TEST(TimestampOutlierRemoval, MoreThanTwoOutlier)
34 {
36 
37  ASSERT_EQ(remover.update(ros::Time(10.000)), ros::Time(10.000));
38  ASSERT_EQ(remover.update(ros::Time(10.105)), ros::Time(10.105));
39  ASSERT_EQ(remover.update(ros::Time(10.200)), ros::Time(10.200));
40  ASSERT_EQ(remover.update(ros::Time(10.320)), ros::Time(10.300)); // outlier
41  ASSERT_EQ(remover.update(ros::Time(10.440)), ros::Time(10.440)); // fix only first outlier
42 }
43 
44 int main(int argc, char **argv)
45 {
46  testing::InitGoogleTest(&argc, argv);
47 
48  return RUN_ALL_TESTS();
49 }
TEST(TimestampOutlierRemoval, RemoveOneOutlier)
ros::Time update(const ros::Time &stamp)
int main(int argc, char **argv)


urg_stamped
Author(s): Atsushi Watanabe
autogenerated on Thu Jun 6 2019 19:55:59