Keran
Keran

Reputation: 35

How to link MATLAB to Webots lib?

I created a MATLAB script for controller through wizards and uncommented desktop; keyboard; to interact with the MATLAB interface. Works are done on Win10.

My code works, but I have to start the MATLAB program from Webots to grant MATLAB access to Webots library. I tried opening MATLAB alone and had no clue about linking the program to Webots lib and project.

Another drawback is that every time I modify the codes and reset the simulation in Webots, MATLAB is restarted, which is annoying since it takes quite a time.

Q: Is there any way to link MATLAB to Webots lib so that I can develop the controller in MATLAB alone without starting Webots?

Upvotes: 0

Views: 290

Answers (1)

Ahx
Ahx

Reputation: 7985

Maybe below solve your problem.

Solution

In the launcher.m file (..\Webots\lib\controller\matlab):

  • Change each line containing 'lib/matlab' to 'lib/controller/matlab'
  • Lines are 15, 23, 132

and

In allincludes.h (..\Webots\lib\controller\matlab):

  • Change each include path so that it goes back a further directory
    • eg: #include "../../../include/controller/c/webots/accelerometer.h"

Upvotes: 2

Related Questions