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

ModalAI Forum

  1. ModalAI Support Forum
  2. VOXL Compute & Autopilot
  3. VOXL
  4. How to receive GPS information in voxl-tflite-server?

How to receive GPS information in voxl-tflite-server?

Scheduled Pinned Locked Moved VOXL
9 Posts 2 Posters 1.1k 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.
  • Nguyen Tien SuN Offline
    Nguyen Tien SuN Offline
    Nguyen Tien Su
    wrote on last edited by
    #1

    I need to have GPS information such as latitude, and longitude, ... to process in voxl-tflite-server c++ code. How can I do it?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hello @Nguyen-Tien-Su,

      voxl-inspect-gps (https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-tools/-/blob/master/tools/voxl-inspect-gps.c) is an example of how to subscribe to the gps pipe and process the data.

      1 Reply Last reply
      0
      • Nguyen Tien SuN Offline
        Nguyen Tien SuN Offline
        Nguyen Tien Su
        wrote on last edited by
        #3

        Thank you, @Matt-Turi !
        I checked the code and understood. But it's error when I include mavlink.h header file from c_library_v2 library into voxl-tflite-server. It said that mavlink.h file not found. How can I solve this problem?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          To use the mavlink headers, you must add voxl-mavlink to the required dependencies for the project. This can be done by modifying the install_build_deps.sh script, and simply adding voxl-mavlink to the DEPS_* list depending on your platform.

          DEPS_QRB5165="
          libmodal-pipe
          libmodal-json
          voxl-opencv
          voxl-mavlink  
          qrb5165-tflite"
          
          DEPS_APQ8096="
          libmodal-pipe
          libmodal-json
          voxl-opencv
          voxl-mavlink
          apq8096-tflite"
          1 Reply Last reply
          0
          • Nguyen Tien SuN Offline
            Nguyen Tien SuN Offline
            Nguyen Tien Su
            wrote on last edited by
            #5

            Thank @Matt-Turi very much !
            I am successful to receive GPS in voxl-tflite-server. But I can't open 2 pipes GPS and TFLITE at the same time since they use same channel 0. Their channel seems to be set up by the MPA and can't change. How can I solve this problem?

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              @Nguyen-Tien-Su,
              Did you experience any error messages when you tried this? Subscribing to the gps pipe should be independent of any channels/pipes that the tflite-server opens, as gps is a client connection. See here: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-tflite-server/-/blob/master/src/main.cpp#L344 for an example of opening up a client connection and getting the next avaialble channel automatically using

              int ch = pipe_client_get_next_available_channel();
              
              1 Reply Last reply
              0
              • Nguyen Tien SuN Offline
                Nguyen Tien SuN Offline
                Nguyen Tien Su
                wrote on last edited by
                #7

                Hi @Matt-Turi ! This is error.

                2bb3a8ec-babe-4fe5-b027-b329421355e7-image.png

                I tried to change the channel of GPS, then I can't receive any GPS message. I also tried to change channel of the TFLITE server but it couldn't start.

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  Make sure you are setting the callback functions correctly with the next available channel (rather than hardcoding to 0). The tflite-server is only opening one client connection to receive camera frames, so it should be simple to avoid a channel conflict.

                  If your callback functions are named the same as the inspect-gps example, this code could be pasted in after line https://gitlab.com/voxl-public/voxl-sdk/services/voxl-tflite-server/-/blob/master/src/main.cpp#L354

                  int ch = pipe_client_get_next_available_channel();
                  
                  pipe_client_set_simple_helper_cb(ch, _helper_cb, NULL);
                  pipe_client_set_connect_cb(ch, _connect_cb, NULL);
                  pipe_client_set_disconnect_cb(ch, _disconnect_cb, NULL);
                  
                  int ret = pipe_client_open(ch, GPS_RAW_OUT_PATH, PROCESS_NAME, \
                            EN_PIPE_CLIENT_SIMPLE_HELPER | EN_PIPE_CLIENT_AUTO_RECONNECT, \
                  	  sizeof(mavlink_message_t));
                  
                  
                  1 Reply Last reply
                  0
                  • Nguyen Tien SuN Offline
                    Nguyen Tien SuN Offline
                    Nguyen Tien Su
                    wrote on last edited by
                    #9

                    Hi @Matt-Turi !
                    You right. I hardcoded tflite server channel, so I forgot to change it when setting callback function. Now, my code works fine.
                    Thank you very much for your enthusiastic help!

                    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