21 #include <gtest/gtest.h> 23 TEST(CameraInfoTests, test_update_camera_info)
25 sensor_msgs::CameraInfo start;
36 sensor_msgs::CameraInfo end =
39 EXPECT_EQ(start.P[0], end.P[0]);
40 EXPECT_EQ(start.P[2], end.P[2]);
41 EXPECT_EQ(start.P[5], end.P[5]);
42 EXPECT_EQ(start.P[6], end.P[6]);
43 EXPECT_EQ(start.K[0], end.K[0]);
44 EXPECT_EQ(start.K[2], end.K[2]);
45 EXPECT_EQ(start.K[4], end.K[4]);
46 EXPECT_EQ(start.K[5], end.K[5]);
49 TEST(CameraInfoTests, test_extended_camera_info)
56 robot_calibration_msgs::ExtendedCameraInfo eci =
59 ASSERT_EQ(static_cast<size_t>(2), eci.parameters.size());
60 EXPECT_EQ(eci.parameters[0].name,
"z_offset_mm");
61 EXPECT_EQ(eci.parameters[0].value, 2.0);
62 EXPECT_EQ(eci.parameters[1].name,
"z_scaling");
63 EXPECT_EQ(eci.parameters[1].value, 1.1);
66 int main(
int argc,
char** argv)
68 ros::init(argc, argv,
"camera_info_tests");
69 testing::InitGoogleTest(&argc, argv);
70 return RUN_ALL_TESTS();
sensor_msgs::CameraInfo updateCameraInfo(double camera_fx, double camera_fy, double camera_cx, double camera_cy, const sensor_msgs::CameraInfo &info)
Update the camera calibration with the new offsets.
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
robot_calibration_msgs::ExtendedCameraInfo getDepthCameraInfo()
TEST(CameraInfoTests, test_update_camera_info)
bool init(ros::NodeHandle &n)
int main(int argc, char **argv)
Base class for a feature finder.