The process of incorporating sensors depends on whether the model is developed in MATLAB or Simulink. For models in MATLAB, here are the steps to add sensors:
- Create and initialize gpsSensor and imuSensor objects.
- Set up an insfilterMARG filter to perform sensor fusion with GPS and IMU readings.
- Use these sensors within the simulation loop to obtain position and orientation data from actual acceleration, angular velocity, and orientation.
A detailed example can be found here:
For models in Simulink, the IMU and AHRS blocks can simulate the presence of an IMU sensor.
However, there is no built-in block to fuse GPS measurements with IMU measurements, as seen here:
The INS block can simulate an INS sensor, but sensor fusion will need to be designed manually. Here are the relevant documentation links for the R2021a version: