Skip to content

Commit

Permalink
Added msgs::Set test for custom surface
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya <aditya050995@gmail.com>
  • Loading branch information
adityapande-1995 committed Jul 21, 2022
1 parent cf1715d commit 598d30d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Utility_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,27 @@ TEST(MsgsTest, SetSphericalCoordinates)
EXPECT_DOUBLE_EQ(2.3, msgMoon.longitude_deg());
EXPECT_DOUBLE_EQ(3.4, msgMoon.elevation());
EXPECT_DOUBLE_EQ(0.5, msgMoon.heading_deg());

// For a custom surface.
msgs::SphericalCoordinates msgCustom;
auto sc = math::SphericalCoordinates(
math::SphericalCoordinates::CUSTOM_SURFACE,
12000, 10000);
sc.SetLatitudeReference(GZ_DTOR(1.9));
sc.SetLongitudeReference(GZ_DTOR(2.8));
sc.SetElevationReference(3.7);
sc.SetHeadingOffset(GZ_DTOR(0.6));

msgs::Set(&msgCustom, sc);

EXPECT_EQ(msgs::SphericalCoordinates::CUSTOM_SURFACE,
msgCustom.surface_model());
EXPECT_DOUBLE_EQ(1.9, msgCustom.latitude_deg());
EXPECT_DOUBLE_EQ(2.8, msgCustom.longitude_deg());
EXPECT_DOUBLE_EQ(3.7, msgCustom.elevation());
EXPECT_DOUBLE_EQ(0.6, msgCustom.heading_deg());
EXPECT_DOUBLE_EQ(12000, msgCustom.surface_axis_equatorial());
EXPECT_DOUBLE_EQ(10000, msgCustom.surface_axis_polar());
}

/////////////////////////////////////////////////
Expand Down

0 comments on commit 598d30d

Please sign in to comment.