VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void...
Transcript of VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void...
![Page 1: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/1.jpg)
V-‐REP and its Matlab interface
Marc Freese
www.coppeliarobo0cs.com
![Page 2: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/2.jpg)
Robot simulator
![Page 3: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/3.jpg)
Why simula:on ?
![Page 4: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/4.jpg)
Some examples
![Page 5: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/5.jpg)
Scene Objects
Calcula0on Modules
Control Mechanisms
3 Central Elements
![Page 6: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/6.jpg)
Scene Objects
Scene Objects
Shapes
Joints Cameras Lights
Dummies / reference frames
Graphs
Paths / trajectories
Proximity sensors
Force / torque sensors
Vision sensors Mills
Mirrors
![Page 7: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/7.jpg)
Calcula0on Modules
Calcula0on Modules
Minimum distance calcula0on
Physics / Dynamics
Forward / Inverse kinema0cs
Path / mo0on planning
Collision detec0on
![Page 8: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/8.jpg)
Kinema0cs and Distance Calcula0on
Inverse / forward Kinema0cs • Any mechanism: redundant, branched, closed, etc.
• Damped / undamped resolu0on
• Weighted resolu0on
• Condi0onal resolu0on
• Obstacle avoidance
Any mesh (also open / concave / polygon soups)
Collision Detec0on
![Page 9: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/9.jpg)
Collision Detec0on and Path Planning
Path / Mo0on Planning • Holonomic in 2-‐6 dimensions
• Non-‐holonomic for car-‐like vehicles
• Mo0on planning for kinema0c chains
Any mesh (also open / concave / polygon soups)
Minimum Distance Calcula0on
![Page 10: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/10.jpg)
Dynamics
• 3 physics engines:
• Simple mouse click to switch
• Dynamic par0cles to simulate air or water jets
• Can work hand-‐in-‐hand with kinema0cs module
Dynamics / Physics Bullet Physics Open Dynamics Engine Vortex Dynamics
![Page 11: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/11.jpg)
Control Mechanisms
Control Mechanisms
Add-‐ons
Remote API clients Plugins
ROS nodes
Custom solu0ons
Embedded scripts
![Page 12: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/12.jpg)
Control Mechanisms
Local and Remote Interfaces Local (i.e. same process)
Sync.* or async.* opera0on
Remote (i.e. different process / hardware) Async.* opera0on
Add-‐ons
Remote API clients Plugins
ROS nodes
Custom solu0ons
Embedded scripts
*Synchronous to the simula0on loop
![Page 13: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/13.jpg)
Embedded Script Advantages 1/4
Simula0on model
(meshes, joints, sensors, etc.)
Plugin
(controller)
+
2 items
Simula0on model
(meshes, joints, sensors, etc.)
+ controller
1 item
Plugins Embedded scripts Controller Integra:on
![Page 14: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/14.jpg)
Embedded Script Advantages 2/4
Plugin has to manage instances Scalability is inherent
Plugins
Simula0on model 2 Plugin
Simula0on model 1
Simula0on model 3
Simula0on model 2
Simula0on model 1
Simula0on model 3
Embedded scripts Scalability
![Page 15: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/15.jpg)
Embedded Script Advantages 3/4
High chances for conflicts No chances for conflicts
Simula0on model 2 (version 1)
Plugin (version 1)
Simula0on model 1 (version 1)
Simula0on model 1 (version 2)
Simula0on model 2 (version 1)
Simula0on model 1 (version 1)
Simula0on model 1 (version 2)
Plugin (version 2)
Plugins Embedded scripts Version Conflicts
![Page 16: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/16.jpg)
Embedded Script Advantages 4/4
Plugin Simula0on model
Plugin source Simula0on model Plugin source
Plugin source
Simula0on model
Simula0on model
Many files Compila0on required OS-‐specific problems
1 file No compila0on required No OS-‐specific problems
Same OS Same OS
2 files 1 file
Different OS Different OS
Plugins Embedded scripts Portability
![Page 17: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/17.jpg)
Embedded Scripts – Simple Example
Embedded script
Hokuyo simula0on model
Shape
Joint Proximity sensor
Hokuyo model hierarchial representa0on Hexapod
simula0on model
Distance sampling rays
Detected points
![Page 18: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/18.jpg)
Collabora0ve Control Mechanisms
Add-‐ons
Remote API clients Plugins
ROS nodes
Custom solu0ons
Embedded scripts
![Page 19: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/19.jpg)
void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“ ) } // Initialization phase of plugin: register new script commands: #define SCRIPT_DO_SOME_MAGIC "simExt_doSomeMagic" int inArgs[]={2,sim_lua_arg_int,sim_lua_arg_float|sim_lua_arg_table}; simRegisterCustomLuaFunction(SCRIPT_DO_SOME_MAGIC,strConCat("number value1,
number value2=",SCRIPT_DO_SOME_MAGIC,"(number index,table inVals)"), inArgs,SCRIPT_DO_SOME_MAGIC_CALLBACK);
Example of Collabora0ve Mechanism 1 / 3
returnData1,returnData2=simExt_doSomeMagic(arg1,arg2)
Registers and handles the custom script API func0on „simExt_doSomeMagic“
Calls the custom API func0on „simExt_doSomeMagic“ Embedded
script
Plugin
![Page 20: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/20.jpg)
Example of Collabora0ve Mechanism 2 / 3
-- Following in the script initialization phase (executed just once): -- Retrieve the handle of the vision sensor we wish to stream: visionSensorHandle=simGetObjectHandle('Vision_sensor') -- Now enable topic publishing and streaming of the vision sensor's data: topicName=simExtROS_enablePublisher('visionSensorData',1,
simros_strmcmd_get_vision_sensor_image,visionSensorHandle,0,'') -- Retrieve the handle of the passive vision sensor. We will use -- the passive vision sensor to visualize received data: passiveSensorHandle=simGetObjectHandle('PassiveVision_sensor') -- Now enable a topic subscription: simExtROS_enableSubscriber(topicName,1,
simros_strmcmd_set_vision_sensor_image,passiveSensorHandle,0,'')
Enable image streaming to ROS
Enable image streaming from ROS
Embedded script
ROS Framework
![Page 21: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/21.jpg)
int pos[3]={1.0f,2.0f,3.0f}; simxAppendStringSignal("objCreation",(simxChar*)pos,3*4,simx_opmode_oneshot);
Example of Collabora0ve Mechanism 3 / 3
signalData=simGetStringSignal("objCreation") simClearStringSignal("objCreation") if signalData then data=simUnpackFloats(signalData) for i=0,(#data-1)/3,1 do handle=simCreatePureShape(2,22,{0.1,0.1,0.1},0.1) simSetObjectPosition(handle,-1,{data[3*i+1],data[3*i+2],data[3*i+3]}) end end
Appends coordinate informa0on to the signal „objCrea0on“
Creates cylinders at the coordinates indicated in the signal „objCrea0on“
Remote API client
Embedded script
![Page 22: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/22.jpg)
Remote API
V-‐REP
... . . ... .
... . .. . .
.. .. ... . ...
Matlab/Octave
C/C++ Python
Urbi
Java
Runs on any hardware, lightweight, several languages
![Page 23: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/23.jpg)
Remote API
V-‐REP ... . . ... . ... . .. . . .. .. ... . ...
Remote API client (e.g. Matlab)
Server Client
![Page 24: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/24.jpg)
Remote API
Remote API server service
Remote API client
simExt_remoteApiStart(portNb) vrep=remApi('remoteApi'); clientID=vrep.simxStart(ip,portNb,..);
V-REP Matlab
Remote API
server service
Remote API
server service
Remote API client
Remote API client Remote
API server service
Remote API
server service
Remote API client
Java
Remote API client
Python
C/C++ Octave
Urbi
![Page 25: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/25.jpg)
Remote API
int returnCode=simxGetJointPosition(jointHandle,&position,operationMode);
Remote API func0on Regular arguments
• simx_opmode_oneshot • simx_opmode_oneshot_wait • simx_opmode_streaming • simx_opmode_discontinue • simx_opmode_buffer • etc.
• simx_return_ok • simx_return_timeout_flag • simx_return_novalue_flag • simx_return_remote_error_flag • simx_return_local_error_flag • etc.
Blocking mode
On client side:
![Page 26: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/26.jpg)
Blocking func0on call
V-REP
Matlab
Remote API server service Remote
API client
[result,position]=vrep.simxGetJointPosition(clientID,jointHandle, vrep.simx_opmode_oneshot_wait);
TCP
![Page 27: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/27.jpg)
Non-‐blocking func0on call
V-REP
Matlab
Remote API server service Remote
API client
vrep.simxSetJointPosition(clientID,jointHandle,jointPosition, vrep.simx_opmode_oneshot);
TCP
![Page 28: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/28.jpg)
Data streaming – enabling it
V-REP
Matlab
Remote API server service Remote
API client
vrep.simxGetJointPosition(clientID,jointHandle, vrep.simx_opmode_streaming);
TCP
![Page 29: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/29.jpg)
V-REP
Matlab
Remote API server service Remote
API client
[result,position]=vrep.simxGetJointPosition(clientID,jointHandle, vrep.simx_opmode_buffer);
Data streaming – reading streamed data
![Page 30: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/30.jpg)
V-REP
Matlab
Remote API server service Remote
API client
WRONG: vrep.simxGetJointPosition(clientID,jointHandle, vrep.simx_opmode_streaming); [result,position]=vrep.simxGetJointPosition(clientID,jointHandle, vrep.simx_opmode_buffer);
CORRECT: vrep.simxGetJointPosition(clientID,jointHandle, vrep.simx_opmode_streaming); while (vrep.simxGetConnectionId(clientID)~=-1) [result,position]=vrep.simxGetJointPosition(clientID,jointHandle, vrep.simx_opmode_buffer); if (result==vrep.simx_return_ok) % position is valid here! end end
Data streaming – overview
![Page 31: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/31.jpg)
Remote API – real-‐0me vs non real-‐0me
Remote API server service
Remote API client
V-REP Matlab t=0 t=1 t=2 t=3 t=4 t=5 t=6 t=7 t=8 t=9 t=10 t=11
t=0 t=1 t=2 t=3
Non real-time Real-time (and asynchronous)
![Page 32: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/32.jpg)
Remote API – real-‐0me vs real-‐0me
Remote API server service
Remote API client
V-REP Matlab t=0 t=1 t=2 t=3 t=4 t=5 t=6 t=7 t=8 t=9 t=10 t=11
t=0 t=1 t=2 t=3 t=4 t=5 t=6 t=7 t=8 t=9 t=10 t=11
Real-time Real-time (and asynchronous)
![Page 33: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/33.jpg)
Remote API -‐ synchronized opera0on
Remote API server service
Remote API client
V-REP Matlab t=0 t=1 t=2 t=3 t=4 t=5 t=6 t=7 t=8 t=9 t=10 t=11
t=0 t=1 t=2 t=3 t=4 t=5 t=6 t=7 t=8 t=9 t=10 t=11
Non real-time Non real-time (and synchronous)
simxSynchronous
simxSynchronousTrigger
![Page 34: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/34.jpg)
Matlab Remote API – what is needed
- remApi.m
- remoteApiProto.m
- remoteApi.dll (or remoteApi.dylib, or remoteApi.so)
![Page 35: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/35.jpg)
Questions?
![Page 36: VREP& - Teaching Roboticsteaching-robotics.org/trs2014/data/marc.pdf · void SCRIPT_DO_SOME_MAGIC_CALLBACK(SLuaCallBack* p) { ... ( gets called when a script calls „simxExt_doSomeMagic“](https://reader030.fdocuments.net/reader030/viewer/2022040607/5ebfd4e94b38b556ce520373/html5/thumbnails/36.jpg)