CMOOSGeodesy m_Geodesy的有关问题(一)

quesiton1:      m_Geodesy.Initialise(dfLat, dfLon)

question2:      m_Geodesy.LLtoUTM(23, lat, lon, dfNorth, dfEast)

一、CMOOSGeodesy Class Reference

注解:更多CMOOSGeodesy类的情况请看:MOOS: CMOOSGeodesy Class Reference

(1)列举几个常用的成员函数:

CMOOSGeodesy();//构造函数
virtual ~CMOOSGeodesy();//析构函数
double GetOriginMorthing();
double GetOriginEasting();
bool LatLong2LocalUTM(double lat,double lon,double &MetersNorth,double &MeterEast);
bool LocalGrid2LatLong(double dfX,double dfY,double &dfLat,double &dfLon);
char * GetUTMZone();
int GetRefEllipsoid();
double GetMetersEast();
double GetMetersNorth();
double GetOriginLatitude();
double GetOriginLongitude();
bool Initialise(double lat,double lon);//question1的出处
double GetLocalGridY();
double GetLocalGridX();
bool LatLong2LocalGrid(double lat,double lon,double &MeterNorth,double &MeterEast);
double DMS2DecDeg(double dfVal);

(2)对于第2个question的解决方法:

Initialise()函数的说明:

    bool CMOOSGeodesy::Initailse(double lat,double lon);//函数原型
//返回值 类名+作用域运算符   函数名      形参表
/* 
This method is called to set the Origins of the Coordinate system being used by the vehicle for  a mission. this class will store the vehicle's position in Northings and Eastings.This allows for tracking the vehicle as if it were operating on a grid. 
*/
//Parameters:
//     lat: the latitude of where the vehicle is as it begins a mission
//     lon: the Longitude of where the vehicle is as it begins a mission

//Returns:only returns true at the moment,no reason as to why it should fail perhaps some way of checking UTM zones vs a list of some sort?

此方法用于设置车辆执行任务时使用的坐标系的原点。此类将存储车辆在北距和东距中的位置。这就像在坐标方格上一样跟踪车辆。

Initailise()函数的定义:

bool CMOOSGeodesy::Initialise(double lat,double lon)
{ 
/*We will use the WGS-84 standard Reference Ellipsoid
  This can be modified by a client if they desire with @see MOOSGeodesy.h
*/
//我们将使用WGS-84标准参考椭球。如果客户需要,可以使用@see MOOSGeodesy.h修改此属性
SetRefEllipsoid(23)//?

//Set the Origin of the local Grid Coordinate System
//设置本地栅格坐标系的原点
SetOriginLatitude(lat);
SetOriginLongitude(lon);

//Tranlate the Origin coordinate into Northings and Eastings
//将原点坐标转换为北距和东距
double tempNorth=0.0,tempEast=0.0;
char utmZone[4];
LLtoUTM(m_iRefEllipsoid,m_dOriginLatitude,m_dOriginLongitude,tempNorth,tempEast,utmZone);

//Then set the Origin for the Northing/Easting coordinate frame 
//Also make a note of the UTM Zone we are operating in 
//然后设置北距/东距坐标系的原点
//还要注意我们正在运营的UTM区域
SetOriginNorthing(tempNorth);
SetOriginEasting(tempEast);
SetUTMZone(utmZone);

//We set this flag to indicate that the first calculation of distance
//traveled is with respect to the origin coordinates
//我们设置此标志以指示距离的第一次计算行进相对于原点坐标
m_bSTEP_AFTER_INIT=true;
return true;
}

你可能感兴趣的:(c++,开发语言)