My Project
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TerrainNavClient Class Reference

#include <TerrainNavClient.h>

Inheritance diagram for TerrainNavClient:
TerrainNav

Public Member Functions

 TerrainNavClient (char *server_ip, int server_port, char *mapName, char *vehicleSpecs, const int &filterType, const int &mapType)
 
virtual ~TerrainNavClient ()
 
virtual void estimatePose (poseT *estimate, const int &type)
 
virtual void measUpdate (measT *incomingMeas, const int &type)
 
virtual void mbUpdate (mbT *incomingMB)
 
virtual void motionUpdate (poseT *incomingNav)
 
virtual bool outstandingMeas ()
 
virtual bool lastMeasSuccessful ()
 
virtual void setInterpMeasAttitude (bool set)
 
virtual void setMapInterpMethod (const int &type)
 
virtual void setVehicleDriftRate (const double &driftRate)
 
virtual bool isConverged ()
 
virtual void useLowGradeFilter ()
 
virtual void useHighGradeFilter ()
 
virtual void setFilterReinit (const bool allow)
 
virtual void setModifiedWeighting (const bool use)
 
virtual int getFilterState ()
 
virtual int getNumReinits ()
 
virtual void reinitFilter (const bool lowInfoTransition)
 
- Public Member Functions inherited from TerrainNav
 TerrainNav ()
 
 TerrainNav (char *mapName)
 
 TerrainNav (char *mapName, char *vehicleSpecs)
 
 TerrainNav (char *mapName, char *vehicleSpecs, const int &filterType)
 
 TerrainNav (char *mapName, char *vehicleSpecs, const int &filterType, char *directory)
 
 TerrainNav (char *mapName, char *vehicleSpecs, const int &filterType, const int &mapType)
 
 TerrainNav (char *mapName, char *vehicleSpecs, const int &filterType, const int &mapType, char *directory)
 
virtual ~TerrainNav ()
 
virtual int getFilterType ()
 
void reinitFilter (bool lowInfoTransition)
 
virtual bool initialized ()
 

Protected Member Functions

void init_comms ()
 
void init_server ()
 
bool is_connected ()
 
int send_msg (commsT &msg)
 
char get_msg ()
 
bool requestAndConfirm (commsT &msg, char expected_ret_type)
 
- Protected Member Functions inherited from TerrainNav
void createFilter (const int filterType, const double *windowVar)
 
void initVariables ()
 
void attemptInitFilter (poseT &initEstimate)
 
void initMotion (poseT &initEstimate)
 
bool interpolatePoses (const poseT &pose1, const poseT &pose2, poseT &newPose, const double newTime)
 
void computeMeasVariance (measT &currMeas)
 
void checkVelocityValidity (poseT &currPose)
 
void checkRangeValidity (measT &currMeas)
 
bool checkFilterHealth ()
 

Protected Attributes

char * _map_name
 
char * _vehicle_specs
 
bool _connected
 
char * _server_ip
 
int _sockfd
 
int _sockport
 
struct sockaddr_in _server_addr
 
struct commsT _server_msg
 
char _comms_buf [TRN_MSG_SIZE]
 
- Protected Attributes inherited from TerrainNav
measT waitingMeas [MEAS_BUFFER_SIZE]
 static array containing all unincorporated sonar measurements More...
 
int numWaitingMeas
 integer indicating the current number of unincorporated sonar measurements More...
 
bool lastMeasSuccess
 
double lastValidVel [3]
 
bool lastVelBotLock
 
bool lastMeasValid
 status of last measurement - only used for testing initialization More...
 
double lastValidRange [4]
 
double lastValidRangeTime [4]
 
bool noValidRange [4]
 
double lastMeasSuccessTime
 last time associated with successful measurement update More...
 
double lastInitAttemptTime
 time of last filter init attempt More...
 
double lastBottomLockTime
 time of last bottom lock velocity More...
 
poseT estNavOffset
 last valid estimated navigation offset More...
 
bool allowFilterReinits
 boolean indicating if filter reinitializations are allowed. More...
 
bool useModifiedWeighting
 boolean indicating if modified weighting should be used. More...
 
int numReinits
 counter for number of filter reinitializations More...
 
char * saveDirectory
 
char * vehicleSpecFile
 
char * mapFile
 
int filterType
 type of filter More...
 
int mapType
 type of map More...
 
TerrainMapterrainMap
 terrainMap object containing information about current map being used More...
 
bool _initialized
 current state of filter More...
 

Additional Inherited Members

- Public Attributes inherited from TerrainNav
TNavFiltertNavFilter
 

Detailed Description

Class: TerrainNavClient

Constructor & Destructor Documentation

TerrainNavClient::TerrainNavClient ( char *  server_ip,
int  server_port,
char *  mapName,
char *  vehicleSpecs,
const int &  filterType,
const int &  mapType 
)

Initializes a new TerrainNav with terrain map "mapName.txt". The mapping AUV specs and the Point Mass Filter algorithm are used as defaults.

TerrainNavClient::~TerrainNavClient ( )
virtual

Frees all storage associated with the TerrainNav object.

