19 #include <gtest/gtest.h> 36 pcl::PointXYZRGB p_rgb;
37 for(
int i=0; i<nsamples; i++)
39 p_rgb.x = dim * (double)std::rand() / (double)RAND_MAX;
40 p_rgb.y = dim * (double)std::rand() / (double)RAND_MAX;
41 p_rgb.z = dim * (double)std::rand() / (double)RAND_MAX;
45 cloud->push_back(p_rgb);
54 PointCloudRGB::Ptr source_cloud =
cloudRGB;
55 PointCloudRGB::Ptr target_cloud =
cloudRGB;
59 std::shared_ptr<StateMachine> FSM = std::make_shared<StateMachine>(source_cloud, target_cloud, nh);
65 catch(std::exception& e)
67 ADD_FAILURE() <<
"Not in IdleState";
75 catch(std::exception& e)
77 ADD_FAILURE() <<
"Transit to PublishState failed";
82 int main(
int argc,
char **argv)
84 ros::init(argc, argv,
"test_state_machine");
85 testing::InitGoogleTest(&argc, argv);
86 return RUN_ALL_TESTS();
pcl::PointCloud< pcl::PointXYZRGB > PointCloudRGB
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
static bool isValidCloud(PointCloudXYZ::Ptr cloud)
Check whether cloud contains data and is not empty.
TEST_F(TestStateMachine, testEvents)
pcl::PointCloud< pcl::PointXYZRGB > PointCloudRGB
PointCloudRGB::Ptr cloudRGB
void cubePointCloud(PointCloudRGB::Ptr cloud, float dim, int nsamples)