Getting and saving the bboxIds


I need to get the bboxIds and I have tried to get them by using the annotor example for them and then trying to save it. Here is the code I tried it with

with rep.trigger.on_frame(num_frames=30000) as trigger:
while trigger:

bbox_2d_loose = rep.AnnotatorRegistry.annotate("bounding_box_2d_loose")
bbox_2d_tight = rep.AnnotatorRegistry.get_annotator("bounding_box_2d_tight")
bbox_3d = rep.AnnotatorRegistry.get_annotator("bounding_box_3d")

data_folder_path = "/home/sdtc-develop/francesco/dataset_6d_pose_estimation/isaac_source_data/writing_sem_test"
 data = bbox_2d_loose.get_data()
 data1 = bbox_2d_tight.get_data()
 data2 = bbox_3d.get_data()
 data = data1[data1]

 data_name = f"semantic_segmentation_single_{i}.txt"
 data_save_path = os.path.join(data_folder_path, data_name)
 np.savetxt(data_save_path, data)

I am using isaac sim and replicator to greate a data set with the basic writer
and now I have troubles saving the bboxIds. It says that the data generated by this script is empty, 0 dimensional array, while the images are generated and saved correctly.