Commit aac69b97 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Fixed a number of bad bugs in the HUD, will need a bit more write / SVG...

Fixed a number of bad bugs in the HUD, will need a bit more write / SVG rewrite to make it pretty, but is substantially more accurate and reliable now
parent 9b19be0e
...@@ -315,7 +315,7 @@ void HUD::updateAttitude(UASInterface* uas, double roll, double pitch, double ya ...@@ -315,7 +315,7 @@ void HUD::updateAttitude(UASInterface* uas, double roll, double pitch, double ya
Q_UNUSED(uas); Q_UNUSED(uas);
Q_UNUSED(timestamp); Q_UNUSED(timestamp);
this->roll = roll; this->roll = roll;
this->pitch = pitch; this->pitch = pitch*3.35f; // Constant here is the 'focal length' of the projection onto the plane
this->yaw = yaw; this->yaw = yaw;
} }
...@@ -323,7 +323,7 @@ void HUD::updateAttitude(UASInterface* uas, int component, double roll, double p ...@@ -323,7 +323,7 @@ void HUD::updateAttitude(UASInterface* uas, int component, double roll, double p
{ {
Q_UNUSED(uas); Q_UNUSED(uas);
Q_UNUSED(timestamp); Q_UNUSED(timestamp);
attitudes.insert(component, QVector3D(roll, pitch, yaw)); attitudes.insert(component, QVector3D(roll, pitch*3.35f, yaw)); // Constant here is the 'focal length' of the projection onto the plane
} }
void HUD::updateBattery(UASInterface* uas, double voltage, double percent, int seconds) void HUD::updateBattery(UASInterface* uas, double voltage, double percent, int seconds)
...@@ -478,11 +478,11 @@ void HUD::paintCenterBackground(float roll, float pitch, float yaw) ...@@ -478,11 +478,11 @@ void HUD::paintCenterBackground(float roll, float pitch, float yaw)
glColor3ub(179,102,0); glColor3ub(179,102,0);
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2f(-300,-300); glVertex2f(-300,-900);
glVertex2f(-300,0); glVertex2f(-300,0);
glVertex2f(300,0); glVertex2f(300,0);
glVertex2f(300,-300); glVertex2f(300,-900);
glVertex2f(-300,-300); glVertex2f(-300,-900);
glEnd(); glEnd();
// Sky // Sky
...@@ -490,8 +490,8 @@ void HUD::paintCenterBackground(float roll, float pitch, float yaw) ...@@ -490,8 +490,8 @@ void HUD::paintCenterBackground(float roll, float pitch, float yaw)
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glVertex2f(-300,0); glVertex2f(-300,0);
glVertex2f(-300,300); glVertex2f(-300,900);
glVertex2f(300,300); glVertex2f(300,900);
glVertex2f(300,0); glVertex2f(300,0);
glVertex2f(-300,0); glVertex2f(-300,0);
...@@ -612,9 +612,9 @@ void HUD::paintHUD() ...@@ -612,9 +612,9 @@ void HUD::paintHUD()
// Read out most important values to limit hash table lookups // Read out most important values to limit hash table lookups
// Low-pass roll, pitch and yaw // Low-pass roll, pitch and yaw
rollLP = rollLP * 0.2f + 0.8f * roll; rollLP = roll;//rollLP * 0.2f + 0.8f * roll;
pitchLP = pitchLP * 0.2f + 0.8f * pitch; pitchLP = pitch;//pitchLP * 0.2f + 0.8f * pitch;
yawLP = yawLP * 0.2f + 0.8f * yaw; yawLP = yaw;//yawLP * 0.2f + 0.8f * yaw;
// Translate for yaw // Translate for yaw
const float maxYawTrans = 60.0f; const float maxYawTrans = 60.0f;
...@@ -887,7 +887,7 @@ void HUD::paintPitchLines(float pitch, QPainter* painter) ...@@ -887,7 +887,7 @@ void HUD::paintPitchLines(float pitch, QPainter* painter)
const float lineDistance = 5.0f; ///< One pitch line every 10 degrees const float lineDistance = 5.0f; ///< One pitch line every 10 degrees
const float posIncrement = yDeg * lineDistance; const float posIncrement = yDeg * lineDistance;
float posY = posIncrement; float posY = posIncrement;
const float posLimit = sqrt(pow(vwidth, 2.0f) + pow(vheight, 2.0f)); const float posLimit = sqrt(pow(vwidth, 2.0f) + pow(vheight, 2.0f))*3.0f;
const float offsetAbs = pitch * yDeg; const float offsetAbs = pitch * yDeg;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment