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

    Reading data from '/run/mpa/qvio' using python

    Modal Pipe Architecture (MPA)
    2
    4
    446
    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.
    • N
      Nishkala
      last edited by

      How can we read data from the pipe /run/mpa/qvio in python

      1 Reply Last reply Reply Quote 0
      • modaltbM
        modaltb ModalAI Team
        last edited by

        Hi @Nishkala ,

        I haven't tried this yet, but it's just a file that you are reading from basically (a named pipe), so something like this may get you reading? --> https://stackoverflow.com/questions/39089776/python-read-named-pipe

        In order to parse what you are reading, you will need to use the C headers to see what bytes are what, which is shown here: https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe/-/blob/master/library/include/modal_pipe_interfaces.h#L880

        1 Reply Last reply Reply Quote 0
        • N
          Nishkala
          last edited by

          @modaltb, the links provided were insightful

          Before running a python script similar to the one provided in the link, I executed the commands

          1. 'cat run/mpa/qvio/info': I was able to see information pertaining to qvio.
          2. 'cat run/mpa/qvio/control': I was able to see the message continuously printed related to 'reset_hard_qvio'
          3. 'cat run/mpa/qvio/request': It was blank

          Which pipe should be read to get data in the form of 'vio_data_t'?

          1 Reply Last reply Reply Quote 0
          • modaltbM
            modaltb ModalAI Team
            last edited by

            Hi @Nishkala ,

            With the warning that I've not yet tried in python but I'm sure it will work 😉

            This is the source code for our voxl-inspect-qvio tool, and from there we can see it's looking for a pipe QVIO_EXTENDED_LOCATION
            https://gitlab.com/voxl-public/voxl-sdk/services/voxl-qvio-server/-/blob/master/clients/voxl-inspect-qvio.c#L51

            That's defined here:
            https://gitlab.com/voxl-public/voxl-sdk/services/voxl-qvio-server/-/blob/master/common/voxl_qvio_server.h#L64

            The other place to look for defines is in libmodal-pipe:
            https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe/-/blob/master/library/include

            This is where the inspect tool consumes data:
            https://gitlab.com/voxl-public/voxl-sdk/services/voxl-qvio-server/-/blob/master/clients/voxl-inspect-qvio.c#L259

            Here's where we parse and print the info:
            https://gitlab.com/voxl-public/voxl-sdk/services/voxl-qvio-server/-/blob/master/clients/voxl-inspect-qvio.c#L184

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