P00 CoppeliaSim
P00 CoppeliaSim
Understanding CoppeliaSim
Lluís Ribas-Xirgo
Course 2020-2021
Universitat Autònoma de Barcelona
Simulators
• A computer simulator is a software that
represents the behavior of a real-world physical-system
• Game engines include physical simulators (the physics engines)
to have a realistic representation of scenes
• Simulations are used to predict the outcome of a real-world or physical
system
• Cyber-physical system simulation mixes computer simulation with
other software that takes up the controlling part
• Cybernetics refers to the “circular causal” relationship between the two,
particularly to the closed-loop control structure of the system
• Objects and other simulation artifacts are attached to programs
© 2020 Lluís Ribas i Xirgo, Universitat Autònoma de Barcelona 104544 Sistemes ciberfísics, 2
Simulators’ architecture
CoppeliaSim objects
• Scene objects
• Physical properties of simple shapes
• Visible layers on top
to improve visualization
• Objects’ interaction
• Physics engine changes object poses
in accordance to their properties
from simulated time t
to simulated time t + dt
(discrete time steps)
© 2020 Lluís Ribas i Xirgo, Universitat Autònoma de Barcelona 104544 Sistemes ciberfísics, 3
Simulators’ architecture
• Editor
• To setup the scene and
edit object-attached programs
• Simulator motor
• Runs the physics engine and
the object-attached programs
CoppeliaSim toolbar
© 2020 Lluís Ribas i Xirgo, Universitat Autònoma de Barcelona 104544 Sistemes ciberfísics, 4
Simulator motor
• Setup
• Places objects in the scene
• Runs scripts of objects
• During simulation
1. Display scene
2. Execute actuation part of scripts
3. Call physics engine
to update objects’ poses
4. Execute sensing part of scripts
5. Go back to step 1
• After simulation
• Cleanup
© 2020 Lluís Ribas i Xirgo, Universitat Autònoma de Barcelona 104544 Sistemes ciberfísics, 5
Example
• Inclined plane
© 2020 Lluís Ribas i Xirgo, Universitat Autònoma de Barcelona 104544 Sistemes ciberfísics, 6
Pre-lab
• Install CoppeliaSim
• Use P00_inclinedplane.ttt to
• Check the difference between straightforward and real-time simulation
• Play with inclination of plane and different dynamics properties of ball
• Prepare first laboratory session
• Read Q01_NinjUAB_drivers.pdf and
• Follow instructions as much further as you can
© 2020 Lluís Ribas i Xirgo, Universitat Autònoma de Barcelona 104544 Sistemes ciberfísics, 7