Main Content

Custom Startup Script in UAV Toolbox Support Package for PX4 Autopilots

The Hardware Setup process of UAV Toolbox Support Package for PX4® Autopilots contains a step that enables the usage of a custom startup script. This startup script, which needs to be copied to the micro-SD card to be mounted on the Pixhawk Series flight controllers, helps in:

  • Enabling or disabling the default PX4 modules as per the support package capabilities

  • Avoiding interference with other default PX4 controller modules

  • Preparing the PX4 Autopilot hardware to run the application generated by Simulink

For details about using this script, see Performing PX4 System Startup from SD Card.

Modules Enabled Using Custom Startup Script

The UAV Toolbox Support Package for PX4 Autopilots uses the custom startup script to enable some of the important modules.

The following table lists the modules that are enabled during the system startup from SD card.

PX4 Modules Enabled Using Custom Startup ScriptUsage
uORBEnables uORB message bus communication
px4ioStarts the firmware in IO processor of PX4 Autopilot and it is responsible for Main PWM Output
fmuGenerating AUX PWM outputs
ekf2Estimator that outputs vehicle attitude
sensorsThe sensors module reads the onboard sensors values and publishes data over uORB message bus
mtd and paramLoading and reading parameter

Modules Disabled Using Custom Startup Script

The UAV Toolbox Support Package for PX4 Autopilots uses the custom startup script to disable few modules.

The following table lists few modules that are disabled at startup.

PX4 Modules Disabled at StartupReason for Disabling

Position Controller

Attitude & Rate Controller

The support package enables you to design the controller and hence the default Controller module in PX4 is disabled.
CommanderThe default Commander module is disabled to avoid possible interference with controller algorithm
NavigatorThe default Navigator module is disabled to avoid possible interference with controller algorithm
MAVLinkThe default serial port of MAVLink communication is the USB port of PX4 Autopilot. The MAVLink modules are disabled during startup to enable out-of-the-box External Mode support from Simulink, which uses the same USB port.

However, you can enable MAVLink while configuring the Simulink model. For details, see Enabling MAVLink in PX4 Over USB.

To understand the impact of disabling the modules, see .