ardupilot/libraries/APO/AP_Navigator.cpp

46 lines
1.1 KiB
C++
Raw Normal View History

2011-09-28 21:51:12 -03:00
/*
* AP_Navigator.cpp
*
* Created on: Apr 30, 2011
* Author: jgoppert
*/
2011-12-05 21:57:19 -04:00
#include "AP_Navigator.h"
#include "AP_MavlinkCommand.h"
namespace apo {
AP_Navigator::AP_Navigator(AP_HardwareAbstractionLayer * hal) :
2011-10-26 13:31:11 -03:00
_hal(hal), _timeStamp(0), _roll(0), _rollRate(0), _pitch(0),
_pitchRate(0), _yaw(0), _yawRate(0),
_windSpeed(0), _windDirection(0),
_vN(0), _vE(0), _vD(0), _lat_degInt(0),
2011-10-26 13:31:11 -03:00
_lon_degInt(0), _alt_intM(0) {
}
float AP_Navigator::getPD() const {
2011-10-26 13:31:11 -03:00
return AP_MavlinkCommand::home.getPD(getAlt_intM());
}
float AP_Navigator::getPE() const {
2011-10-26 13:31:11 -03:00
return AP_MavlinkCommand::home.getPE(getLat_degInt(), getLon_degInt());
}
float AP_Navigator::getPN() const {
2011-10-26 13:31:11 -03:00
return AP_MavlinkCommand::home.getPN(getLat_degInt(), getLon_degInt());
}
void AP_Navigator::setPD(float _pD) {
2011-10-26 13:31:11 -03:00
setAlt(AP_MavlinkCommand::home.getAlt(_pD));
}
void AP_Navigator::setPE(float _pE) {
2011-10-26 13:31:11 -03:00
setLat(AP_MavlinkCommand::home.getLat(_pE));
}
void AP_Navigator::setPN(float _pN) {
2011-10-26 13:31:11 -03:00
setLon(AP_MavlinkCommand::home.getLon(_pN));
}
} // namespace apo
2011-10-26 15:59:40 -03:00
// vim:ts=4:sw=4:expandtab