Develop Algorithms and Deploy on PX4 Autopilot
Develop algorithms and prepare model for deploying on PX4 Autopilots. These topics provide additional information about model configuration parameters, setting COM ports, and deploying PX4 Autopilots from Simulink®.
Blocks
PX4 uORB Read | Read uORB data for the specified uORB topic |
PX4 uORB Write | Write uORB data for the specified uORB topic |
PX4 uORB Message | Create a blank message using specified uORB topic |
PX4 Analog Input | Measure analog voltage applied to an ADC channel |
PX4 PWM Output | Configure PWM outputs for servo motors and ESC control |
PX4 Read Position Setpoint | Read the position setpoints published by the PX4 Navigator module in the uORB topic
position_setpoint_triplet (Since R2021b) |
Serial Receive | Read data from UART or USART port on PX4 flight controller |
Serial Transmit | Send serial data to UART or USART port |
Vehicle Attitude | Read vehicle_odometry uORB topic and obtain attitude measurements |
Accelerometer | Read sensor_accel uORB topic and obtain three dimensional linear acceleration |
Gyroscope | Read sensor_gyro uORB topic and obtain three dimensional rate of rotation |
Magnetometer | Read sensor_mag uORB topic and obtain three dimensional magnetic field |
Radio Control Transmitter | Read input_rc uORB topic to obtain data from Radio Control Transmitter |
Read Parameter | Read PX4 system parameters |
Battery | Read battery_status uORB topic and obtain details about the battery's state |
I2C Controller Write | Write data to I2C peripheral device or I2C peripheral device register |
I2C Controller Read | Read data from I2C peripheral device or I2C peripheral device register |
GPS | Read vehicle_gps_position uORB topic and obtain GPS coordinates (Since R2020a) |
PX4 CAN Receive | Receive message from CAN network (Since R2022b) |
PX4 CAN Transmit | Transmit message to CAN network (Since R2022b) |
MAVLink Bridge Source | Read MAVLink data from the Pixhawk board (Since R2022a) |
MAVLink Bridge Sink | Write MAVLink data to the Pixhawk board (Since R2022a) |
PX4 ULog | Log Simulink signals to an SD card in ULog format (Since R2023b) |
PX4 Timestamp | Output absolute timestamp from the PX4 Autopilot to a Simulink model (Since R2023b) |
PX4 Actuator Write | Set actuator values for motors and servos (Since R2024b) |
Functions
getMATFilesFromPixhawk | Retrieve MAT-files from SD card inserted on Pixhawk hardware board (Since R2020b) |
px4MATFilestitcher | Combine multiple MAT-files retrieved from SD card into a single MAT-file (Since R2020b) |
createPX4uORBMessage | Create custom uORB topic for logging in a Simulink model (Since R2023b) |
Troubleshooting
Troubleshooting Deploy to Hardware Issues
Solve the problems when you try to deploy the Simulink model to Pixhawk Series flight controllers
Troubleshooting PX4 Firmware Build Failure Due to Flash Memory Overflow on the Hardware
Solve the flash memory overflow on the hardware issues while using the default px4 board build target file.
Troubleshooting Running Out of File Descriptor Issues
Solve the running out of file descriptor issues
Troubleshooting USB Issues with Cube Orange on Windows
Solve the USB issues with Cube Orange