本文整理汇总了C++中Orientation::isMagnetic方法的典型用法代码示例。如果您正苦于以下问题:C++ Orientation::isMagnetic方法的具体用法?C++ Orientation::isMagnetic怎么用?C++ Orientation::isMagnetic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orientation
的用法示例。
在下文中一共展示了Orientation::isMagnetic方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Declination
TEST (Orientation, MakeMagnetic) {
VLOG(1) << "===Orientation Declination (Make Magnetic) Test===";
// location and orientation values
double expectedDeclination = 15.95;
Orientation x { 20.0, -15.0, 30.0, false };
Location y { 47.82167, -122.33639 };
Orientation z { 0.0, 0.0, 240.0, false };
VLOG(2) << "Orientation x " << x.pack();
VLOG(2) << "Location y " << y.pack();
VLOG(2) << "Orientation z " << z.pack();
VLOG(2) << "Expected Declination " << expectedDeclination;
EXPECT_FALSE(x.isMagnetic());
EXPECT_TRUE(x.updateDeclination(y));
VLOG(2) << "Declination is " << x.getDeclination() << ", " << z.getDeclination();
EXPECT_TRUE(toleranceEquals(x.getDeclination(), z.getDeclination(), TOL));
Orientation th1 = x.makeMag();
EXPECT_FALSE(x.isMagnetic());
EXPECT_TRUE(th1.isMagnetic());
EXPECT_TRUE(toleranceEquals(th1.heading, x.heading - expectedDeclination, 0.25));
Orientation th2 = th1.makeMag();
EXPECT_TRUE(th2.isMagnetic());
EXPECT_TRUE(toleranceEquals(th1.heading, th2.heading, TOL));
VLOG(2) << "Orientation th1 " << th1.pack();
VLOG(2) << "Orientation th2 " << th2.pack();
}