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

    Question on Custom Controller Implementation

    Sentinel
    3
    4
    274
    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.
    • J
      jmltt
      last edited by

      I'm working with the Sentinel platform and I'm planning on testing a custom controller that runs in tandem with a deep learning model and I have some general questions about implementation. I've modified the existing voxl-vision-hub to contain an additional offboard mode with a custom trajectory. I want to also implement a custom controller that basically replaces the Position/Attitude controllers on PX4 and just feeds rate/thrust commands to PX4's rate controller.

      1. Is implementing a controller as a separate thread within a new offboard mode in voxl-vision-hub a viable option or would I have to modify PX4 source code to edit the existing position/attitude controllers? I saw there is a message struct in the mavlink API for sending rate/thrust commands directly to PX4 so I was planning on having the controller pull down the current state from the autopilot monitor in voxl-vision-hub for input the same way existing offboard modes do and output the rate thrust commands via mavlink the same way trajectory setpoints are sent.

      2. If I do have to modify PX4 source code, how would I go about doing that? Can I just uninstall the px4 service from the sentinel, pull down the repo here https://gitlab.com/voxl-public/voxl-sdk/services/voxl-px4, swap the px4 submodule with an edited one, rebuild locally and push it back to sentinel?

      3. Any general advice/warnings for custom controller implementation?

      Any feedback is appreciated. Thanks!

      ModeratorM Eric KatzfeyE 2 Replies Last reply Reply Quote 0
      • ModeratorM
        Moderator ModalAI Team @jmltt
        last edited by

        @josephmlullo Here is how to build PX4 for VOXL 2 https://docs.modalai.com/voxl-px4-dev-build-guide/

        ModeratorM 1 Reply Last reply Reply Quote 0
        • ModeratorM
          Moderator ModalAI Team @Moderator
          last edited by

          On this branch you can see how to control the attitude for PX4 in offboard_mode just from the CPU https://gitlab.com/voxl-public/voxl-sdk/services/voxl-vision-hub/-/blob/dev_attitude_target/src/offboard_manual.c?ref_type=heads

          Please note, this is development code and we do not support it in any way. you are on your own when implementing your own controller

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

            @josephmlullo The build environment for px4 is within a Docker container. You can find the instructions on how to create this Docker image here: https://gitlab.com/voxl-public/rb5-flight/rb5-flight-px4-build-docker

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