ObjectRigidBody
A 3D rigid body which is attached to a 3D rigid body node. The rotation parametrization of the rigid body follows the rotation parametrization of the node. Use Euler parameters in the general case (no singularities) in combination with implicit solvers (GeneralizedAlpha or TrapezoidalIndex2), Tait-Bryan angles for special cases, e.g., rotors where no singularities occur if you rotate about \(x\) or \(z\) axis, or use Lie-group formulation with rotation vector together with explicit solvers. REMARK: Use the class RigidBodyInertia
, see Section Class function: __init__ and AddRigidBody(...)
, see Section Function: AddRigidBody, of exudyn.rigidBodyUtilities
to handle inertia, COM and mass. addExampleImage{ObjectRigidBody}
Additional information for ObjectRigidBody:
- This
Object
has/provides the following types =Body
,SingleNoded
- Requested
Node
type =Position
+Orientation
+RigidBody
- Short name for Python =
RigidBody
- Short name for Python visualization object =
VRigidBody
The item ObjectRigidBody with type = ‘RigidBody’ has the following parameters:
- name [type = String, default = ‘’]:objects’s unique name
- physicsMass [\(m\), type = UReal, default = 0.]:mass [SI:kg] of rigid body
- physicsInertia [\(\LU{b}{{\mathbf{j}}_6}\), type = Vector6D, default = [0.,0.,0., 0.,0.,0.]]:inertia components [SI:kgm\(^2\)]: \([J_{xx}, J_{yy}, J_{zz}, J_{yz}, J_{xz}, J_{xy}]\) in body-fixed coordinate system and w.r.t. to the reference point of the body, NOT necessarily w.r.t. to COM; use the class RigidBodyInertia and AddRigidBody(…) of exudynRigidBodyUtilities.py to handle inertia, COM and mass
- nodeNumber [\(n0\), type = NodeIndex, default = invalid (-1)]:node number (type NodeIndex) for rigid body node
- visualization [type = VObjectRigidBody]:parameters for visualization of item
The item VObjectRigidBody has the following parameters:
- show [type = Bool, default = True]:set true, if item is shown in visualization and false if it is not shown
- graphicsDataUserFunction [type = PyFunctionGraphicsData, default = 0]:A Python function which returns a bodyGraphicsData object, which is a list of graphics data in a dictionary computed by the user function; the graphics elements need to be defined in the local body coordinates and are transformed by mbs to global coordinates
- graphicsData [type = BodyGraphicsData]:Structure contains data for body visualization; data is defined in special list / dictionary structure
DESCRIPTION of ObjectRigidBody
The following output variables are available as OutputVariableType in sensors, Get…Output() and other functions:
Position
: \(\LU{0}{{\mathbf{p}}}\cConfig(\pLocB) = \LU{0}{\pRef}\cConfig + \LU{0}{\pRef}\cRef + \LU{0b}{\Rot}\pLocB\)global position vector of body-fixed point given by local position vector \(\pLocB\)Displacement
: \(\LU{0}{{\mathbf{u}}}\cConfig + \LU{0b}{\Rot}\pLocB\)global displacement vector of body-fixed point given by local position vector \(\pLocB\)Velocity
: \(\LU{0}{{\mathbf{v}}}\cConfig(\pLocB) = \LU{0}{\dot{\mathbf{u}}}\cConfig + \LU{0b}{\Rot}(\LU{b}{\tomega} \times \pLocB\cConfig)\)global velocity vector of body-fixed point given by local position vector \(\pLocB\)VelocityLocal
: \(\LU{b}{{\mathbf{v}}}\cConfig(\pLocB) = \LU{b0}{\Rot} \LU{0}{{\mathbf{v}}}\cConfig(\pLocB)\)local (body-fixed) velocity vector of body-fixed point given by local position vector \(\pLocB\)RotationMatrix
: \(\mathrm{vec}(\LU{0b}{\Rot})=[A_{00},\,A_{01},\,A_{02},\,A_{10},\,\ldots,\,A_{21},\,A_{22}]\cConfig\tp\)vector with 9 components of the rotation matrix (row-major format)Rotation
:vector with 3 components of the Euler angles in xyz-sequence (R=Rx*Ry*Rz), recomputed from rotation matrixAngularVelocity
: \(\LU{0}{\tomega}\cConfig\)angular velocity of bodyAngularVelocityLocal
: \(\LU{b}{\tomega}\cConfig\)local (body-fixed) 3D velocity vector of nodeAcceleration
: \(\LU{0}{{\mathbf{a}}}\cConfig(\pLocB) = \LU{0}{\ddot{\mathbf{u}}} + \LU{0}{\talpha} \times (\LU{0b}{\Rot} \pLocB) + \LU{0}{\tomega} \times ( \LU{0}{\tomega} \times(\LU{0b}{\Rot} \pLocB))\)global acceleration vector of body-fixed point given by local position vector \(\pLocB\)AccelerationLocal
: \(\LU{b}{{\mathbf{a}}}\cConfig(\pLocB) = \LU{b0}{\Rot} \LU{0}{{\mathbf{a}}}\cConfig(\pLocB)\)local (body-fixed) acceleration vector of body-fixed point given by local position vector \(\pLocB\)AngularAcceleration
: \(\LU{0}{\talpha}\cConfig\)angular acceleration vector of bodyAngularAccelerationLocal
: \(\LU{b}{\talpha}\cConfig = \LU{b0}{\Rot} \LU{0}{\talpha}\cConfig\)local angular acceleration vector of body
Definition of quantities
intermediate variables
|
symbol
|
description
|
---|---|---|
inertia tensor
|
\(\LU{b}{{\mathbf{J}}} = \LU{b}{\mr{J_{xx}}{J_{xy}}{J_{xz}} {J_{xy}}{J_{yy}}{J_{yz}} {J_{xz}}{J_{yz}}{J_{zz}}}\)
|
symmetric inertia tensor, based on components of \(\LU{b}{{\mathbf{j}}_6}\), in body-fixed (local) coordinates and w.r.t.body’s reference point
|
reference coordinates
|
\({\mathbf{q}}\cRef = [\pRef\tp\cRef,\,\tpsi\tp\cRef]\tp\)
|
defines reference configuration, DIFFERENT meaning from body’s reference point!
|
(relative) current coordinates
|
\({\mathbf{q}}\cCur = [\pRef\tp\cCur,\,\tpsi\tp\cCur]\tp\)
|
unknowns in solver; relative to the reference coordinates; current coordinates at initial configuration = initial coordinates \({\mathbf{q}}\cIni\)
|
current velocity coordinates
|
\(\dot {\mathbf{q}}\cCur = [{\mathbf{v}}\tp\cCur,\,\dot \tpsi\tp\cCur]\tp = [\dot {\mathbf{p}}\tp\cCur,\,\dot \ttheta\tp\cCur]\tp\)
|
current velocity coordinates
|
body’s reference point
|
\(\pRefG\cConfig + \pRefG\cRef = \LU{0}{{\mathbf{p}}}(n_0)\cConfig\)
|
position of body’s reference point provided by node \(n_0\) in any configuration except for reference; if \(\LU{b}{{\mathbf{b}}_{COM}}==[0,\;0,\;0]\tp\), this position becomes equal to the COM position
|
reference body’s reference point
|
\(\pRefG\cRef = \LU{0}{{\mathbf{p}}}(n_0)\cRef\)
|
position of body’s reference point in reference configuration
|
body’s reference point displacement
|
\(\LU{0}{{\mathbf{u}}}\cConfig = \pRefG\cConfig = [q_0,\;q_1,\;q_2]\cConfig\tp = \LU{0}{{\mathbf{u}}}(n_0)\cConfig\)
|
displacement of body’s reference point which is provided by node \(n_0\) in any configuration
|
body’s reference point velocity
|
\(\LU{0}{{\mathbf{v}}}\cConfig = \dot \pRefG\cConfig = [\dot q_0,\;\dot q_1,\;\dot q_2]\cConfig\tp = \LU{0}{{\mathbf{v}}}(n_0)\cConfig\)
|
velocity of body’s reference point which is provided by node \(n_0\) in any configuration
|
body’s reference point acceleration
|
\(\LU{0}{{\mathbf{a}}}\cConfig = [\ddot q_0,\;\ddot q_1,\;\ddot q_2]\cConfig\tp\)
|
acceleration of body’s reference point which is provided by node \(n_0\) in any configuration
|
rotation coordinates
|
\(\ttheta_{\mathrm{config}} = \tpsi(n_0)\cRef + \tpsi(n_0)\cConfig\)
|
(total) rotation parameters of body as provided by node \(n_0\) in any configuration
|
rotation parameters
|
\(\ttheta_{\mathrm{config}} = \tpsi(n_0)\cRef + \tpsi(n_0)\cConfig\)
|
(total) rotation parameters of body as provided by node \(n_0\) in any configuration
|
body rotation matrix
|
\(\LU{0b}{\Rot}\cConfig = \LU{0b}{\Rot}(n_0)\cConfig\)
|
rotation matrix which transforms local to global coordinates as given by node
|
local position
|
\(\pLocB = [\LU{b}{b_0},\,\LU{b}{b_1},\,\LU{b}{b_2}]\tp\)
|
local position as used by markers or sensors
|
angular velocity
|
\(\LU{0}{\tomega}\cConfig = \LU{0}{[\omega_0(n_0),\,\omega_1(n_0),\,\omega_2(n_0)]}\cConfig\tp\)
|
global angular velocity of body as provided by node \(n_0\) in any configuration
|
local angular velocity
|
\(\LU{b}{\tomega}\cConfig\)
|
local angular velocity of body as provided by node \(n_0\) in any configuration
|
body angular acceleration
|
\(\LU{0}{\talpha}\cConfig = \LU{0}{\dot \tomega}\cConfig\)
|
angular acceleratoin of body as provided by node \(n_0\) in any configuration
|
applied forces
|
\(\LU{0}{{\mathbf{f}}}_a = [f_0,\;f_1,\;f_2]\tp\)
|
calculated from loads, connectors, …
|
applied torques
|
\(\LU{0}{\ttau}_a = [\tau_0,\;\tau_1,\;\tau_2]\tp\)
|
calculated from loads, connectors, …
|
constraint reaction forces
|
\(\LU{0}{{\mathbf{f}}}_\lambda = [f_{\lambda 0},\;f_{\lambda 1},\;f_{\lambda 2}]\tp\)
|
calculated from joints or constraint)
|
constraint reaction torques
|
\(\LU{0}{\ttau}_\lambda = [\tau_{\lambda 0},\;\tau_{\lambda 1},\;\tau_{\lambda 2}]\tp\)
|
calculated from joints or constraints
|
Rotation parametrization
The equations of motion of the rigid body build upon a specific parameterization of the rigid body coordinates.
Rigid body coordinates are defined by the underlying node given by nodeNumber
\(n0\).
Appropriate nodes are
NodeRigidBodyEP
(Euler parameters)NodeRigidBodyRxyz
(Euler angles / Tait Bryan angles)NodeRigidBodyRotVecLG
(Rotation vector with Lie group integration option)
Note that all operations for rotation parameters, such as the computation of the rotation matrix, must be performed with the rotation parameters \(\ttheta\), see table above, which are the sum of reference and current coordinates.
The angular velocity in body-fixed coordinates is related to the rotation parameters by means of a matrix \(\LU{b}{{\mathbf{G}}_{rp}}\),
and is specific for any rotation parametrization \(rp\). The angular velocity in global coordinates is related to the rotation parameters by means of a matrix \(\LU{0}{{\mathbf{G}}_{rp}}\),
The local angular accelerations follow as
remember that derivatives for angular velocities can also be done in the local frame. In case of Euler parameters and the Lie-group rotation vector we find that \(\LU{b}{\dot {\mathbf{G}}_{rp}} \dot \ttheta = \Null\).
Equations of motion for COM
The equations of motion for a rigid body, the so-called Newton-Euler equations, can be written for the special case of the reference point \(=\) COM and split for translations and rotations, using a coordinate-free notation,
with the \(3\times 3\) unit matrix \(\mathbf{I}_{3 \times 3}\) and forces \({\mathbf{f}}\) resp.torques \(\ttau\) as discribed in the table above. A change of the reference point, using the vector \({\mathbf{b}}_{COM}\) from the body’s reference point \({\mathbf{p}}\) to the COM position, is simple by replacing COM accelerations using the common relation known from Euler
which is inserted into the first line of Eq. (49). Additionally, the second line of Eq. (49)(second Euler equation related to rate of angular momentum) is rewritten for an arbitrary reference point, \({\mathbf{b}}_{COM}\) denoting the vector from the body reference point to COM, using the well known relation
Equations of motion for arbitrary reference point
This immediately leads to the equations of motion for the rigid body with respect to an arbitrary reference point (\(\neq\) COM), see e.g.(page 258ff.), which have the general coordinate-free form
in which \({\mathbf{J}}\) is the inertia tensor w.r.t.the chosen reference point (which has local coordinates \(\LU{b}{[0,0,0]\tp}\)). Eq. (50) can be written in the global frame (0),
Expressing the translational part (first line) of Eq. (51) in the global frame (0), using local coordinates (b) for quantities that are constant in the body-fixed frame, \(\LU{b}{{\mathbf{J}}}\) and \(\LU{b}{{\mathbf{b}}_{COM}}\), thus expressing also the angular velocity \(\LU{b}{\tomega}\) in the body-fixed frame, applying Eq. (46) and Eq. (48), and using the relations
we obtain
with constraint reaction forces \({\mathbf{f}}_{\theta,\lambda}\) for the rotation parameters. Note that the last line has been pre-multiplied with \(\LU{b}{{\mathbf{G}}_{rp}\tp}\) (in order to make the mass matrix symmetric) and that \(\LU{b}{\dot {\mathbf{G}}_{rp}} \dot \ttheta = \Null\) in case of Euler parameters and the Lie-group rotation vector .
Euler parameters
In case of Euler parameters, a constraint equation is automatically added, reading for the index 3 case
and for the index 2 case
Given a Lagrange parameter (algebraic variable) \(\lambda_\theta\) related to the Euler parameter constraint (53), the constraint reaction forces in Eq. (52) then read
Userfunction: graphicsDataUserFunction(mbs, itemNumber)
A user function, which is called by the visualization thread in order to draw user-defined objects.
The function can be used to generate any BodyGraphicsData
, see Section GraphicsData.
Use exudyn.graphics
functions, see Section Module: graphics, to create more complicated objects.
Note that graphicsDataUserFunction
needs to copy lots of data and is therefore
inefficient and only designed to enable simpler tests, but not large scale problems.
For an example for graphicsDataUserFunction
see ObjectGround, Section ObjectGround.
arguments / return
|
type or size
|
description
|
---|---|---|
mbs |
MainSystem
|
provides reference to mbs, which can be used in user function to access all data of the object
|
itemNumber |
Index
|
integer number of the object in mbs, allowing easy access
|
returnValue
|
BodyGraphicsData
|
list of
GraphicsData dictionaries, see Section GraphicsData |
For creating a ObjectRigidBody
, there is a rigidBodyUtilities
function AddRigidBody
,
see Section Function: AddRigidBody, which simplifies the setup of a rigid body significantely!
Relevant Examples and TestModels with weblink:
rigid3Dexample.py (Examples/), rigidBodyIMUtest.py (Examples/), craneReevingSystem.py (Examples/), fourBarMechanism3D.py (Examples/), humanRobotInteraction.py (Examples/), leggedRobot.py (Examples/), mobileMecanumWheelRobotWithLidar.py (Examples/), mouseInteractionExample.py (Examples/), openVRengine.py (Examples/), particleClusters.py (Examples/), particlesSilo.py (Examples/), plotSensorExamples.py (Examples/), explicitLieGroupIntegratorPythonTest.py (TestModels/), explicitLieGroupIntegratorTest.py (TestModels/), explicitLieGroupMBSTest.py (TestModels/)
The web version may not be complete. For details, consider also the Exudyn PDF documentation : theDoc.pdf