/VrepSimulink

A library for Vrep/CoppeliaSim and Simulink;Vrep/CoppeliaSim和Simulink之间的通讯库

Primary LanguageMATLABMIT LicenseMIT

A simple library to link Simulink and Vrep/CoppeliaSim

1. Operations in Vrep

I have a simple mechanism with two links shown in figure below.

image-20230118171043318

All you have to do is open the main lua script and specify the port number. The default port is 19999.

image-20230118171714383

2. Operations in MATLAB/Simulink

Step1: Add toolbox to MATLAB Path and Refresh the Simulink Library

If everything is ok, you will see Vreplib displayed in Simulink Library

image-20230118172511603

Step2: Create a new simulink model and set it to Fixed-step

image-20230118172154710

The Fixed-step size should be chose as same as the dt in Vrep.

image-20230118172259049

Step3: Set the InitFun of Simulink

1). Open the Model Properties

image-20230118172759234

2). Add init function

image-20230118172957670

port = 19999; % Change according to actual situation
InitSim;

Step4: Create the model

Firstly, add the Sync Triger in the beginning of the model

image-20230118174623706

Then, add the SetJointVelocity model, you should enter joint name and confirm whether to use radian system.

image-20230118174843123

​ In the same way, configure other modules.

Step5: Enjoy it !!!

image-20230118175144887

Note:

For more detailed information, please refer to /docs/slide.ppt. and you can watch the video in https://www.bilibili.com/video/BV1M84y187R1. I will update a English version video in Youtube soon.

Implementation

Todo

4. The other blocks in coming soon !!!

5. Use in MacOS or Linux

copy the remoteApi.so ro remoteApi.dylib in it.