Main Content

Load and Start Modules on PX4 Autopilot 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 called rcS. The PX4 System Startup process is documented here on PX4 Development guide. The startup script rCS loads 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 called rc.txt that can be placed on a SD card and plugged in the PX4 Autopilot. This custom startup script replaces the entire default boot-up modules in rCS. If the rc.txt is not present on the SD card, the default startup script rCS is executed. The Hardware Setup process of the UAV Toolbox Support Package for PX4 Autopilots enables the user to select either of the options for the startup script for their Autopilots. The user can either choose the default rCS for 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 the UAV Toolbox Support Package for PX4 Autopilots, see Custom Startup Script in UAV Toolbox Support Package for PX4 Autopilots.

If the user selects rCS as 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_control and mc_att_control is disabled in the rCS. 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 in rCS so that it is started after the Autopilot is booted up.