Marine systems simulation
Camera controller 2

Control movement of camera.

+ Collaboration diagram for Camera controller 2:

CCameraController2 class Controls the movement of the camera in absolute terms as camera position and pitch/yaw angels

Author
Karl Gunnar Aarsæther

Example configuration excerpt

<Lib
LibName = "fhsim_base"
SimObject = "Camera/Controller2"
Name = "camcontrol"
NumInput = "2"
Times = "0,2"
Interpolate="0"
/>
...
<Connection
camcontrol.Position1 = "0,0,0"
camcontrol.Pitch1 = "0"
camcontrol.Yaw1 = "0.15"
/>
<Connection
camcontrol.Position2 = "10,10,0"
camcontrol.Pitch2 = "-0.15"
camcontrol.Yaw2 = "0.0"
/>

Configuration parameters

Name Width Description
NumInput 1 Number of time values when the camera will attain position and pose of the input
Times <NumInput> Vector of time values when the camera will attain position and pose of the input
UseDegrees 1 Whether or not the yaw- and pitch angles will be in degrees (Default: false).
Interpolate 1 Make a linear interpolation between camera position and pose

Input Ports

Name Width Description
Position<1...NumInput> 3 Position of the camera
Yaw<1...NumInput> 1 The camera yaw angle in global coordinates
Pitch<1...NumInput> 1 The camera pitch angle in global coordinates

Output Ports

This SimObject does not contain any outputs.

Initial conditions

This SimObject does not contain any initial conditions.

Full example file

<Contents>
<OBJECTS>
<Lib
LibName = "fhsim_base"
SimObject = "Camera/Controller2"
Name = "CAM"
NumInput = "4"
Time = "0,1,2,3"
UseDegrees = "1"
Interpolate="1"
/>
<Lib
LibName = "base"
SimObject = "Body/Mass"
Name = "M"
Scale="1"
Mass="1"
Material="Simple/Red"
/>
<Lib
LibName = "base"
SimObject = "DefaultEnvironment"
Name = "Env"
Seadepth = "500"
Density = "1000"
CurrentVelocity = "0,0,0"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
CAM.Position1 = "-10,0,0"
CAM.Position2 = "0,-10,0"
CAM.Position3 = "10,0,0"
CAM.Position4 = "0,10,0"
CAM.Pitch1 = "0"
CAM.Pitch2 = "0"
CAM.Pitch3 = "0"
CAM.Pitch4 = "0"
CAM.Yaw1 = "0"
CAM.Yaw2 = "90"
CAM.Yaw3 = "180"
CAM.Yaw4 = "270"
M.Force = "0,0,0"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
M.Pos = "0,0,0"
M.Vel = "0,0,0"
/>
</INITIALIZATION>
<INTEGRATION>
<Engine
IntegratorMethod="2"
NumCores="1"
TOutput="0,5"
LogStates ="1"
stepsize ="0"
HMax="0.002"
HMin="0.00000001"
AbsTol="1e-3" RelTol="1e-3"
UseRSSNormInsteadOfInfNorm="0"
FileOutput="objects:all"
/>
</INTEGRATION>
</Contents>

This SimObject is referred to as Camera/Controller2