File Exchange

image thumbnail

Embedded Coder Support Package for PX4 Autopilots

Automatically build and deploy flight control algorithms to PX4 Autopilots using Simulink and Embedded Coder

150 Downloads

Updated 20 Mar 2019

Using Embedded Coder™ Support Package for PX4® Autopilots, you can generate C++ code, build, and deploy Simulink® models on Pixhawk® flight controllers. The support package uses the PX4 toolchain to compile and deploy algorithms tailored specifically for Pixhawk flight management units and lets you customize algorithms to incorporate onboard sensor data and other PX4-specific services. PX4 is a trademark of Lorenz Meier.

Comments and Ratings (21)

Ankur Bose

Hello zjwrj,
The official fix for this issue is now available through support package updates in R2018b. Please update your support package. After the support package is updated, execute the below commands in MATLAB command window and try building the model again.
setenv('MW_PX4_WIN10_BUILDCMD','')
setpref('MW_PX4_WSLBuildPath','SwitchPath', 1)

Ankur Bose

Hello zjwrj,
This was an issue that we have fixed and official bug fix will be available soon. If you wait for some more days, you can upgrade the current support package and get the bug fix. If you need it urgently, please let me know your email-id so that I can reach you and help you in getting the issue resolved.

Thanks,
Ankur

zjwrj

Hello AnKur Bose,Thank you for your response
I did what you said,Still have errors
The error message is as follows:
"### Created: ../px4_uorb.pre.o"
"### Invoking postbuild tool "Invoke Make" ..."
"Making Firmware "
'/run-console_Simulink.bat' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
gmake: *** [postdownload_preexecute] Error 1

C:\Users\EFY\Desktop\px4test\px4_uorb_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2

C:\Users\EFY\Desktop\px4test\px4_uorb_ert_rtw>An_error_occurred_during_the_call_to_make
'An_error_occurred_during_the_call_to_make' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
### Creating HTML report file px4_uorb_codegen_rpt.html
警告: Validation warning(s):
Skipped the existence check for 'GNU PX4 C Compiler'. Cannot determine the utility that needs to be checked for existence from the build tool command 'echo gcc'.
Skipped the existence check for 'GNU PX4 Pre-Linker'. Cannot determine the utility that needs to be checked for existence from the build tool command 'echo gcc'.
Skipped the existence check for 'GNU PX4 C++ Compiler'. Cannot determine the utility that needs to be checked for existence from the build tool command 'echo g++'.
Skipped the existence check for 'GNU PX4 C++ Pre-Linker'. Cannot determine the utility that needs to be checked for existence from the build tool command 'echo gcc'.
Skipped the existence check for 'Invoke Make'. Cannot determine the utility that needs to be checked for existence from the build tool command '$(call CALLPX4MK)'.
### Build procedure for model: 'px4_uorb' aborted due to an error.
Error(s) encountered while building "px4_uorb":
### Failed to generate all binary outputs.
Caused by:
Validation error(s):
### Validating other build tools ...
Unable to locate build tool "GNU PX4 Archiver": echo

Ankur Bose

Hello zjwrj,
Please execute the below two commands in your MATLAB command window to resolve the issue:
setenv('MW_PX4_WIN10_BUILDCMD','')
setpref('MW_PX4_WSLBuildPath','SwitchPath', 1)

After you have execured the above commands in R2018b command window, try building the Simulink model again.

zjwrj

Hello Abhishek GS
1, MATLAB Version :matlab2018b
2, I am using Windows Subsystem for Linux toolchain
3,Hardware Setup Screens is ok
4,An error occurs when run the model
5,The error message is as follows
"### Created: ../px4_uorb.pre.o"
"### Invoking postbuild tool "Invoke Make" ..."
"Making Firmware "
系统找不到指定的路径。
'bash' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
gmake: *** [postdownload_preexecute] Error 1

C:\Users\EFY\Desktop\px4test\px4_uorb_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2

C:\Users\EFY\Desktop\px4test\px4_uorb_ert_rtw>An_error_occurred_during_the_call_to_make
'An_error_occurred_during_the_call_to_make' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
### Creating HTML report file px4_uorb_codegen_rpt.html
警告: Validation warning(s):
Skipped the existence check for 'GNU PX4 C Compiler'. Cannot determine the utility that needs to be checked for existence from the build tool command 'echo gcc'.
Skipped the existence check for 'GNU PX4 Pre-Linker'. Cannot determine the utility that needs to be checked for existence from the build tool command 'echo gcc'.
Skipped the existence check for 'GNU PX4 C++ Compiler'. Cannot determine the utility that needs to be checked for existence from the build tool command 'echo g++'.
Skipped the existence check for 'GNU PX4 C++ Pre-Linker'. Cannot determine the utility that needs to be checked for existence from the build tool command 'echo gcc'.
Skipped the existence check for 'Invoke Make'. Cannot determine the utility that needs to be checked for existence from the build tool command '$(call CALLPX4MK)'.
### Build procedure for model: 'px4_uorb' aborted due to an error.
Error(s) encountered while building "px4_uorb":
### Failed to generate all binary outputs.
Caused by:
Validation error(s):
### Validating other build tools ...
Unable to locate build tool "GNU PX4 Archiver": echo

Abhishek GS

Hello zjwrj,
Can you provide the below information?
1. MATLAB Version
2. Operating system
3. If windows, Can you let us know if you are using the Cygwin toolchain or Windows Subsystem for Linux toolchain?
4. Were you able to successfully complete the Hardware Setup Screens?
5. Complete error log.

You could also reach out via technical support channel.

https://www.mathworks.com/support/contact_us.html

zjwrj

Error(s) encountered while building "px4_readGPS":
### Failed to generate all binary outputs.
Caused by:
Validation error(s):
### Validating other build tools ...
Unable to locate build tool "GNU PX4 Archiver": echo
What is the reason?

Ankur Bose

Hello All,
The Embedded Coder Support Package for PX4 Autopilots is now available in R2018b. If you are working in R2018b, you can try downloading the support package and start working with it.

Abhishek GS

Hello Bart,

You could also reach out via technical support channel.

https://www.mathworks.com/support/contact_us.html

Ankur Bose

Hello Bart Slinger,
Can you please provide more details about the issue you are facing? If you have any use-case or feature that you would like to be present in the support package, you can let us know. If it helps, you can share your email-id and we can follow up with you about the pain you are facing?

Does not work out of the box. Option Prepare to Run not available.

Abhishek GS

Refer the below link to understand the capabilities of the support package.
https://www.mathworks.com/hardware-support/pixhawk.html

Ankur Bose

Abhishek GS

MATLAB Release Compatibility
Created with R2018b
Compatible with R2018b to R2019a
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor