Skip to content

aerosim-open/aerosim-simulink

Repository files navigation

AeroSim - Simulink Integration

The AeroSim Simulation Platform integrates with Simulink models through:


To set up the AeroSim Simulink integration, follow these steps:

  1. From the aerosim-simulink repo's root folder, run the init_submodules.sh/bat script:

    ./init_submodules.sh # init_submodules.bat on Windows
  2. Confirm that the AEROSIM_SIMULINK_ROOT environment variable is set to the aerosim-simulink repository root folder.

  3. Run the build.sh/bat script to build the S-function MEX files into the aerosim-simulink/aerosim-sfunctions/sfun_mex/ folder:

    ./build.sh # build.bat on Windows
  4. The AeroSim block library with the S-function blocks to use these MEX files is located at aerosim-simulink/aerosim-sfunctions/aerosim_simulink_block_library.slx


To run an example co-simulation demo:

  1. Open Matlab and run the aerosim-simulink/examples/load_aerosim_simulink_cosim_demo.m example Simulink model.

  2. Launch AeroSim with a chosen renderer from the aerosim root repo folder:

    (from the aerosim repo root folder)
    aerosim/launch_aerosim.sh --unreal
    -or-
    aerosim/launch_aerosim.sh --omniverse
    
  3. Start the Simulink model. It will wait at the first clock step for AeroSim to connect and start the simulation.

  4. Start the example simulation script:

    (from the aerosim repo root folder)
    source .venv/bin/activate
    cd examples
    python simulink_cosim_and_fmu.py
    

When the simulation starts running, the Simulink model steps should start to proceed in lock-step. The Simulink model's slider bar can be used to control the target altitude live, and the Simulink model can be paused and single-stepped.

License

This project is dual-licensed under both the MIT License and the Apache License, Version 2.0. You may use this software under the terms of either license, at your option.

See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published