test_pointcloud_to_pcd.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import unittest
00004 import rospy
00005 import roslib.packages
00006 import glob
00007 import time
00008 
00009 class PointCloudToPCD():
00010     def __init__(self):
00011         self.test_data_path = roslib.packages.get_pkg_dir('jsk_pcl_ros_utils') + '/test_data/sample_pcd_*.pcd'
00012         self.time_limit = 360 
00013 
00014     def check_pcd_generate(self):
00015         cnt = 0
00016         while cnt <= self.time_limit:
00017             pcd_files = glob.glob(self.test_data_path)
00018             if pcd_files:
00019                 return True
00020             cnt += 1
00021             time.sleep(1.0)
00022         return False
00023 
00024 class TestPointCloudToPCD(unittest.TestCase):
00025     def test_point_clout_to_pcd(self):
00026         pcd = PointCloudToPCD()
00027         self.assertTrue(pcd.check_pcd_generate())
00028 
00029 if __name__ == "__main__":
00030     import rostest
00031     rospy.init_node("pointcloud_to_pcd_test_py")
00032     rostest.rosrun("jsk_pcl_ros_utils", "test_pointcloud_to_pcd", TestPointCloudToPCD)


jsk_pcl_ros_utils
Author(s): Yohei Kakiuchi
autogenerated on Tue Jul 2 2019 19:40:52