Main Content

Load and Start Modules onPX4Autopilot After Boot-Up

The startup sequence of the PX4®modules during boot-up of the hardware is controlled by the startup script contained in the PX4 Firmware calledrcS. The PX4 System Startup process is documentedhereon PX4 Development guide. The startup scriptrCSloads the modules and the desired airframe mixers after the Autopilot is booted up. The PX4 System Startup process also allows the user to selectively enable (or disable) the desired modules after boot-up with the help of a custom startup script calledrc.txtthat can be placed on a SD card and plugged in the PX4 Autopilot. This custom startup script replaces the entire default boot-up modules inrCS. If therc.txtis not present on the SD card, the default startup scriptrCSis executed. The Hardware Setup process of theUAV Toolbox Support Package for PX4 Autopilotsenables the user to select either of the options for the startup script for their Autopilots. The user can either choose the defaultrCSfor startup or use a custom startup script. The custom start up script is helpful in scenarios where user does not wish to enable some of the PX4 modules and will be designing them accordingly in Simulink®. For more information on the custom startup script usage in theUAV Toolbox Support Package for PX4 Autopilots, seeCustom Startup Script in UAV Toolbox Support Package for PX4 Autopilots.

If the user selectsrCSas the startup script for their Autopilot, all the PX4 modules are available to them or use in their Autopilot. The only exception to this is for the scenario when the user wants to design their own controller algorithms in Simulink. For this scenario, to avoid any interference with the default PX4 multi-copter controller modules,mc_pos_controlandmc_att_controlis disabled in therCS. However, if user wishes to design any other algorithms apart from controller and would like to use the default PX4 controllers in the Autopilot, the multi-copter controller modules are kept enabled.

The px4_simulink_app module which contains the Simulink generated code is also added as an additional module inrCSso that it is started after the Autopilot is booted up.