Articles & Tutorials

Making V-REP work

V-REP is a great robotics simulator, but it’s been ages since I last used it.  I installed the latest version and ran into a few issues.  The solutions are below.  I’m using VREP 3.5 under Mojava.

1. File permissions

V-REP complains about not being able to find the models.  By default the files have an attribute which V-REP doesn’t like. Remove it by going into the V-REP install folder

% sudo xattr -r -d *

2. Setting the environment variable

You can hardwire this into your MATLAB code with 

>> vrep = VREP('path', '/Applications/V-REP_PRO_EDU_V3_5_0_Mac')

but if you want to have it default to the correct path you need to set the environment variable so that it will be seen by a launching app. It needs to be set in the system-wide launch environment and that requires 

% cd ~/Library/LaunchAgents
% cat > environment.plist
<plist version="1.0"> <dict>  <key>Label</key>  <string>my.startup</string>  <key>ProgramArguments</key>  <array>   <string>sh</string>   <string>-c</string>   <string>launchctl setenv VREP /Applications/V-REP_PRO_EDU_V3_5_0_Mac </string>  </array>  <key>RunAtLoad</key>  <true/> </dict> </plist>
% launchctl load ~/Library/LaunchAgents/environment.plist
% launchctl start ~/Library/LaunchAgents/environment.plist

The launchctl lines just need to be done once, the environment will be loaded automatically the next time you login or reboot.

View all posts