Marine Visualization Toolbox

Examples of use

The following examples describe how to visualize some typical scenarios in marine operations. None of the examples are worked through, but the short descriptions should give you an idea of how to complete the visualization.

Syntax, listed expressions occur on this page, recall their meaning by clicking them.

 


A single vessel in 6 DOF

The vessel structure should now consist of a field x and a field t, the time-varying 6 DOF vessel states and time vector respectively.

Run mvtguide with this structure as input argument, select the desired vessel type, scene model and the desired VRML filename when prompted. The default settings will now display your selected vessel and it's path. If all you see is the vessel's path, reduce it's size, if you don't see the path, increase it's size.

See also: tutorial#1.

 


Visualizing vessels with less than 6 DOF

Data from less than 6 DOF are easily expanded to be compatible with MVT. For instance, a vessel movement where only the xy-positions and heading are measured is a movement in 3 DOF. The 3 DOF data is converted to 6 DOF data by adding a row of zeros for each vessel state that was not measured. This equals that the z-position, roll and pitch are all measured to zero. See figure below: Assume that the x, y, and yaw variables contain the measured states for 6 different samples. The zeros(6,3) command (underlined red) creates a zero-matrix with 6 rows and 3 columns, these represent the vessel states that are not measured (z, roll and pitch).

The general formula is thus to insert a row of zeros (see zeros) for every vessel state that is not already defined. The time vector should not be chaged.

 


A vessel tracking a reference vessel

To do this you need the 6 DOF data of both the actual vessel and the reference vessel.

Set up a structure with the fields x and t. And assign the 6 DOF data and time-vector for the vessel in these. When animating more than one vessel, the vessel structure must be a structure array. This is simply created by indexing the structure. To add your reference vessel to the animation simply index the structure as number 2, and assign it's 6 DOF data and time vector. Note that the time vectors must be of the same length, but not necessarily with the same time samples. The following example creates a structure array with two sets of vessel data:

     % add vessel to structure 'data'
     data.x = vessel_6DOF_data;     % vessel_6DOF_data is a Nx6 double array
     data.t = vessel_time_vec;      % vessel_time_vec as a Nx1 column vector
     % add reference vessel to structure 'data'
     data(2).x = ref_6DOF_data;     % ref_6DOF_data is a Nx6 double array
     data(2).t = ref_time_vec;      % ref_time_vec as a Nx1 column vector

 

Tutorial#2Functions