问题:
socket 阻塞 非阻塞 同步 异步 verp
remote API和regular API 的区别
remote API
什么是remote API:
V-REP offers a remote API allowing to control a simulation (or the simulator itself) from an external
application or a remote hardware (e.g. real robot, remote computer, etc.). The V-REP remote API is
composed by approximately one hundred specific functions and one generic function, that can be called
from a C/C++ application, a Python script, a Java application, a Matlab/Octave program, or a Lua script.
The remote API functions are interacting with V-REP via socket communication (or, optionally, via shared
memory) in a way that reduces lag and network load to a great extent. All this happens in a hidden fashion
to the user. The remote API can let one or several external applications interact with V-REP in a
synchronous* or asynchronous* way (asynchronous by default), and even remote control of the simulator
is supported (e.g. remotely loading a scene, starting, pausing or stopping a simulation for instance).
总而言之,remote API 可以通过socket来控制仿真,控制verp里的机器人。
作为客户端:
the client side (i.e. your application): the remote API on the client side is available for many
different programming languages. Currently following languages are supported: C/C++, Python, Java,
Matlab, Octave and Lua. Bindings for other languages can easily be created by yourself. Instructions on
how to enable the remote API on the client side are given here(例子).
作为服务器端:
the server side (i.e. V-REP): the remote API on the server side is implemented via a V-REP
plugin that should be loaded by V-REP by default: v_repExtRemoteApi.dll, libv_repExtRemoteApi.dylib
or libv_repExtRemoteApi.so. The plugin project files are located here. Instructions on how to enabled
the remote API on the server side are given here(例子).
regular API
The regular API is composed by several hundreds of functions that can be called from a C/C++ application
(plugin or main client application), or an embedded script. V-REP functions and constants can easily be
recognized from their “sim”- or “_sim”-prefix (e.g. sim.handleCollision).
区别:
1.regular API命名规则
- Lua写的 前缀是 sim.,后面的命名要小写例如sim.getReferencedHandles (Lua)
- c/c++写的前缀是 sim,后面的命名要大写例如simGetReferencedHandles(c/c++)
2.remote API命名规则
前缀是simx,后面的命名要大写例如simxGetObjectQuaternion,编写语言支持c、c++,python,lua,matlab,java
Remote API modus operandi
remote API的操作模式具体还是要看文档。主要由于它是socket。所以它涉及了阻塞,费阻塞,同步,异步等内容。
Remote API function 调用默认情况下是异步的。