AprilTags - Weber-State-UAV-Program/Documentation-2024-2025 GitHub Wiki

For detection of the four Base Station mounted AprilTags in this project we are using the apriltag_ros ROS2 package. Information on this package can be found here

image

The offsets for each respective tag used in the system are handled by the transform broadcaster

    //OFFSETS ARE IN ROS2 ENU FRAME
    offset_tag_1_ = Eigen::Vector3d(0.71755, 0.0, -0.42545);
    offset_tag_2_ = Eigen::Vector3d(-0.7239, 0.0, -0.42545);
    offset_tag_3_ = Eigen::Vector3d(0.0, 0.0, 0.0); //possibly 0.003175 for y offset
    offset_tag_4_ = Eigen::Vector3d(0.149225, 0.0, 0.0);

The apriltag detection node accepts a stream of images coming in on the /image_rect topic (this can be remapped). It then publishes the tag detections to the /detections topic with the actual poses being published directly to the transform tree (/tf topic)

This node does require some configuration for use. These are the configuration parameters used.


/**:
    ros__parameters:
        image_transport: raw    # image format
        family: 36h11           # tag family name
        size: 0.1778          # tag edge size in meter - 0.195 for usb cam tags on A4 paper 0.1778 for actual size (sim)
        max_hamming: 0          # maximum allowed hamming distance (corrected bits)

        # see "apriltag.h" 'struct apriltag_detector' for more documentation on these optional parameters
        detector:
            threads: 2          # number of threads
            decimate: 2.0      # decimate resolution for quad detection
            blur: 0.0           # sigma of Gaussian blur for quad detection
            refine: True        # snap to strong gradients
            sharpening: 0.20    # sharpening of decoded images
            debug: False        # write additional debugging images to current working directory

        tag:
            ids: [3, 4, 1, 2]
            frames: [tag36h11:3, tag36h11:4, tag36h11:1, tag36h11:2]
            sizes: [0.06, 0.108, 0.275, 0.275]