FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Box with Ball

3D box to contain a ball

+ Collaboration diagram for Box with Ball:

Uses CBox class for its implementation. This SimObject is meant for showcasing the SimObject interfaces and interconnection with other SimObjects.

Author
Therese Frostad
Date
12.06.2014 TF: Initial version.

Example configuration excerpt

<Lib
LibName = "fhsim_base"
SimObject = "Ballbox/Box"
Name = "B"
BoxDimensions = "1,1,1"
Scale = "1"
/>
...
<InitialCondition
S.Pos="0,0,-2.5"
S.Vel="0.1,-0.2,0.5"
S.Rot="0,0,0"
/>

Input Ports

This SimObject does not contain any inputs.

Output Ports

Name Width Description
Pos 3 The box centroid position.
Vel 3 The box centroid velocity.
Rot 3 The box orientation in Euler angles.

Configuration parameters

Name Width Description
BoxDimensions 3 Box length, width, height, in meters along axes x, y, , z, respectively.
Scale 1 Scale of rendered body objects, typically 1. (Visualization only)

Initial conditions

Name Width Description
Pos 3 North, East, Down, position.
Vel 3 North, East, Down, velocity.
Rot 3 Euler angles of axes North, East, Down, (x,y,z) in radians.

Full example file

Note
Try to press x while running the simulation to look inside the box.
<Contents>
<OBJECTS>
<Lib
LibName="fhsim_base"
SimObject="Ballbox/Box"
Name="S"
BoxDimensions="5,5,5"
/>
<Lib
LibName="fhsim_base"
SimObject="Ballbox/Ball"
Name="B"
Count="1"
Stiffnesses="1e7"
Radii="1"
Masses="1"
Gravity="9.81"
BoxDimensions="5,5,5"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
B.BoxPos = "S.Pos"
B.BoxRot = "S.Rot"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
B.Pos="0,0,-2"
B.Vel="0,0,2"
S.Pos="0,0,-2.5"
S.Vel="0.1,-0.2,0.5"
S.Rot="0,0,0"
/>
</INITIALIZATION>
<SIMULATION>
<Timing TStart="0" TEnd="10"/>
<Integrator Method="RK45_i" NumCores="1" LogStates="0" UseRSSNorm="0">
<StepControl Step="0.0006" StepMax="0.002" StepMin="0.0000001" AbsTol="1e-3" RelTol="1e-3"/>
</Integrator>
</SIMULATION>
</Contents>

This SimObject is referred to as Ballbox/Box