Rigid bodies play an important role in Chrono as they represent parts of mechanisms. For instance, an engine is made of rigid bodies such as rods, pistons, crankshaft, valves, etc.
In some cases the rigid body assumption is an approximation of what happens in the real world. For instance the crankshaft of a car engine might have torsional and bending vibrations, but in many cases this can be neglected. If this flexibility attribute of the time evolution cannot be neglected, one should use the FEA module, which introduces flexible bodies at the cost of a more complex model definition/set up and longer run times.
The most used type of rigid bodies is the ChBody. See chrono::ChBody for API details.
- Rigid bodies inherit (in the C++ sense) from the ChFrameMoving classes and as such they have a position, rotation, velocity, and acceleration
- The position, speed, acceleration are that of the center of mass (COG)
- They have a mass and an inertia tensor
- They can be connected by ChLink constraints
- They can participate in collisions
Creating/Setting up a ChBody object typically involves the following steps:
- Create the ChBody and set its position and possibly its velocity along with its mass and inertia tensor properties
- Add the body to a chrono::ChSystem
- Optional: add collision shapes
- Optional: add visualization assets
The following example illustrates Steps 1 and 2:
This is a special type of rigid body that has an auxiliary frame that is not necessarily coincident with the COG frame.
See chrono::ChBodyAuxRef for API details.
- Inherits (in the C++ sense) from ChBody
- Handy when using a COG reference frame is cumbersome and instead another reference is preferred, for instance, coming from CAD
- Calls such as mybody->GetPos(), mybody->GetRot(), mybody->GetPos_dt(), mybody->GetWvel(), etc., will report the kinematic quantities ''for the COG frame''. If you need those of the REF, do mybody->GetFrame_REF_to_abs().GetPos(), etc.
- The REF frame is used for
The following is a short example on how to set the position of the body using the REF frame:
There are other classes that inherit from ChBody. They are specializations that introduce additional features. The most relevant classes in this context are:
The ChConveyor is a body that has a rectangular collision surface used in the simulation of a conveyor belt.
See chrono::ChConveyor for API details.
These define ready/easy-to-use bodies that simplify the definition of its attributes when the body is a simple shape such as a box, a sphere, etc. When creating one of these objects, one automatically gets:
- The mass and inertia tensor are computed from the geometry, given the density
- Optional: a visualization asset showing the shape is added automatically
- Optional: a collision shape is added automatically