/** \file
 *
 *  Contains the SimDvlStruct class declaration.
 *
 *  Copyright (c) 2022 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef SIMDVLSTRUCT_H_
#define SIMDVLSTRUCT_H_

#include "data/Point3D.h"

/**
 *  A struct of values that is passed from the Simulator to the LRAUV,
 *  with the results from one DVL simulation timestep.
 *
 *  \ingroup modules_simulator
 */
struct SimDvlStruct
{
    /// Whether measurements are valid or not
    bool valid;

    /// Timestamp for DVL measurements
    Timestamp timestamp;

    /// Range to bottom as measured by the DVL in units METER
    double bottomRange;

    /// Target ranges as measured by each DVL beam in units METER
    double beamRanges[4];

    /// DVL linear velocity along FSK w.r.t. bottom in units METER_PER_SECOND
    /// U: forward
    /// V: starboard
    /// W: keelward
    Point3D velocityWrtBottom;

    /// Water mass linear velocity along FSK w.r.t. DVL in units METER_PER_SECOND
    /// U: forward
    /// V: starboard
    /// W: keelward
    Point3D waterMassVelocityWrtSensor;

    /// Constructor
    SimDvlStruct()
        : valid( false ),
          timestamp(),
          bottomRange( nanf( "" ) ),
          velocityWrtBottom(),
          waterMassVelocityWrtSensor()
    {
        for( int i = 0; i < 4; ++i )
            beamRanges[i] = nanf( "" );
    }
};


#endif // SIMDVLSTRUCT_H_
