Commit 68a2f242 authored by pixhawk's avatar pixhawk

Added 3D view

parent 306c978c
......@@ -43,9 +43,7 @@ DEPENDPATH += . \
INCLUDEPATH += . \
lib/QMapControl \
$$BASEDIR/../mavlink/contrib/slugs/include \
$$BASEDIR/../mavlink/include \
/usr/include/freetype2
LIBS += /usr/lib/libftgl.so
$$BASEDIR/../mavlink/include
# ../mavlink/include \
# MAVLink/include \
......
/*
This file was produced by Deep Exploration Plugin: CPP Export filter.
Copyright (C) 1999-2008 Right Hemisphere
Mail support@righthemisphere.com for support.
Visit http://www.righthemisphere.com/dexp.htm for updates.
*/
#include "CheetahGL.h"
#if (defined __APPLE__) & (defined __MACH__)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
struct sample_MATERIAL
#ifndef CHEETAHGL_H_
#define CHEETAHGL_H_
#if (defined __APPLE__) & (defined __MACH__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
GLint generatePixhawkCheetah(float red, float green, float blue);
......
#ifndef CHEETAHMODEL_H_
#define CHEETAHMODEL_H_
#if (defined __APPLE__) & (defined __MACH__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
class CheetahModel
{
......
#include "Q3DWidget.h"
#include <cmath>
#include <GL/gl.h>
#include <GL/glu.h>
//#include <GL/gl.h>
//#include <GL/glu.h>
static const float KEY_ROTATE_AMOUNT = 5.0f;
static const float KEY_MOVE_AMOUNT = 10.0f;
......
#ifndef Q3DWIDGET_H_
#define Q3DWIDGET_H_
#include <boost/scoped_ptr.hpp>
#include <inttypes.h>
#include <string>
#include <QtOpenGL>
......
#include "QMap3DWidget.h"
#include <FTGL/ftgl.h>
//#include <FTGL/ftgl.h>
#include <QCheckBox>
#include <sys/time.h>
......@@ -26,7 +26,7 @@ QMap3DWidget::QMap3DWidget(QWidget* parent)
buildLayout();
font.reset(new FTTextureFont("images/Vera.ttf"));
//font.reset(new FTTextureFont("images/Vera.ttf"));
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)),
this, SLOT(setActiveUAS(UASInterface*)));
......@@ -55,6 +55,9 @@ QMap3DWidget::buildLayout(void)
lockCameraCheckBox->setText("Lock Camera");
lockCameraCheckBox->setChecked(lockCamera);
positionLabel = new QLabel(this);
positionLabel->setText(tr("Waiting for first position update.. "));
QGridLayout* layout = new QGridLayout(this);
layout->setMargin(0);
layout->setSpacing(2);
......@@ -63,6 +66,7 @@ QMap3DWidget::buildLayout(void)
layout->addWidget(trailCheckBox, 1, 1);
layout->addWidget(recenterButton, 1, 2);
layout->addWidget(lockCameraCheckBox, 1, 3);
layout->addWidget(positionLabel, 1, 4);
layout->setRowStretch(0, 100);
layout->setRowStretch(1, 1);
layout->setColumnStretch(0, 1);
......@@ -143,26 +147,29 @@ QMap3DWidget::displayHandler(void)
glVertex2f(getWindowWidth(), 0.0f);
glEnd();
char buffer[6][255];
sprintf(buffer[0], "x = %.2f", robotX);
sprintf(buffer[1], "y = %.2f", robotY);
sprintf(buffer[2], "z = %.2f", robotZ);
sprintf(buffer[3], "r = %.2f", robotRoll);
sprintf(buffer[4], "p = %.2f", robotPitch);
sprintf(buffer[5], "y = %.2f", robotYaw);
font->FaceSize(10);
glColor3f(1.0f, 1.0f, 1.0f);
glPushMatrix();
glTranslatef(0.0f, 30.0f, 0.0f);
for (int32_t i = 0; i < 6; ++i)
{
glTranslatef(60.0f, 0.0f, 0.0f);
font->Render(buffer[i]);
}
glPopMatrix();
// char buffer[6][255];
//
// sprintf(buffer[0], "x = %.2f", robotX);
// sprintf(buffer[1], "y = %.2f", robotY);
// sprintf(buffer[2], "z = %.2f", robotZ);
// sprintf(buffer[3], "r = %.2f", robotRoll);
// sprintf(buffer[4], "p = %.2f", robotPitch);
// sprintf(buffer[5], "y = %.2f", robotYaw);
positionLabel->setText(QString("x = %1 y = %2 z = %3 r = %4 p = %5 y = %6").arg(robotX).arg(robotY).arg(robotZ).arg(robotRoll).arg(robotPitch).arg(robotYaw));
// font->FaceSize(10);
// glColor3f(1.0f, 1.0f, 1.0f);
// glPushMatrix();
//
// glTranslatef(0.0f, 30.0f, 0.0f);
// for (int32_t i = 0; i < 6; ++i)
// {
// glTranslatef(60.0f, 0.0f, 0.0f);
// font->Render(buffer[i]);
// }
// glPopMatrix();
}
/**
......
#ifndef QMAP3DWIDGET_H
#define QMAP3DWIDGET_H
#include <QLabel>
#include "Q3DWidget.h"
class CheetahModel;
class FTTextureFont;
class UASInterface;
class QMap3DWidget : public Q3DWidget
......@@ -36,6 +37,7 @@ private slots:
protected:
UASInterface* uas;
QLabel* positionLabel;
private:
void drawPlatform(float roll, float pitch, float yaw);
......@@ -57,7 +59,6 @@ private:
QVarLengthArray<Pose3D, 10000> trail;
QScopedPointer<CheetahModel> cheetahModel;
QScopedPointer<FTTextureFont> font;
};
#endif // QMAP3DWIDGET_H
Markdown is supported
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