Skip to content

Commit

Permalink
Fix GPSFix sync unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreed committed Nov 21, 2019
1 parent 1dbc6e3 commit 0ca158c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Binary file not shown.
Binary file removed novatel_gps_driver/test/gpgga-gprmc-bestpos.pcap
Binary file not shown.
12 changes: 10 additions & 2 deletions novatel_gps_driver/test/novatel_gps_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ class NovatelGpsTestSuite : public ::testing::Test, public rclcpp::Node
TEST_F(NovatelGpsTestSuite, testGpsFixParsing)
{
novatel_gps_driver::NovatelGps gps(*this);
gps.wait_for_sync_ = true;

std::string path = ament_index_cpp::get_package_prefix("novatel_gps_driver");
ASSERT_TRUE(gps.Connect(path + "/test/gpgga-gprmc-bestpos.pcap", novatel_gps_driver::NovatelGps::PCAP));
ASSERT_TRUE(gps.Connect(path + "/test/bestpos-bestvel-psrdop2-sync.pcap",
novatel_gps_driver::NovatelGps::PCAP));

std::vector<gps_msgs::msg::GPSFix::UniquePtr> fix_messages;

Expand All @@ -64,7 +66,13 @@ TEST_F(NovatelGpsTestSuite, testGpsFixParsing)
std::back_inserter(fix_messages));
}

ASSERT_EQ(40, fix_messages.size());
ASSERT_EQ(22, fix_messages.size());

EXPECT_DOUBLE_EQ(fix_messages.front()->latitude, 29.443917634921949);
EXPECT_DOUBLE_EQ(fix_messages.front()->longitude, -98.614755510637181);
EXPECT_DOUBLE_EQ(fix_messages.front()->speed, 0.041456376659522925);
EXPECT_DOUBLE_EQ(fix_messages.front()->track, 135.51629763185957);
EXPECT_DOUBLE_EQ(fix_messages.front()->gdop, 1.9980000257492065);
}

TEST_F(NovatelGpsTestSuite, testCorrImuDataParsing)
Expand Down

0 comments on commit 0ca158c

Please sign in to comment.