ArduPilot Software-In-The-Loop (SITL) Connector for Simulink
ArduPlane SITL Connector for Simulink
A Simulink S-function for sending and receiving data to and from ArduPilot SITL Simulator
Build
To build the "ardupilot_sitl_connector.cpp" S-function:
-
Install a supported C++ compiler e.g. the MinGW-w64 Compiler or the MSVC Compiler.
https://www.mathworks.com/support/requirements/supported-compilers.html
-
Unzip the "includes.zip" archive. The archive contains the Asio C++ library.
-
Open and run the "make.m" script. Make sure you run the script from within the folder it resides in.
Note: You may need to link against the ws2_32 library if you use the MinGW-w64 compiler. E.g. -lws2_32.
-
If the build is successful you should see an "ardupilot_sitl_connector.mexw64" file in the current folder.
Example use
- Download and install Mission Planner. https://ardupilot.org/planner/docs/mission-planner-installation.html
- Open Mission Planner, select the "Simulation" tab and click on the "Plane" icon. When prompted about the SITL version, select the "Stable" one.
- Once the SITL is downloaded, open a command prompt and navigate to "C:\Users<user>\Documents\Mission Planner\sitl".
- Execute the following command in the command prompt:
ArduPlane.exe --home -35.363261,149.165230,0,0 --model json
- Open the "ardupilot_sitl_connector_example.slx" model.
- In Mission Planner click the connect icon. Use the default host and port options.
- Run the Simulink model.
Note: The ArduPilot AHRS_EKF_TYPE parameter must be set to 10. The value 10 corresponds to SITL. The above workflow is tested on Windows 10 and in MATLAB R2018b and MATLAB R2022a.
Cite As
Kiril Boychev (2022). ArduPilot Software-In-The-Loop (SITL) Connector for Simulink (https://github.com/KBoychev/ardupilot-sitl-connector/releases/tag/1.0.1), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.