Tips and Tricks - dqrobotics/learning-dqrobotics-with-coppeliasim GitHub Wiki
The lessons assume you have installed a working CoppeliaSim with the remoteApi. Nonetheless, you are not expected to use it directly because DQ Robotics has a wrapper that exposes only the functionalities you need, in DQ Robotics style.
Make sure you have the following files in your working directory, in order to run the various examples:
remApi.m
remoteApiProto.m
In CoppeliaSim v4.7.0, and likely in other versions, they can be found in
[COPPELIA_SIM_FOLDER]/coppeliaSim.app/Contents/Resources/programming/remoteApiBindings/matlab/matlab
In addition to remApi.m
and remoteApiProto.m
, you must add the appropriate remoteApi library file, remoteApi.dylib
, to your working folder. In CoppeliaSim v4.7.0, you can find it on
[COPPELIA_SIM_FOLDER]/coppeliaSim.app/Contents/Resources/programming/remoteApiBindings/lib/lib/MacOS
Make sure to have the server side running in CoppeliaSim. In a child script of a CoppeliaSim scene, add the following command to be executed just once, at simulation start:
simRemoteApi.start(19997, 1300, false, true)
The first parameter, 19997, is the communication port. The second is the packet size (1300 is the default value), and the third is the debug mode. The last indicates if we want to use synchronous mode.
IMPORTANT: for each successful call to simxStart
, there should be a corresponding call to simxFinish
at the end!
- You must add the appropriate remoteApi library file to your working folder: remoteApi.dll for Windows and remoteApi.so for Linux.
If a scene contains the command simRemoteApi.start(19997)
inside a child script, you must remove it if the continuous legacy remote API server service is used. Otherwise, the client will not connect to the CoppeliaSim server.