Matlab与V-REP联合仿真 | Joint simulation of MATLAB and V-REP
作者:互联网
Matlab与V-REP联合仿真
-
新建matlab文件夹,将vrep根目录V-REP_PRO_EDU_V3_5_0_Mac/programming/remoteApiBindings/matlab/文件拷贝进去
-
拷贝完成会有以下文件
-
Matlab中将remoteMatlabApi文件和子文件addpath
-
打开simpleTest.m,注意注释里面需要添加代码到V-REP UR5lua脚本中
-
打开V-REP,new scene,拖入一个UR5机械臂
添加代码到lua中,保存修改
simExtRemoteApiStart(19999)
-
运行V-REP仿真,再运行matlab的simpleTest.m,如下界面表示通信正常
V-REP 与 Matlab 通信的关键脚本代码如下:
% V-REP脚本:
simExtRemoteApiStart(19999)
% MATLAB端:
vrep=remApi(‘remoteApi’); % using the prototype file (remoteApiProto.m)
vrep.simxFinish(-1); % just in case, close all opened connections
clientID=vrep.simxStart(‘127.0.0.1’,19999,true,true,5000,5);
Reference:
User Manual:
http://www.coppeliarobotics.com/helpFiles/index.html
标签:仿真,REP,vrep,simulation,Joint,matlab,19999,Matlab 来源: https://blog.csdn.net/qq_29945727/article/details/98469495