2 #include <gtest/gtest.h> 3 #include "sensor_msgs/PointCloud2.h" 4 #include "std_srvs/Trigger.h" 5 #include "boost/filesystem.hpp" 6 #include "leica_scanstation_utils/LeicaUtils.h" 10 TEST(TestNode, testTotalPointCloudPublisher)
12 sensor_msgs::PointCloud2ConstPtr total_cloud_msg;
14 total_cloud_msg = ros::topic::waitForMessage<sensor_msgs::PointCloud2>(
"simulator/cloud");
16 EXPECT_TRUE((total_cloud_msg->row_step*total_cloud_msg->height) != 0);
20 TEST(TestNode, testSaveCloudService)
28 std_srvs::Trigger srv;
33 std::string path = LeicaUtils::getFilePath(
"scan.pcd");
34 ROS_INFO(
"Check for existance %s", path.c_str());
36 ASSERT_TRUE(boost::filesystem::exists(path));
38 else ADD_FAILURE()<<
"Failed to call service";
41 int main(
int argc,
char **argv)
43 ros::init(argc, argv,
"test_laserscan_to_pointcloud");
44 testing::InitGoogleTest(&argc, argv);
45 return RUN_ALL_TESTS();
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
TEST(TestNode, testTotalPointCloudPublisher)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool call(MReq &req, MRes &res)
int main(int argc, char **argv)
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
ROSCPP_DECL bool exists(const std::string &service_name, bool print_failure_reason)