How to enable commander and navigator modules in uav toolbox

17 views (last 30 days)
종원 이
종원 이 on 29 Aug 2021
Commented: Ankur Bose on 30 Aug 2021
Hello, I have some question about uav toolbox.
As far as I understand, when I want to upload my custom position&attitude controller in uav I have to upload custom startup script and it kills some modules to prevent collision with my custom controller algorithm which are Commander module and Navigator Module, etc.
There are methods that enable suppressed modul, MAVLINK, but there are no introduced method to re-enable Commander module and Navigator Module.
If I cannot enable commander and navigator module, then does it mean I cannot upload planned mission and select vehicle type when I upload my custom flight algorithm?
Is there any method upload my custom algorithm without any functional loss?
Thank you very much.

Accepted Answer

Ankur Bose
Ankur Bose on 30 Aug 2021
Till R2021a, we provide the custom startup script to disable commander and navigator modules to avoid potential interference of these modules with Simulink designed controller. If you are looking forward to upload missions to vehicle, all the functionalities might not work without commander and navigator.
To enable commander, navigator (and consequently all modules on PX4), you can migrate to using the default startup script rcS with a few modifications from the custom startup script. To enable use of rcS:
  1. Modify the rcS script that is available in 'ROMFS/px4fmu_common/init.d' path to add the line at the end 'px4_simulink_app start'. This line starts the Simulink module on Pixhawk.
  2. make clean the firmware. Run Hardware setup screens to build PX4 Firmware.
  3. Remove the custom startup script from SD card.
  4. Upload firmware from hardware support package. You should get all modules from PX4 now.
In R2021b, we have provided an additional workflow to automate this process.
  2 Comments
Ankur Bose
Ankur Bose on 30 Aug 2021
Hi,
Sorry I did not clarify this before and also missed one important modification to rcS. In summary, what you are asking "upload my designed Controller while both commander and navigator modules are alive" is possible and that's what I wanted to give you a solution in my previous answer. So let me clarify again.
You can use rcS to run the controller you designed in Simulink and also have commander, navigator enabled. This can be done as follows:
  1. Add 'px4_simulink_app' module in rcS. This app contains the Simulink generated code for your designed controller and hence enabing this app in rcS will run your controller.
  2. Disable the default PX4 controller. This I had forgot to mention before. You need to disable default PX4 controllers so that they dont interfere with your controller. You can disable the default controller for your aiframe at rc.fw_apps or rc.mc_apps.
  3. make clean the firmware and build the PX4 from hardware setup screens.
  4. Remove custom starup script from your Pixhawk so that your modified rcS kicks in.

Sign in to comment.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by