PX4 SITL Matlab

Hello i have developed a flight controller with a fault injection method using simulink and the model was build successfully to be flashed to the Pixhawk but i need to do a SITL the model before i flash it to the hardware i tried to build the model on the posix shell but it gives me error i think related to the compiler so my question is
Is there is a way to change the compiler of the posix shell in the cmakefile and if not then is there is a way to test the simulink model before flashing it to the hardware?

Thanks in advance

Have you found any way to that? I am working on the similar problem so any lead will be highly appreciated

Unfortunately, I couldn’t do the test as i had no time but there are some options you can take:

1- one way to do so is to modify the c files generated from Simulink before building and flashing them to the hardware then use the posix to test it
2- simply test your code on Simulink without using blocks from Pixhawk toolbox (replace them with the right ones) you can find a Simulink example for this on the PX4 toolbox documentation on Simulink.

Hope i was of any help to you
Good luck