32 #include <gtest/gtest.h> 37 TEST(NovatelGpsTestSuite, testGpsFixParsing)
44 std::vector<gps_common::GPSFixPtr> fix_messages;
48 std::vector<gps_common::GPSFixPtr> tmp_messages;
50 fix_messages.insert(fix_messages.end(), tmp_messages.begin(), tmp_messages.end());
53 ASSERT_EQ(40, fix_messages.size());
56 TEST(NovatelGpsTestSuite, testCorrImuDataParsing)
63 std::vector<novatel_gps_msgs::NovatelCorrectedImuDataPtr> imu_messages;
67 std::vector<novatel_gps_msgs::NovatelCorrectedImuDataPtr> tmp_messages;
69 imu_messages.insert(imu_messages.end(), tmp_messages.begin(), tmp_messages.end());
72 ASSERT_EQ(26, imu_messages.size());
74 novatel_gps_msgs::NovatelCorrectedImuDataPtr
msg = imu_messages.front();
75 EXPECT_EQ(1820, msg->gps_week_num);
76 EXPECT_DOUBLE_EQ(160205.899999999994, msg->gps_seconds);
77 EXPECT_DOUBLE_EQ(0.0000039572689929003956, msg->pitch_rate);
78 EXPECT_DOUBLE_EQ(0.0000028926313702935847, msg->roll_rate);
79 EXPECT_DOUBLE_EQ(0.0000027924848999730557, msg->yaw_rate);
80 EXPECT_DOUBLE_EQ(-0.00062560456243879322, msg->lateral_acceleration);
81 EXPECT_DOUBLE_EQ(0.00034037959880710289, msg->longitudinal_acceleration);
82 EXPECT_DOUBLE_EQ(-0.0000051257464089797534, msg->vertical_acceleration);
85 int main(
int argc,
char **argv)
90 testing::InitGoogleTest(&argc, argv);
92 return RUN_ALL_TESTS();
void GetFixMessages(std::vector< gps_common::GPSFixPtr > &fix_messages)
Provides any GPSFix messages that have been generated since the last time this was called...
TEST(NovatelGpsTestSuite, testGpsFixParsing)
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void GetNovatelCorrectedImuData(std::vector< novatel_gps_msgs::NovatelCorrectedImuDataPtr > &imu_messages)
Provides any CORRIMUDATA messages that have been received since the last time this was called...
ReadResult ProcessData()
Processes any data that has been received from the device since the last time this message was called...
ROSLIB_DECL std::string getPath(const std::string &package_name)
bool Connect(const std::string &device, ConnectionType connection)