Tutorials
From ChronoWiki
The following is the list of all tutorials available for the Chrono::Engine, they represent a good starting point to learn programming with this multibody library.
Source code for all the examples presented in these tutorials is included in the SDK. (Note: the actual C++ code of the examples in the SDK might be slightly different because we constantly update them.)
Contents |
Demos with Irrlicht 3D interface
These examples are the most descriptive and amusing, since they show Chrono::Engine features within a graphical user interface, using a realtime 3D visualization engine called Irrlicht. (To compile these examples you must install also the Irrlicht API on your computer) . These demos are also available as precompiled binaries in the Chrono::Engine directory bin/Win32_VisualStudio/, if you used the installer of the Simplified_installation. To play the precompiled binaries you don't need Irrlicht installed on your computer.
We used Irrlicht, but of course you can use alternative libraries, such as GLUT, OpenGL, Ogre, etc. Consider these tutorial as suggestions. The visualization runs in real-time for most systems with a decent graphic adaptor and a recent processor.
|
The simpliest way to integrate Chrono::Engine in the Irrlicht 3D visualization library: in fact the coordinates of the joints are simply used as end-points of simple polygonal lines which are drawn in the 3D space for each frame redraw, to show a very simplified 'skeleton' of a slider-crank mechanism. The demo also teaches how to:
|
|
This tutorial is similar to the demo_crank example, but here a small user-interface is created, so that the user can play with a slider to modify the speed of the motor. The user interface is created with simple GUI features of Irrlicht, but other kind of interfaces/visualization systems could be used. Here you can also learn
|
|
A bunch of random shapes will fall into a box, stacking in random order. Differently from the two examples above, here a special object is used to encapsulate Chrono::Engine rigid bodies, and some 'shortcuts' are used to manage them in Irrlicht. Learn about:
|
|
Another tutorial about collisions. Create a stack of geometric primitives. Learn about:
|
|
Create some swinging pendulums, anchored to sliding joints. They move when the fan pushes some air toward them. This tutorial shows how to:
|
|
Create a transmission made of pulleys, spur gears, bevel gears. Custom simplified constraints are available, to avoid the simulation of contacts between gear teeth. This tutorial shows how to:
|
|
Simulate a small mobile robot with omnidirectional 'mecanum' wheels. Use keyboard to perform basic motion. This tutorial shows how to:
|
|
A benchmark that show the feature of spinning friction (aka 'drilling' friction) and rolling friction. These types of frictions are useful for rolling objects like wheels, spheres etc. and can be optionally turned on. This tutorial shows how to:
|
|
Simulate a simplified vehicle with double-wishbone suspensions (like racing cars) and drive it using the mouse over some sliders in the interface. This tutorial shows how to:
|
|
Simulate a simplified vehicle with tracks, that interact with obstacles, and that can be driven by the user. This tutorial shows how to:
|
Core features
These examples are about the basic features of the Chrono::Engine programming system, which can be used also for non-physics stuff. Some of these tutorials can be skipped (they deal with 'low level' stuff..).
|
Demo on how to use Chrono mathematical objects and functions (vector math, matrices, linear algebra, etc.). No GUI: only text output. |
|
Tutorial on how to perform 3D coordinate manipulation (rotation and translations of points, frames, etc.) thank to C++ objects and custom operators introduced in Chrono::Engine. No GUI: only text output. |
|
Tutorial on files, streams, serialization. Learn:
No GUI: only text output. |
|
Tutorial on how Chrono::Engine core functionality can handle smart pointers and shared objects. These smart pointers can be useful also in projects non related to physics simulation too. No GUI: only text output. |
Basics
These tutorials teach how to setup physical systems in Chrono::Engine. Here we do not use any graphical user interface: see the 'Irrlicht' tutorials for demos with a 3D graphical output.
|
Tutorial which teaches the basic approach to build and simulate mechanical systems. No 3D user interface is used here, so you compile this example even if you do not have Irrlicht 3D visualization library installed. Learn how:
No GUI: only text output. |
|
Tutorial which teaches the basic approach to build systems that embed powertrains, made with 1-degree-of-freedom items (rotating shafts).
No GUI: only text output. |
|
Tutorial that teaches how to use the ChFunction inherited classes to build math functions of y=f(x) type. The ChFunction objects are 'building blocks' whose main usage is to describe motion laws, such as trajectories in automation and robotics, etc.
No GUI: only text output. |
MS VisualStudio C++ IDE
Compile an develop Chrono::Engine applictions without using the CMake system. These examples are contained in the demo/msvc/ directory. Read the README.TXT for informations about how to configure your Microsoft VisualStudio IDE.
|
Develop a C++/CLI .NET application that uses Chrono::Engine and embeds a small Irrlicht view. Of course you are not forced to embed the Irrlicht 3D viewing system in the GUI of your .NET projects, but this is a general example - if you prefer, you can use directly OpenGL or DirectX or other methods. This tutorial shows how to:
|
|
This is not a ready-to-use example, but it is a tutorial on how to use the ChronoEngineWizard in your Microsoft Visual C++ Express IDE to set up quickly a new project. This tutorial shows how to:
|
Matlab
If you own a copy of the Matlab(TM) software, you can interact with it from Chrono::Engine, in order to plot data, make complex computations, perform co-simulations, etc.
|
Entry level demo about how to use Matlab(TM) to plot Chrono::Engine data, to perform computations, etc. This example requires that you own a copy of Matlab(TM), properly installed on your system (if you do not have Matlab(TM) installed and you try to execute demo_matlab.exe, it will give an error because it cannot load the Matlab engine dll). This tutorial shows how to:
|
|
Use Matlab(TM) to plot Chrono::Engine ChFunction objects. This example requires that you own a copy of Matlab(TM), properly installed on your system (if you do not have Matlab(TM) installed and you try to execute demo_matlab.exe, it will give an error because it cannot load the Matlab engine dll). This tutorial shows how to:
|
Co-simulation with Simulink
If you own a copy of the Simulink software, you can use the cosimulation unit in order to simulate pneumatic, hydraulic, electrical subsystems that interact with mechanisms modeled in Chrono::Engine.
|
Tutorial that covers the fundamentals concepts of Simulink<->Chrono::Engine cosimulation, with the following example: an hydraulic piston moves a rigid body connected to a hinge.
|
OpenCascade
These examples are only for users that have installed the OpenCASCADE library, because the CASCADE unit is used in these tutorials. Thank to this additional module it is possible to load 3D CAD files saved in the STEP format.
|
This example builds a minimal application where the user can load a STEP model into the Irrlicht 3D visalization window. This tutorial shows how to:
|
|
Entry level example that shows how to use the CASCADE unit to load a 3D STEP model saved from a professional CAD software. This tutorial shows how to:
|
|
Advanced example that shows how to use the CASCADE unit to load a 3D STEP model of a robot, containing many parts. This tutorial shows how to:
|
PyChrono::Engine
These examples are only for users that are using PyChrono::Engine, that is the Python module for using Chrono::Engine with Python.
|
Learn the basics of Python interoperation with Chrono::Engine.
|
|
Basic creation of a physical system and rigid bodies.
|
|
Create a postprocessing system based on POVray.
|
SolidWorks Add-In
Tutorials for users that installed the Chrono::Engine for SolidWorks Add-In into their SolidWorks CAD.
|
Learn the basics of Chrono::Engine for SolidWorks Add-In
|
|
Tips for advanced use of Chrono::Engine for SolidWorks Add-In, with some Python tricks and tips for:
|
|
This tutorial is about how to define collision shapes when using the Chrono::Engine for SolidWorks Add-In.
|

















