```{raw} latex \clearpage ``` (sec-item-markerbodyrigid)= # MarkerBodyRigid A rigid-body (position+orientation) body-marker attached to a local (body-fixed) position $\pLocB = [b_0,\; b_1,\; b_2]$ ($x$, $y$, and $z$ coordinates) of the body. It provides position and orientation (rotation), as well as the according derivatives. It can be used for most connectors, joints or loads where either position, position and orientation, or orientation are required. ```{image} /docs/figures/itemImages/MarkerBodyRigid.png :width: 500 ``` ## Interface - Provides: `Position`, `Orientation` - Bodies it can be placed on: [](#sec-item-objectground), [](#sec-item-objectmass1d), [](#sec-item-objectrotationalmass1d), [](#sec-item-objectrigidbody), [](#sec-item-objectrigidbody2d), [](#sec-item-objectffrf), [](#sec-item-objectffrfreducedorder), [](#sec-item-objectancfcable2d), [](#sec-item-objectaleancfcable2d), [](#sec-item-objectancfbeam), [](#sec-item-objectbeamgeometricallyexact2d), [](#sec-item-objectbeamgeometricallyexact) - Connectors, constraints and loads that can use it: [](#sec-item-objectconnectorspringdamper), [](#sec-item-objectconnectorcartesianspringdamper), [](#sec-item-objectconnectorrigidbodyspringdamper), [](#sec-item-objectconnectorlinearspringdamper), [](#sec-item-objectconnectortorsionalspringdamper), [](#sec-item-objectconnectorgravity), [](#sec-item-objectconnectorhydraulicactuatorsimple), [](#sec-item-objectconnectordistance), [](#sec-item-objectconnectorrollingdiscpenalty), [](#sec-item-objectcontactconvexroll), [](#sec-item-objectcontactspheresphere), [](#sec-item-objectcontactspheretorus), [](#sec-item-objectcontactspheretriangle), [](#sec-item-objectcontactcurvecircles), [](#sec-item-objectjointgeneric), [](#sec-item-objectjointrevolutez), [](#sec-item-objectjointprismaticx), [](#sec-item-objectjointspherical), [](#sec-item-objectjointrollingdisc), [](#sec-item-objectjointrevolute2d), [](#sec-item-objectjointprismatic2d), [](#sec-item-loadforcevector), [](#sec-item-loadtorquevector) ## Parameters The parameters of the item; in a dictionary, its type is 'BodyRigid': | name | type | size | default | description | |---|---|---|---|---| | **name** | String | | '' | marker's unique name | | **bodyNumber** | ObjectIndex | | invalid (-1) | body number to which marker is attached to | | **localPosition** | Vector3D | 3 | None (zero) | (symbol: $\pLocB$) local body position of marker; e.g. local (body-fixed) position where force is applied to; the translation of localHT | | **localHT** | HomogeneousTransformation | | None (identity) | (symbol: $\LU{b}{\Hm}_{m}$) the frame of the marker in the body frame, as homogeneous transformation: its translation is localPosition, its rotation $\LU{bm}{\Rot}$ turns the marker frame against the body; a 4x4 matrix, its 16 values row by row or an exu.HT; None: not given; given together with localPosition, both must agree | | **visualization** | VMarkerBodyRigid | | | parameters for visualization of item | ## Visualization parameters The parameters of `VMarkerBodyRigid`, given as `visualization`: | name | type | size | default | description | |---|---|---|---|---| | **show** | Bool | | True | set true, if item is shown in visualization and false if it is not shown | ## Drawing Drawn as [all markers](#sec-drawing-markers). (description-markerbodyrigid)= ## Detailed description ### Marker quantities | quantity | symbol | as computed | |---|---|---| | position | $\LU{0}{\pv}_m$ | the output variable `Position` of the body at the local position $\pLocB$ | | velocity | $\LU{0}{\vv}_m$ | the output variable `Velocity` of the body at $\pLocB$ | | rotation matrix | $\LU{0m}{\Rot} = \LU{0b}{\Rot} \LU{bm}{\Rot}$ | the rotation $\LU{0b}{\Rot}$ of the body at $\pLocB$ (for a rigid body the rotation of the body), turned by the rotation $\LU{bm}{\Rot}$ of `localHT` | | angular velocity | $\LU{m}{\tomega} = \LU{bm}{\Rot}\tp \LU{b}{\tomega}$ | the angular velocity of the body at $\pLocB$, in the marker frame | Position, velocity and rotation matrix are global quantities; the angular velocity is local. $\pLocB$ is given in the body frame, from the reference point of the body. The marker frame is `localHT` = $[\LU{bm}{\Rot}\;\pLocB;\;\Null\tp\;1]$ in the body frame: `localPosition` is its translation, and its rotation is the unit matrix unless `localHT` is given. The Jacobians are global and do not depend on $\LU{bm}{\Rot}$. ### Jacobians $$ \LU{0}{\Jm_{pos}} = \frac{\partial \LU{0}{\vv}_m}{\partial \dot\qv} , \quad \LU{0}{\Jm_{rot}} = \frac{\partial \LU{0}{\tomega}_m}{\partial \dot\qv} , $$ the derivatives of the global velocity and angular velocity with respect to the velocity coordinates of the body (its access functions `TranslationalVelocity_qt` and `AngularVelocity_qt`). For `ObjectRigidBody` they are computed from its node directly, with the velocity transformation $\LU{0}{\Gm}$ of the rotation parameters in $\LU{0}{\Jm_{rot}}$. (miniexample-markerbodyrigid)= ## Mini example ```python #position and orientation of a rigid body: a torque on it, held by a rigid body spring-damper inertia = InertiaCuboid(density=1000, sideLengths=[0.4,0.2,0.1]) node = mbs.AddNode(NodeRigidBodyEP(referenceCoordinates=[1,0,0]+eulerParameters0)) body = mbs.AddObject(ObjectRigidBody(nodeNumber=node, mass=inertia.Mass(), inertia=inertia.GetInertia6D())) mBody = mbs.AddMarker(MarkerBodyRigid(bodyNumber=body, localPosition=[0,0,0])) mGround = mbs.AddMarker(MarkerBodyRigid(bodyNumber=oGround, localPosition=[1,0,0])) mbs.AddObject(ObjectConnectorRigidBodySpringDamper(markerNumbers=[mGround, mBody], stiffness=np.diag([1e4,1e4,1e4, 100,100,100]), damping=np.zeros((6,6)))) mbs.AddLoad(LoadTorqueVector(markerNumber=mBody, loadVector=[0,0,1])) mbs.Assemble() mbs.SolveStatic() #rotation about z: M/k_rot, for the small angle exu.sys['testResult'] = mbs.GetNodeOutput(node, exu.OutputVariableType.Rotation)[2] #0.01 ``` Examples (Ex) and TestModels (TM) that show this item, with weblink to github: [`tutorialSpringDamperCreate.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/notebooks/tutorialSpringDamperCreate.py) (Ex), [`tutorialRigidBody.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/notebooks/tutorialRigidBody.py) (Ex), [`tutorialRigidBodyCreate.py`](https://github.com/jgerstmayr/EXUDYN/blob/master/python/Examples/notebooks/tutorialRigidBodyCreate.py) (Ex)