if __name__ == '__main__': rospy.init_node('capture_node') models = [\ 'beer', 'bowl', 'create', 'disk_part', 'hammer', 'plastic_cup', 'soda_can'] # Disable gravity and delete the ground plane initial_setup() labeled_features = [] for model_name in models: spawn_model(model_name) for i in range(5): # make five attempts to get a valid a point cloud then give up sample_was_good = False try_count = 0 while not sample_was_good and try_count < 5: sample_cloud = capture_sample() sample_cloud_arr = ros_to_pcl(sample_cloud).to_array() # Check for invalid clouds. if sample_cloud_arr.shape[0] == 0:
'soap', 'soap2'] """ models = [\ 'sticky_notes', 'book', 'snacks', 'biscuits', 'eraser', 'soap2', 'soap', 'glue'] """ # Disable gravity and delete the ground plane initial_setup() labeled_features = [] for model_name in models: print("hey there") print(model_name) spawn_model(model_name) for i in range(10): # make five attempts to get a valid a point cloud then give up sample_was_good = False try_count = 0 while not sample_was_good and try_count < 5: sample_cloud = capture_sample() sample_cloud_arr = ros_to_pcl(sample_cloud).to_array()