Main Content

Develop Algorithms & Deploy on PX4 Autopilot

Develop algorithms and prepare model for deploying on PX4 Autopilots

Setup Simulink Model

Model Configuration Parameters for PX4 Flight Controller

Parameter and configuration options for creating and running applications on PX4® flight controller

Set COM Port for Upload and Communication in Simulink

Set COM port for Upload and Communication in Simulink® models

Deployment on Cube Orange Autopilot from Simulink

Deploy Simulink generated code to Cube Orange Autopilot.

Blocks

PX4 uORB ReadRead uORB data for the specified uORB topic
PX4 uORB WriteWrite uORB data for the specified uORB topic
PX4 uORB MessageCreate a blank message using specified uORB topic
PX4 Analog InputMeasure analog voltage applied to an ADC channel
PX4 PWM OutputConfigure PWM outputs for servo motors and ESC control
PX4 Read Position SetpointRead the position setpoints published by the PX4 Navigator module in the uORB topic position_setpoint_triplet
Serial ReceiveRead data from UART or USART port on PX4 flight controller
Serial TransmitSend serial data to UART or USART port
Vehicle AttitudeRead vehicle_odometry uORB topic and obtain attitude measurements
AccelerometerRead sensor_accel uORB topic and obtain three dimensional linear acceleration
GyroscopeRead sensor_gyro uORB topic and obtain three dimensional rate of rotation
MagnetometerRead sensor_mag uORB topic and obtain three dimensional magnetic field
Radio Control TransmitterRead input_rc uORB topic to obtain data from Radio Control Transmitter
Read ParameterRead PX4 system parameters
BatteryRead battery_status uORB topic and obtain details about the battery's state
I2C Master WriteWrite data to I2C slave device or I2C slave device register
I2C Master ReadRead data from I2C slave device or I2C slave device register
GPSRead vehicle_gps_position uORB topic and obtain GPS coordinates
PX4 CAN ReceiveReceive message from CAN network
PX4 CAN Transmit Transmit message to CAN network

Functions

getMATFilesFromPixhawkRetrieve MAT-files from SD card inserted on Pixhawk hardware board
px4MATFilestitcherCombine multiple MAT-files retrieved from SD card into a single MAT-file

PX4 Autopilot Peripheral Information

Index Numbers for Analog Channels on Pixhawk Series Controller Boards

Identify the index numbers for signals from analog channels

Port Numbers for Labels on PX4 Flight Controller Boards

Identify the UART/USART port number for the labels seen on PX4 flight controller boards

I2C Bus Port Numbers for Labels on PX4 Autopilots

Identify the bus port number for the labels seen on PX4 flight controller boards

MAVLink Communication with PX4 Autopilots

Enabling MAVLink in PX4 Over USB

Enable MAVLink protocol for PX4 Autopilots over USB

Connecting to NSH Terminal for Debugging

Connect to the NSH terminal of Pixhawk Series controller for debugging.

Additional Information

Migrating from Pixhawk Pilot Support Package to UAV Toolbox Support Package for PX4 Autopilots

Migrate from existing Pixhawk Pilot Support Package to the new UAV Toolbox Support Package for PX4 Autopilots

Plant and Attitude Controller Model for Hexacopter

Use plant model and attitude control model to fly a hexacopter using UAV Toolbox Support Package for PX4 Autopilots

Troubleshooting

Troubleshooting Deploy to Hardware Issues

Solve the problems when you try to deploy the Simulink model to Pixhawk Series flight controllers

Troubleshooting Flash Overflow Issues with Pixhawk 1

Solve the flash overflow issues when you try to deploy the Simulink model to Pixhawk 1

Troubleshooting Running Out of File Descriptor Issues

Solve the running out of file descriptor issues