ObjectGround

A ground object behaving like a rigid body, but having no degrees of freedom; used to attach body-connectors without an action. For examples see spring dampers and joints.

Additional information for ObjectGround:

  • This Object has/provides the following types = Ground, Body

The item ObjectGround with type = ‘Ground’ has the following parameters:

  • name [type = String, default = ‘’]:
    objects’s unique name
  • referencePosition [\(\pRefG\), type = Vector3D, size = 3, default = [0.,0.,0.]]:
    reference point = reference position for ground object; local position is added on top of reference position for a ground object
  • referenceRotation [\(\LU{0b}{\Rot} \in \Rcal^{3 \times 3}\), type = Matrix3D, default = [[1,0,0], [0,1,0], [0,0,1]]]:
    the constant ground rotation matrix, which transforms body-fixed (b) to global (0) coordinates
  • visualization [type = VObjectGround]:
    parameters for visualization of item

The item VObjectGround 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
  • graphicsData [type = BodyGraphicsData]:
    Structure contains data for body visualization; data is defined in special list / dictionary structure

DESCRIPTION of ObjectGround

The following output variables are available as OutputVariableType in sensors, Get…Output() and other functions:

  • Position: \(\LU{0}{{\mathbf{p}}} = \pRefG + \LU{0b}{\Rot} \pLocB\)
    global position vector of translated local position
  • Displacement: \(\Null\)
    global displacement vector of local position
  • Velocity: \(\Null\)
    global velocity vector of local position
  • AngularVelocity: \(\Null\)
    angular velocity of body
  • RotationMatrix: \(\LU{0b}{\Rot}\)
    rotation matrix in vector form (stored in row-major order)

Equations

ObjectGround has no equations, as it only provides a static object, at which joints and connectors can be attached. The object does not move (in general) and forces or torques do not have an effect. However, the reference position and rotation may be changed over time. This may prescribe motion, however, with the measured velocity still being zero at each time instant. Therefore, such manipulation of reference position or rotation shall be treated with care.

In combination with markers, the localPosition \(\pLocB\) is transformed by the ObjectGround to a global point \(\LU{0}{{\mathbf{p}}}\) using the reference point \(\pRefG\),

\[\LU{0}{{\mathbf{p}}} = \pRefG + \LU{0b}{\Rot} \pLocB .\]

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 graphicsDataUtilities functions, see Section Module: graphicsDataUtilities, 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.

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

User function example:

import exudyn as exu
from math import sin, cos, pi
from exudyn.itemInterface import *
from exudyn.graphicsDataUtilities import *
SC = exu.SystemContainer()
mbs = SC.AddSystem()
#create simple system:
mbs.AddNode(NodePoint())
body = mbs.AddObject(MassPoint(physicsMass=1, nodeNumber=0))

#user function for moving graphics:
def UFgraphics(mbs, objectNum):
    t = mbs.systemData.GetTime(exu.ConfigurationType.Visualization) #get time if needed
    #draw moving sphere on ground
    graphics1=GraphicsDataSphere(point=[sin(t*2*pi), cos(t*2*pi), 0],
                                 radius=0.1, color=color4red, nTiles=32)
    return [graphics1]

#add object with graphics user function
ground = mbs.AddObject(ObjectGround(visualization=VObjectGround(graphicsDataUserFunction=UFgraphics)))
mbs.Assemble()
sims=exu.SimulationSettings()
sims.timeIntegration.numberOfSteps = 10000000 #many steps to see graphics
exu.StartRenderer() #perform zoom all (press 'a' several times) after startup to see the sphere
mbs.SolveDynamic(sims)
exu.StopRenderer()

Relevant Examples and TestModels with weblink:

addPrismaticJoint.py (Examples/), addRevoluteJoint.py (Examples/), ALEANCFpipe.py (Examples/), ANCFcableCantilevered.py (Examples/), ANCFcantileverTest.py (Examples/), ANCFcantileverTestDyn.py (Examples/), ANCFcontactCircle.py (Examples/), ANCFcontactCircle2.py (Examples/), ANCFmovingRigidbody.py (Examples/), ANCFrotatingCable2D.py (Examples/), ANCFslidingJoint2D.py (Examples/), ANCFslidingJoint2Drigid.py (Examples/), abaqusImportTest.py (TestModels/), ACFtest.py (TestModels/), ANCFbeltDrive.py (TestModels/)

The web version may not be complete. For details, consider also the Exudyn PDF documentation : theDoc.pdf