Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Software Development
  3. AprilTags do not work in voxl-vision-px4

AprilTags do not work in voxl-vision-px4

Scheduled Pinned Locked Moved Software Development
5 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rapit
    Contributor
    wrote on last edited by
    #1

    Hi,
    I tried the inbuild AprilTag feature today but I can't get it to work and I have no idea what is going wrong. I strictly followed the instructions from the walkthrough video / text.

    The related config is very basic:

        "en_apriltag_fixed_frame": true,
        "fixed_apriltags": [
            {
                "tag_id": 1,
                "R_tag_to_fixed": [
                    [0, -1, 0],
                    [1, 0, 0],
                    [0, 0, 1]
                ],
                "T_tag_wrt_fixed": [0, 0, 0]
            }
        ],
        "en_transform_mavlink_pos_setpoints_from_fixed_frame": true,
        "en_fixed_frame_pipe": false,
    
    

    I set the tag-size to 0.16, as each square of the 8x8 tag grid is 2cm. A change of this parameter never had an effect to the detected tag position from voxl-vision-px4, which I find very strange.

    When I run voxl-vision-px4 -p for debug odometry in fixed frame I get lots of out of bounds warnings. A "first-detection" with a followed position "reset" of fixed frame does not happen.

    T_body_wrt_fixed: -0.00  0.00 -0.20  RPY:  0.00  0.00 -0.00
    T_body_wrt_fixed: -0.00  0.00 -0.20  RPY:  0.00  0.00  0.00
    WARNING, apriltag roll/pitch out of bounds
    

    Sometimes, the tag is detected and the position is set to the fixed frame which is way off. This causes voxl-vision-px4 to diverge within a few seconds, even if the drone does not move at all. It crashes in the end of that process and resets the frame.

    When I run voxl-test-vision-lib -a it prints

    ID:  1 hamming: 0 margin:89.98 XYZ:  0.67  0.06  1.85 RPY: -0.51  0.25  0.25 hz: 13.6
    

    which seams reasonable, even if there is a rotation offset (btw. This is in the frame of the camera right? The z-axis point 45 deg downwards away from the drone)

    I recalibrated the tracking camera and reset the config multiple times. Any idea what else could be wrong here? Here is a picture of the setup, it is very similar to your walkthrough video, the voxl is about 1 meter away in y and z directions.

    IMG_20201008_142734546.jpg

    Any suggestions would be greatly appreciated!

    1 Reply Last reply
    0
    • James StrawsonJ Offline
      James StrawsonJ Offline
      James Strawson
      ModalAI Team
      wrote on last edited by
      #2

      Thank you for the very detailed report, that is extremely helpful. You were right to notice the translation did not update when you change the tag size. I found the documentation incorrectly listed the config file in which this parameter exists, it should be set in '/etc/modalai/vio_apriltag_app.xml' instead.

      Sorry for the confusion, I've updated the documentation.

      Link Preview Image
      Page not found

      ModalAI technical documentation for VOXL and VOXL 2 Companion Computers for PX4 and ArduPilot Obstacle Avoidance and GPS-denied navigation, assembled in the USA

      favicon

      ModalAI Technical Docs (docs.modalai.com)

      As a heads up, we will soon have a standalone apriltag detection service which will consolidate the tag-size parameter along with the ids, translations, and rotations into its own config file. This should make the setup process less confusing.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rapit
        Contributor
        wrote on last edited by
        #3

        Thank you, with the correct config file for the tag size, the detected tag positions and rotations in voxl-test-vision-lib -a look quite accurate now!

        Unfortunately, this had no impact on the vio, it is still not detecting any April tag correct and I get lots of:

        ...
        WARNING, apriltag roll/pitch out of bounds
        WARNING, apriltag roll/pitch out of bounds
        

        But maybe this is not AprilTag related, as vio is reporting very high velocities, sometimes without any AprilTag visible:

        ...
        T_body_wrt_local: 1738.20 882.29 453.10  RPY:  0.11 -0.09 -0.38  velocity: 39.93 42.38  3.43
        VIO in failed state, restarting
        

        Most of the time, all values are increasing without any movement until it is in failed state.

        One more thing that comes to my mind, when I stream from the tracking camera (e.g. via the voxl_cam_ros node) it always streams an overexposed image:
        screenshot-2020.10.09-10.52.48.png

        I have to set the exposure parameter down to 0.05 to get a "normal" image. Maybe your vio uses the overexposed images as well leading to strange results.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rapit
          Contributor
          wrote on last edited by
          #4

          Never mind, I updated all packages and reset all configs and it appears to work great. Maybe a misconfiguration somewhere else.

          Thank you!

          1 Reply Last reply
          0
          • James StrawsonJ Offline
            James StrawsonJ Offline
            James Strawson
            ModalAI Team
            wrote on last edited by
            #5

            Glad you got it working, let me know if you have any more questions. Apriltag relocalization is still a fairly new feature with only me and a few other customers really using it extensively so any feedback is appreciated. Thank you!

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            ModalAI
            Categories Recent Tags ModalAI.com Docs
            © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups