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"
|
2011-10-16 03:55:34 -03:00
|
|
|
#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),
|
2011-11-15 18:15:54 -04:00
|
|
|
_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) {
|
2011-10-16 03:55:34 -03:00
|
|
|
}
|
|
|
|
float AP_Navigator::getPD() const {
|
2011-10-26 13:31:11 -03:00
|
|
|
return AP_MavlinkCommand::home.getPD(getAlt_intM());
|
2011-10-16 03:55:34 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
float AP_Navigator::getPE() const {
|
2011-10-26 13:31:11 -03:00
|
|
|
return AP_MavlinkCommand::home.getPE(getLat_degInt(), getLon_degInt());
|
2011-10-16 03:55:34 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
float AP_Navigator::getPN() const {
|
2011-10-26 13:31:11 -03:00
|
|
|
return AP_MavlinkCommand::home.getPN(getLat_degInt(), getLon_degInt());
|
2011-10-16 03:55:34 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
void AP_Navigator::setPD(float _pD) {
|
2011-10-26 13:31:11 -03:00
|
|
|
setAlt(AP_MavlinkCommand::home.getAlt(_pD));
|
2011-10-16 03:55:34 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
void AP_Navigator::setPE(float _pE) {
|
2011-10-26 13:31:11 -03:00
|
|
|
setLat(AP_MavlinkCommand::home.getLat(_pE));
|
2011-10-16 03:55:34 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
void AP_Navigator::setPN(float _pN) {
|
2011-10-26 13:31:11 -03:00
|
|
|
setLon(AP_MavlinkCommand::home.getLon(_pN));
|
2011-10-16 03:55:34 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace apo
|
2011-10-26 15:59:40 -03:00
|
|
|
// vim:ts=4:sw=4:expandtab
|