0
$\begingroup$

I'm trying to publish a .bag file for 3D object detection using OpenDR toolkit. I'm new at ROS and I see that they use .txt and .bin files in this PointCloud script to detect the objects in the point cloud with ObjectDetections3D.

I tried changing the topic that the Object3Ddetectiosns script takes information from by changing some of the following lines of code, such as the path to my .bag dataset.

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("-d", "--dataset_path",
                        help="Path to a dataset. If does not exist, nano KITTI dataset will be downloaded there.",
                        type=str, default="KITTI/opendr_nano_kitti")
    parser.add_argument("-ks", "--kitti_subsets_path",
                        help="Path to kitti subsets. Used only if a KITTI dataset is downloaded",
                        type=str,
                        default="../../src/opendr/perception/object_detection_3d/datasets/nano_kitti_subsets")
    parser.add_argument("-o", "--output_point_cloud_topic", help="Topic name to publish the data",
                        type=str, default="/opendr/dataset_point_cloud")
    parser.add_argument("-f", "--fps", help="Data FPS",
                        type=float, default=10)
    args = parser.parse_args(rospy.myargv()[1:])

    dataset_path = args.dataset_path
    kitti_subsets_path = args.kitti_subsets_path
    output_point_cloud_topic = args.output_point_cloud_topic
    data_fps = args.fps

    if not os.path.exists(dataset_path):
        dataset_path = KittiDataset.download_nano_kitti(
            "KITTI", kitti_subsets_path=kitti_subsets_path,
            create_dir=True,
        ).path

    dataset = LabeledPointCloudsDatasetIterator(
        dataset_path + "/training/velodyne_reduced",
        dataset_path + "/training/label_2",
        dataset_path + "/training/calib",
    )

    rospy.init_node('opendr_point_cloud_dataset_node', anonymous=True)

    dataset_node = PointCloudDatasetNode(
        dataset, output_point_cloud_topic=output_point_cloud_topic, data_fps=data_fps
    )

    dataset_node.start()
    rospy.loginfo("Point cloud dataset node started.")
    rospy.spin()

I don't know if is here where i have to change things or is in other site. I think that this code takes various point cloud files and plays them in a determinate frequency undefined so i don't even know if this code is valid for my purpose of changing the point cloud to a bag file so i can detect in my own files instead of what comes by default. Any clarification is welcome. Thank you!

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.