Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "cartographer/mapping/submaps.h"
00018
00019 #include <cmath>
00020
00021 #include "gtest/gtest.h"
00022
00023 namespace cartographer {
00024 namespace mapping {
00025 namespace {
00026
00027
00028
00029 inline float Expit(float log_odds) {
00030 const float exp_log_odds = std::exp(log_odds);
00031 return exp_log_odds / (1.f + exp_log_odds);
00032 }
00033
00034 TEST(SubmapsTest, LogOddsConversions) {
00035 EXPECT_NEAR(Expit(Logit(kMinProbability)), kMinProbability, 1e-6);
00036 EXPECT_NEAR(Expit(Logit(kMaxProbability)), kMaxProbability, 1e-6);
00037 EXPECT_NEAR(Expit(Logit(0.5)), 0.5, 1e-6);
00038 }
00039
00040 }
00041 }
00042 }