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

ModalAI Forum

  1. ModalAI Support Forum
  2. Ask your questions right here!
  3. AprilTag Localization and landing

AprilTag Localization and landing

Scheduled Pinned Locked Moved Ask your questions right here!
6 Posts 2 Posters 1.6k Views
  • 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
    Rupesh
    Contributor
    wrote on last edited by
    #1

    Hi,
    I'm using Starling 2 Max drone. I'm trying to localize the drone with AprilTag. I followed all the instructions from the ModalAI documentation, but cannot get it to work. I feel like the instructions for Relocalization are incomplete. The voxl-inspect-tags is working perfectly, and voxl-inspect-services also shows everything working. I also changed the offboard mode to "follow_tag" as shown in the figure below. Can anyone help me with how to proceed? Or i must use docker and run the script file? If so, is offboard_follow_tag.c safe to use? Because the documentation says "offboard_follow_tag.c: (may be outdated and no longer functional)".
    64bf53f2-71eb-4573-9bba-b45c5c6ce387-Screenshot 2025-09-24 184013.jpg
    bccd8a7f-cbb8-4df7-8214-be69c78b5b0e-Screenshot 2025-09-24 185439.png

    A 2 Replies Last reply
    0
    • R Rupesh

      Hi,
      I'm using Starling 2 Max drone. I'm trying to localize the drone with AprilTag. I followed all the instructions from the ModalAI documentation, but cannot get it to work. I feel like the instructions for Relocalization are incomplete. The voxl-inspect-tags is working perfectly, and voxl-inspect-services also shows everything working. I also changed the offboard mode to "follow_tag" as shown in the figure below. Can anyone help me with how to proceed? Or i must use docker and run the script file? If so, is offboard_follow_tag.c safe to use? Because the documentation says "offboard_follow_tag.c: (may be outdated and no longer functional)".
      64bf53f2-71eb-4573-9bba-b45c5c6ce387-Screenshot 2025-09-24 184013.jpg
      bccd8a7f-cbb8-4df7-8214-be69c78b5b0e-Screenshot 2025-09-24 185439.png

      A Offline
      A Offline
      ApoorvThapliyal
      Contributor
      wrote on last edited by
      #2

      @Rupesh Thanks for your question. Our subject matter expert is currently unavailable, but we will review this and get back to you within a few days.

      1 Reply Last reply
      0
      • R Rupesh

        Hi,
        I'm using Starling 2 Max drone. I'm trying to localize the drone with AprilTag. I followed all the instructions from the ModalAI documentation, but cannot get it to work. I feel like the instructions for Relocalization are incomplete. The voxl-inspect-tags is working perfectly, and voxl-inspect-services also shows everything working. I also changed the offboard mode to "follow_tag" as shown in the figure below. Can anyone help me with how to proceed? Or i must use docker and run the script file? If so, is offboard_follow_tag.c safe to use? Because the documentation says "offboard_follow_tag.c: (may be outdated and no longer functional)".
        64bf53f2-71eb-4573-9bba-b45c5c6ce387-Screenshot 2025-09-24 184013.jpg
        bccd8a7f-cbb8-4df7-8214-be69c78b5b0e-Screenshot 2025-09-24 185439.png

        A Offline
        A Offline
        ApoorvThapliyal
        Contributor
        wrote on last edited by
        #3

        @Rupesh What rotation matrix are you currently using in your tag_locations.conf?
        You can try setting it to:

        [[0, 1, 0],
        [0, 0, 1],
        [1, 0, 0]]
        Keep in mind that relocalization will only work reliably at certain viewing angles relative to the AprilTag. A good way to test is to rotate the tag and observe at which orientations voxl-vision-hub --debug_fixed_frame gives a value and not WARNING, apriltag roll/pitch out of bounds. Improvements are in progress to make this more robust across a wider range of angles.

        R 2 Replies Last reply
        0
        • A ApoorvThapliyal

          @Rupesh What rotation matrix are you currently using in your tag_locations.conf?
          You can try setting it to:

          [[0, 1, 0],
          [0, 0, 1],
          [1, 0, 0]]
          Keep in mind that relocalization will only work reliably at certain viewing angles relative to the AprilTag. A good way to test is to rotate the tag and observe at which orientations voxl-vision-hub --debug_fixed_frame gives a value and not WARNING, apriltag roll/pitch out of bounds. Improvements are in progress to make this more robust across a wider range of angles.

          R Offline
          R Offline
          Rupesh
          Contributor
          wrote on last edited by
          #4

          @ApoorvThapliyal Thank you for your reply.
          I tried voxl-vision-hub --debug_fixed_frame while showing AprilTag to the tracking camera with different orientations, but got some warnings about qvio.
          682929b8-d9dd-49a6-b36a-b873d1f365d2-Screenshot 2025-10-03 182038.png
          Since this was a warning about qvio, I checked voxl-inspect-qvio, and it was working okay.

          Additionally, I wanted to integrate AprilTag Localization with voxl2_takeoff_land.py. Is it possible to make it work if I add the following code between the 'takeoff' and 'landing' commands?
          try:
          await drone.offboard.set_position_ned(PositionNedYaw(0, 0, -1.0, 0))
          await drone.offboard.start()
          except OffboardError as e:
          print(f"Offboard start failed: {e._result.result}")

          await asyncio.sleep(20)
          
          print("-- Stopping Offboard mode")
          try:
              await drone.offboard.stop()
          except OffboardError as e:
              print(f"Offboard stop failed: {e._result.result}")
          

          I tried to operate it without propellers and got the following logs in PX4.
          fecd98f3-682b-44e9-9c24-3cf7e95a5a9f-Screenshot 2025-10-03 183324.png
          The set points appear to be at the origin instead of those defined by AprilTag. Can you please help me with this?

          1 Reply Last reply
          0
          • A ApoorvThapliyal

            @Rupesh What rotation matrix are you currently using in your tag_locations.conf?
            You can try setting it to:

            [[0, 1, 0],
            [0, 0, 1],
            [1, 0, 0]]
            Keep in mind that relocalization will only work reliably at certain viewing angles relative to the AprilTag. A good way to test is to rotate the tag and observe at which orientations voxl-vision-hub --debug_fixed_frame gives a value and not WARNING, apriltag roll/pitch out of bounds. Improvements are in progress to make this more robust across a wider range of angles.

            R Offline
            R Offline
            Rupesh
            Contributor
            wrote on last edited by
            #5

            @ApoorvThapliyal, with the setting you provided, I tried flying with propellers on in offboard mode. Once I armed and switched to offboard mode, the drone took off and stayed at around 10 cm height for 10 seconds. During that time, it didn't detect AprilTag and failed to align, as the height was too low for detection. However, after 10 seconds, it suddenly began to gain height, and as it approached the ceiling, I took control and landed. From the log file, we can see that the drone was attempting to align its X and Y positions with AprilTag; however, the issue was that the Z setpoints continually decreased. Can you please help me solve this?

            Additionally, it would be more beneficial if we could run it using MAVSDK and customize it for our specific code.

            0a5ae7d1-78ab-459d-aca4-123cdf9555c7-bokeh_plot (3).png 74c3a513-d3fc-457c-a255-5661358c913f-bokeh_plot.png 81823e36-b956-4946-9e43-738052a44012-bokeh_plot (1).png 5a5753ea-ac3e-427c-b9ff-d2f8903adf88-bokeh_plot (2).png

            A 1 Reply Last reply
            0
            • R Rupesh

              @ApoorvThapliyal, with the setting you provided, I tried flying with propellers on in offboard mode. Once I armed and switched to offboard mode, the drone took off and stayed at around 10 cm height for 10 seconds. During that time, it didn't detect AprilTag and failed to align, as the height was too low for detection. However, after 10 seconds, it suddenly began to gain height, and as it approached the ceiling, I took control and landed. From the log file, we can see that the drone was attempting to align its X and Y positions with AprilTag; however, the issue was that the Z setpoints continually decreased. Can you please help me solve this?

              Additionally, it would be more beneficial if we could run it using MAVSDK and customize it for our specific code.

              0a5ae7d1-78ab-459d-aca4-123cdf9555c7-bokeh_plot (3).png 74c3a513-d3fc-457c-a255-5661358c913f-bokeh_plot.png 81823e36-b956-4946-9e43-738052a44012-bokeh_plot (1).png 5a5753ea-ac3e-427c-b9ff-d2f8903adf88-bokeh_plot (2).png

              A Offline
              A Offline
              ApoorvThapliyal
              Contributor
              wrote on last edited by
              #6

              @Rupesh Apologies for the late reply
              It looks like there’s an issue with how the AprilTag system is relocalizing the drone. In my tests, the z-value appears to be misinterpreted, which could explain why your drone was climbing in altitude to correct its height estimate. We’re actively working on a fix.

              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