Webots and MATLAB joint simulation environment configuration

1. Version

System: Win10
matlab version: 2023a
webots version: R2020b

2. Install MATLAB MinGW-w64 C/C++ Compiler

Before using matlab to write a controller, you need to install MATLAB MinGW-w64 C/C++ Compiler for matlab, because matlab needs to interact with c.
Download address
https://ww2.mathworks.cn/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-cc-compilerInsert image description here

After downloading MATLAB MinGW-w64 C/C++ Compiler, open matlab

Insert image description here

Install

Insert image description here
Insert image description here
Insert image description here

3. Configure environment variables

Add your own matlab and webots installation paths to the system environment variables accordingly. My setup looks like this:
1st
Insert image description here
2nd
Insert image description here
3rd
Insert image description here

4. Test

Open the case "WEBOTS_HOME/projects/languages/matlab/worlds/e-puck_matlab.wbt" that comes with webots
file>open sample world
Insert image description here
and click OK.
Insert image description here
Select the matlab controller
Insert image description here
and click run Insert image description here
. The appearance of this means that the test is successful, and matlab and webots can achieve joint debugging.
Insert image description here

Guess you like

Origin blog.csdn.net/iii66yy/article/details/132096801