1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

GCS-PathPlanner

Fixes UAVO to DataModel convertion.
This commit is contained in:
PT_Dreamer 2012-10-30 15:13:52 +00:00
parent 06e56165c5
commit a01930b12f

View File

@ -143,7 +143,8 @@ void modelUavoProxy::objectsToModel()
myModel->setData(index,wpfields.Velocity);
distance=sqrt(wpfields.Position[Waypoint::POSITION_NORTH]*wpfields.Position[Waypoint::POSITION_NORTH]+
wpfields.Position[Waypoint::POSITION_EAST]*wpfields.Position[Waypoint::POSITION_EAST]);
bearing=acos(wpfields.Position[Waypoint::POSITION_NORTH]/wpfields.Position[Waypoint::POSITION_EAST])*180/M_PI;
bearing=atan2(wpfields.Position[Waypoint::POSITION_EAST],wpfields.Position[Waypoint::POSITION_NORTH])*180/M_PI;
if(bearing!=bearing)
bearing=0;
index=myModel->index(x,flightDataModel::DISRELATIVE);