Working on yaw command.
This commit is contained in:
parent
a9c6c69ba1
commit
b6dcd70cf9
@ -189,6 +189,7 @@ void MavlinkGuide::handleCommand() {
|
||||
temp = -_crossTrackLim * deg2Rad;
|
||||
float bearing = _previousCommand.bearingTo(_command);
|
||||
_headingCommand = bearing - temp;
|
||||
_yawCommand = _command.getYawCommand();
|
||||
//_hal->debug->printf_P(
|
||||
// PSTR("nav: bCurrent2Dest: %f\tdXt: %f\tcmdHeading: %f\tnextWpDistance: %f\talongTrack: %f\n"),
|
||||
// bearing * rad2Deg, dXt, _headingCommand * rad2Deg, distanceToNext, alongTrack);
|
||||
|
@ -85,9 +85,14 @@ public:
|
||||
|
||||
float getHeadingError();
|
||||
|
||||
/// the commanded course over ground for the vehicle
|
||||
float getHeadingCommand() {
|
||||
return _headingCommand;
|
||||
}
|
||||
/// the yaw attitude command of the vehicle
|
||||
float getYawCommand(){
|
||||
return _yawCommand;
|
||||
}
|
||||
float getAirSpeedCommand() {
|
||||
return _airSpeedCommand;
|
||||
}
|
||||
@ -115,6 +120,7 @@ protected:
|
||||
AP_HardwareAbstractionLayer * _hal;
|
||||
AP_MavlinkCommand _command, _previousCommand;
|
||||
float _headingCommand;
|
||||
float _yawCommand;
|
||||
float _airSpeedCommand;
|
||||
float _groundSpeedCommand;
|
||||
float _altitudeCommand;
|
||||
|
@ -123,6 +123,11 @@ public:
|
||||
void setZ(float val) {
|
||||
_data.get().z = val;
|
||||
}
|
||||
|
||||
float getYawCommand() const {
|
||||
return getParam4();
|
||||
}
|
||||
|
||||
float getLatDeg() const {
|
||||
switch (getFrame()) {
|
||||
case MAV_FRAME_GLOBAL:
|
||||
|
Loading…
Reference in New Issue
Block a user