Can I use SITL to test modified firmware?

Hello, I’m fairly new to Ardupilot so I beg your pardon if this question seems absurd. I’m on the road to get knowing Ardupilot better and better.

I and my research team is currently investigating a novel multicopter design based on the trirotor frame. Apart from 4 outputs that control the rotors angular speed and the servo tail angle, we have one extra output to control the thrust motor. Because of the high-quality components of PixHawk, we are planning to modify the firmware of Ardupilot and reupload it to PixHawk to control the aircraft, but we are not sure how to test the firmware.

Can I use SITL to test the firmware in a virtual physical environment to check the firmware functions correctly, prior to uploading the firmware to our PixHawk? And if possible, can you recommend me an easy way to understand how source code is written in the Github Ardupilot code base. I’m currently trying to learn from the source code but it was too challenging. Moreover, the algorithm that I’ve prototyped is not of PID type so a lot of change has to be made.

Thank you for your reading, any help is greatly appreciated.

Hello, I’m fairly new to Ardupilot so I beg your pardon if this question seems absurd. I’m on the road to get knowing Ardupilot better and better.

Welcome!

Firstly, I might recommend this gitter channel:
https://gitter.im/ArduPilot/Research

Support on there might be a little thing for the next couple of weeks
while a few of us are distracted with a competition.

I and my research team is currently investigating a novel multicopter design based on the trirotor frame. Apart from 4 outputs that control the rotors
angular speed and the servo tail angle, we have one extra output to control the thrust motor. Because of the high-quality components of PixHawk, we are

Is this a similar design to the “trinity” boosted tricopter?

planning to modify the firmware of Ardupilot and reupload it to PixHawk to control the aircraft, but we are not sure how to test the firmware.

Sounds entirely reasonable.

Can I use SITL to test the firmware in a virtual physical environment to check the firmware functions correctly, prior to uploading the firmware to our

Yes, you certainly can! While our physics simulation is pretty rough it
is certainly a good starting point.

The vehicle models are in here:

Doesn’t look like the simulation for that vehicle is in there - 'though
I’m sure it’s been done at some stage.

PixHawk? And if possible, can you recommend me an easy way to understand how source code is written in the Github Ardupilot code base. I’m currently

Have you looked at our documentation on dev.ardupilot.org? There are a
few overviews of the source code base on there.

trying to learn from the source code but it was too challenging. Moreover, the algorithm that I’ve prototyped is not of PID type so a lot of change has to
be made.

That sounds interesting!

Hi Peter, thanks for your kind response. Per my understanding, the SITL will load the same firmware (which will be in compiled form, ready to be uploaded to PixHawk), is that correct? And since my design integrates a fixed-wing, the dynamics of the aircraft can surely change. Would that be an issue that I need to keep in mind?

Hi Peter, thanks for your kind response. Per my understanding, the SITL will load the same firmware (which will be in compiled form, ready to be uploaded
to PixHawk), is that correct?

That’s not quite correct. For the most part the same code is compiled,
however it is compiled for the native platform for where it is being
compiled - so if you are compiling in an intel x86 laptop it will create
an intel x86 binary. A Hardware Abstraction Layer is used to provide a
consistent view of the hardware for the bulk of the flight code.

And since my design integrates a fixed-wing, the dynamics of the
aircraft can surely change. Would that be an issue that I
need to keep in mind?

You would almost certainly need to create yourself a simulated model of
this vehicle - either something akin to ArduPilot’s own C++ simulated
vehicles, or possibly in an external simulator such as RealFlight8.

Thank you so much for your help. I will have a look at the website and the source code too. ArduPilot is indeed amazing.