Run sitl programmatically

I have implemented a custom mode in ardupilot codebase for a copter. I want to test the mode with multiple input scenarios. I am trying to automate this process using a python script (similar to how unit test works). I want to run the silt instance programmatically and then use mavlink to automate the required testcases. I need some help on how to run the copter sitl instance programmatically

AdruPilot already has an entire framework to do this. It is called autotests and the code contains a couple of hundreds of these. We use them has regression tests in the github. So look at the source code for “inspiration”

2 Likes

Thank you @amilcarlucas. Autotest is what I am looking for. I could understand how to use autotest by looking into the code but it took quite a while for me to figure it out. It could have been better if there is a documentation on how to add new test cases.

You can write some docs as you go along and do a github PR with them once you are done.

1 Like