/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : SimulatorIF.idl                                               */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*
CLASS 
SimulatorIF

DESCRIPTION
TaskInterface to Simulator

AUTHORS
Tom O'Reilly
Rob McEwen
*/

#include "BluefinBatteryIF.idl"

interface SimulatorIF {

  ////////////////////////////////////////////////////////////
  // Clients can subscribe to these events...
  enum Event {
    NewOutput
  };

  typedef sequence<double,3> Vector;


  ////////////////////////////////////////////////////////////
  // Set current velocity
  long setCurrent(in double north, in double east);


  ////////////////////////////////////////////////////////////
  // Set propeller speed (rads/sec), elevator (rads), and rudder (rads)
  long command(in double propOmega, in double elevator, in double rudder);

  ////////////////////////////////////////////////////////////
  // Get position vector and Euler angles
  long state(out Vector position, out Vector positionRate,
             out Vector euler, out Vector eulerRate);

  ////////////////////////////////////////////////////////////
  // Get rotational velocity components
  long rotationalVelocity(out Vector velocity,
	                  out Vector backDiff);

  ////////////////////////////////////////////////////////////
  // Get translational velocity components
  long translationalVelocity(out Vector velocity,
                             out Vector backDiff);

  ////////////////////////////////////////////////////////////
  // Get translational velocity components
  long translationalBottomVelocity(out Vector vel_Bo_N_B );

  ////////////////////////////////////////////////////////////
  // Get control surface angles
  long controlSurfaces(out double rudder, out double elevator);

  ////////////////////////////////////////////////////////////
  // Get body force vector
  long force(out Vector vector);

  ////////////////////////////////////////////////////////////
  // Get body torque vector
  long torque(out Vector vector);

  ////////////////////////////////////////////////////////////
  // Get prop angular speed
  long propOmega(out double rpm);

  ////////////////////////////////////////////////////////////
  // Get thruster current
  long motorCurrent(out double motor);

  ////////////////////////////////////////////////////////////
  // Get water speed
  long waterSpeed(out double waterSpeed);

  ////////////////////////////////////////////////////////////
  // Get simulation time (seconds)
  double simTime();

  ////////////////////////////////////////////////////////////
  // Get water depth.  dx and dy are offsets, in meters, from the 
  // x,y (UTM) vehicle position.
  double waterDepth( in double dx, in double dy);

  ////////////////////////////////////////////////////////////
  // Get integer number of elapsed sample periods
  long nTs();

  ////////////////////////////////////////////////////////////
  // Get ranges for each Dvl beam:
  double beamRange( in Vector offset_B, in Vector los_B, in double minRange,
                    in double maxRange, in double rangeTol, out long simCntr, 
                    out double grazing, out boolean surfaceDetect );

  ////////////////////////////////////////////////////////////
  // Get the range vector from the Usbl
  double usbl( in Vector offset_B, in Vector transponder, in double minRange,
	       in double maxRange, out Vector usblRange );
	
  ///////////////////////////////////////////////////////////////////
  // Return data for given battery 
  void getSimBatteryData(out BluefinBatteryIF::BfBattData data);
	
  ///////////////////////////////////////////////////////////////////
  // Return data for given battery 
   void getSimDeltaTData(out boolean vertMt, out boolean fwdEnabled);
};

