How to use custom libmodal_pipe in MPA service



  • I've forked libmodal_pipe (https://gitlab.com/SteveArias1/libmodal_pipe) and have made changes to this forked repo. I have generated and installed an ipk package of this custom libmodal_pipe via voxl-docker -i voxl-cross and the other usual commands that follow (./install_build_deps.sh stable, etc.). I'm able to install this custom version of libmodal_pipe on the VOXL board. It's running this custom libmodal_pipe on the board as we speak..

    I've made a new MPA service that uses libmodal_pipe. I've been using voxl-docker to build and install this service to the VOXL board. Specifically, I use the voxl-cross docker image and run a custom ./install_build_deps.sh script which downloads libmodal_pipe, libmodal_json and voxl-mavlink from the stable opkg repo (http://voxl-packages.modalai.com/stable).

    I want to use a custom function that I made in the custom libmodal_pipe library in my MPA service. How can I use the custom libmodal_pipe library that I have? I can't use opkg to get it since the stable repo only has the stable ipk packages that ModalAI provides by default.


  • Dev Team

    Hi Steve,

    It's possible for you to host your own opkg repo and point opkg to two repositories simultaneously. You could also install the new ipk in your docker manually without the install_build_deps.sh script and then "commit" the docker image so it's still there next time you start it.

    I briefly checked out your fork and I would suggest two alternate routes:

    1. The simple helper does the same sort of raw read on the pipe that your new function does, but with additional checks and signal handlers to ensure safe start/stop behavior. This is extensively tested and took a while to be robust.

    2. There is an existing function called pipe_client_get_fd(int ch) in the library that will allow you to retrieve the pipe file descriptor and do any custom read behaviors you desire should the helper threads not over your specific use case. You can then have your raw_read function built into your custom project without needing to rebuild libmodal_pipe or worry about managing that separate dependency.

    I hope this helps,
    James



  • @James-Strawson thanks for the suggestions!


Log in to reply