Member Function Documentation

void TerrainNavClient::estimatePose ( poseT estimate,
const int &  type 
)
virtual

This is the primary function in the TerrainNav class. The function takes in a pointer to a poseT which it fills with the terrain correlation pose estimate based on previous measurements. The time stamp of the pose estimate indicates the last update time of the navigation filter. Type indicates the estimator type: 1: Maximum Likelihood Estimate 2: Minimum Mean Square Error Estimate.

Reimplemented from TerrainNav.

char TerrainNavClient::get_msg ( )
protected
int TerrainNavClient::getFilterState ( )
virtual

Returns the integer filterState describing the current filter state.

Reimplemented from TerrainNav.

int TerrainNavClient::getNumReinits ( )
virtual

Returns the integer numReinits describing the number of reinitializations.

Reimplemented from TerrainNav.

void TerrainNavClient::init_comms ( )
protected
void TerrainNavClient::init_server ( )
protected
bool TerrainNavClient::is_connected ( )
protected
bool TerrainNavClient::isConverged ( )
virtual

Returns a boolean indicating if the terrain navigation filter has converged to an estimate.

Reimplemented from TerrainNav.

bool TerrainNavClient::lastMeasSuccessful ( )
virtual

Returns a boolean indicating if the last sonar measurement was successfully incorporated into the filter or not.

Reimplemented from TerrainNav.

void TerrainNavClient::mbUpdate ( mbT incomingMB)
virtual

Passes the current multibeam range information along to the TNavFilter object. The function takes in a pointer to a mbT containing the current multibeam measurement ranges.

Reimplemented from TerrainNav.

void TerrainNavClient::measUpdate ( measT incomingMeas,
const int &  type 
)
virtual

Passes the current sonar measurement information along to the TNavFilter object. The function takes in a pointer to a measT containing the current sonar measurement information. It also takes in an integer type variable which relates the sonar measurement type as follows: 1: DVL 2: Multibeam 3: Single Beam 4: Homer Relative Measurement

Reimplemented from TerrainNav.

void TerrainNavClient::motionUpdate ( poseT incomingNav)
virtual

Passes the current inertial measurement information along to the TNavFilter object. The function takes in a pointer to a poseT containing the current inertial measurement information.

Reimplemented from TerrainNav.

bool TerrainNavClient::outstandingMeas ( )
virtual

Returns a boolean indicating if there are any measurements not yet incorporated into the PDF and waiting for more recent inertial measurement data.

Reimplemented from TerrainNav.

void TerrainNavClient::reinitFilter ( const bool  lowInfoTransition)
virtual

Reinitializes the TRN filter.

bool TerrainNavClient::requestAndConfirm ( commsT msg,
char  expected_ret_type 
)
protected
int TerrainNavClient::send_msg ( commsT msg)
protected
void TerrainNavClient::setFilterReinit ( const bool  allow)
virtual

Overwrite boolean allowFilterReinits with input argument, allow.

Reimplemented from TerrainNav.

void TerrainNavClient::setInterpMeasAttitude ( bool  set)
virtual

Sets a boolean indicating if the sonar measurement attitude information should be determined from interpolated inertial poses. Default = 0;

Reimplemented from TerrainNav.

void TerrainNavClient::setMapInterpMethod ( const int &  type)
virtual

Specifies the interpolation method to use for determining inter-grid map depth values. 0: nearest-neighbor (no interpolation) 1: bilinear 2: bicubic 3: spline Default = 0;

Reimplemented from TerrainNav.

void TerrainNavClient::setModifiedWeighting ( const bool  use)
virtual

Overwrite boolean useModifiedWeighting with input argument, use.

Reimplemented from TerrainNav.

void TerrainNavClient::setVehicleDriftRate ( const double &  driftRate)
virtual

Sets the vehicle inertial drift rate parameter. The default value is determined by the vehicle specification sheet. The driftRate parameter is given in units of % drift in meters/sec.

Reimplemented from TerrainNav.

void TerrainNavClient::useHighGradeFilter ( )
virtual

Force filter settings for low grade system: 7DOF system with ALLOW_ATTITUDE_SEARCH=0, DEAD_RECKON=0, SEARCH_GYRO=0

Reimplemented from TerrainNav.

void TerrainNavClient::useLowGradeFilter ( )
virtual

Force filter settings for low grade system: 7DOF system with ALLOW_ATTITUDE_SEARCH=1, DEAD_RECKON=1, SEARCH_GYRO=1

Reimplemented from TerrainNav.

Member Data Documentation

char TerrainNavClient::_comms_buf[TRN_MSG_SIZE]
protected
bool TerrainNavClient::_connected
protected
char* TerrainNavClient::_map_name
protected
struct sockaddr_in TerrainNavClient::_server_addr
protected
char* TerrainNavClient::_server_ip
protected
struct commsT TerrainNavClient::_server_msg
protected
int TerrainNavClient::_sockfd
protected
int TerrainNavClient::_sockport
protected
char* TerrainNavClient::_vehicle_specs
protected

The documentation for this class was generated from the following files: