ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Visual position estimate and offboard control

    GPS-denied Navigation (VIO)
    2
    6
    130
    Loading More Posts
    • 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.
    • B
      bschulzhf
      last edited by

      I am new to VOXL development and am working on an application that will provide a VISION_POSITION_ESTIMATE mavlink message to the autopilot and control the aircraft via OFFBOARD commands. The application will run on the VOXL. I am currently reading frames from the MPA, synchronizing with metadata from MPA, and computing a vision based position estimate. However, I am struggling with how to get that position estimate to the autopilot and how to configure the autopilot to receive them.

      • Do I use the mavlink_onboard pipe to send the mavlink offboard control commands (ex. SET_ATTITUDE_TARGET) and VISION_POSITION_ESTIMATE messages?
      • Are there instances where I should communicate over UDP with the autopilot or are all comms done through MPA?
      • Is there example code to follow with instructions on any internal routing or other setup?

      Thanks

      Eric KatzfeyE 1 Reply Last reply Reply Quote 0
      • Eric KatzfeyE
        Eric Katzfey ModalAI Team @bschulzhf
        last edited by

        @bschulzhf Take a look at the voxl-vision-hub code. Specifically the vio manager: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-vision-hub/-/blob/dev/src/vio_manager.c?ref_type=heads

        B 1 Reply Last reply Reply Quote 0
        • B
          bschulzhf @Eric Katzfey
          last edited by

          I was able to get the visual odometry message updating the PX4 EKF2 and that seems like the better path. Just to make sure I've got this set up correctly, I put the application processor time (CLOCK_MONOTONIC) into the timestamp field and the mavlink server updates the message with the appropriate PX4 kernel time before forwarding it to PX4?

          Eric KatzfeyE 1 Reply Last reply Reply Quote 0
          • Eric KatzfeyE
            Eric Katzfey ModalAI Team @bschulzhf
            last edited by

            @bschulzhf Sort of. The timestamp from voxl-vision-hub and voxl-mavlink-server is just the Linux processor monotonic time. But because voxl-mavlink-server has been responding to the time sync protocol messages from PX4 it allows PX4 itself to update the timestamp to PX4 time when it comes in.

            B 1 Reply Last reply Reply Quote 0
            • B
              bschulzhf @Eric Katzfey
              last edited by

              To make sure I understand this, I still publish messages from the application processor with the application processor time and PX4 will correct it? Then do the PX4 messages coming out (like with attitude data) then have the timestamp correct relative to the application processor, or do I need to convert those timestamps?

              Eric KatzfeyE 1 Reply Last reply Reply Quote 0
              • Eric KatzfeyE
                Eric Katzfey ModalAI Team @bschulzhf
                last edited by

                @bschulzhf PX4 will only correct incoming messages. Something external will have to also run TIMESYNC with PX4 to estimate the offset and correct and incoming PX4 message timestamps that it wants to align. voxl-mavlink-server does this for a few messages.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB | Contributors