Cosys-AirSim Matlab API Client

This a client implementation of the RPC API for Matlab for the Cosys-AirSim simulation framework.
11 Downloads
Updated 1 Oct 2024

View License

This a client implementation of the RPC API for Matlab for the Cosys-AirSim simulation framework. A main class AirSimClient is available which implements all API calls.
Do note that at this point not all functions have been tested and most function documentation was auto-generated. This is still a WIP client.
Dependencies
  • MATLAB 2024a or higher with the associated supported Python version, 3.7 or higher with the Cosys-AirSim python module.
  • Computer Vision, Aerospace, Signal Processing Toolboxes
Usage
Configure Python for MATLAB
First you need to correctly link your installed Python installation to MATLAB, as by default this isn't always the latest version of Python 3 you installed. You can verify which Python is linked by running:
pe = pyenv;
pe.Version
If this is not a version that you which to use you can alter this manually. Do note that you need to do this everytime before using the clioent! Once Python is loaded in matlab, you need to restart MATLAB first before changing it. Therefore, running the commands above will likely mean requiring a restart of MATLAB.
For Windows you can run for example:
pyenv('Version','your.version')
With 'your.version' indicating the 'major.minor' version number of you Python release, for example '3.6'.
On linux you need to refer to the path of your Python 3 installation,, for example:
pyenv('Version',"/usr/bin/python3")
You can also link to specific Python versions by altering the path.
Some more information can be found here.
Initial setup
When starting with this wrapper, first try to make a connection to the Cosys-AirSim simulation.
vehicle_name = "airsimvehicle";
airSimClient = AirSimClient(IsDrone=false, IP="127.0.0.1", port=41451);
Now the client object can be used to run API methods from. All functions have some help text written for more information on them.

Cite As

Wouter Jansen (2024). Cosys-AirSim Matlab API Client (https://www.mathworks.com/matlabcentral/fileexchange/168061-cosys-airsim-matlab-api-client), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024a
Compatible with R2024a and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
3.1.0.0

Removed constructor for defining apicontrol and vehicle name. Vehicle name now needs to be added to most function calls as mandatory argument. This fixes multi-vehicle usage. Added option for async drone functions to have it wait for completion.

3.0.1.0

Added getComputerVisionState()

3.0.0.2

Fixed timestamp retrieval

3.0.0.1

FIxed python library having changed name from airsim to cosysairsim

3.0.0