Professional Documents
Culture Documents
V Rep13
V Rep13
13
SIMULATION
Simulation
A simulation in V-REP can be started, paused and
stopped with [Menu bar --> Simulation -->
Start/Pause/Stop simulation] or through the related
toolbar buttons:
Internally, the simulator will use additional intermediate states in order to correctly inform
scripts or programs about what will happen next. Following state diagram illustrates the
simulator's internal states:
Simulation loop
The simulator operates by advancing the simulation time at constant time
steps. Following figure illustrates the main simulation loop:
Real-time simulation is supported by trying to keep the simulation time synchronized with the real
time:
Following represents a very simplified main client application (messaging, plugin handling and other
details have been omitted for clarity purpose):
Simulation |
Simulation speed
In the case of a real-time simulation, the simulation speed mainly depends
on the real-time multiplication coefficient, but also to a certain degree of the
simulation time step. During simulation, the simulation speed can be
adjusted with following toolbar buttons:
The simulation speed is adjusted in a way so that the initial simulation time step is never increased
(because this might have as consequence the breaking of a mechanism for example). Following two
figures illustrate the simulation speed adjustment mechanisms:
The simulation speed is adjusted in a way so that the initial simulation time step is never increased
(because this might have as consequence the breaking of a mechanism for example). Following two
figures illustrate the simulation speed adjustment mechanisms:
Threaded rendering
The rendering operation will always increase the simulation cycle duration,
thus also slowing down simulation speed. For those situations, a threaded
rendering mode can be activated via the user settings, or via the following
toolbar button:
When the threaded rendering mode is activated, a simulation cycle will only
consist in execution of the main script, thus simulations will run at maximum
speed. Rendering will happen via a different thread, and not slow down the
simulation task. The drawbacks have however to be considered. When
threaded rendering is activated, then:
Simulation |Threaded rendering
Simulation dialog
The simulation dialog can be accessed with [Menu bar --> Simulation -->
Simulation settings] or by clicking following toolbar button:
• Time step: the simulation time step. Each time the main script was
executed, the simulation time is incremented by the simulation time step.
Using large time steps results in fast but inaccurate/unstable simulations.
Small time steps on the other hand will (generally) lead to more precise
simulations, but will take more time. It is highly recommended to keep a
default time step.
Simulation |Simulation dialog
• Simulation passes per frame (ppf): the number of simulation passes for
one rendering pass. A value of 10 would mean that the main script is
executed 10 times (10 simulation steps) before the screen is refreshed. If
you have a slow graphic card, you can choose to display only one frame
out of two for instance.
Simulation |Simulation dialog
• Reset scene to initial state: when selected, then all objects will
be reset to their initial state: this includes the object local
position, local orientation and its parent, joint and path intrinsic
positions, floating view positions and sizes, etc. This means that
the next simulation run will execute in a same way as previous
one, unless heavy changes were undertaken (shape scaling,
object removal, etc.).