Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
68a2f242
Commit
68a2f242
authored
Sep 23, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 3D view
parent
306c978c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
48 additions
and
35 deletions
+48
-35
qgroundcontrol.pro
qgroundcontrol.pro
+1
-3
CheetahGL.cc
src/ui/map3D/CheetahGL.cc
+5
-6
CheetahGL.h
src/ui/map3D/CheetahGL.h
+4
-0
CheetahModel.h
src/ui/map3D/CheetahModel.h
+4
-0
Q3DWidget.cc
src/ui/map3D/Q3DWidget.cc
+3
-2
Q3DWidget.h
src/ui/map3D/Q3DWidget.h
+0
-1
QMap3DWidget.cc
src/ui/map3D/QMap3DWidget.cc
+28
-21
QMap3DWidget.h
src/ui/map3D/QMap3DWidget.h
+3
-2
No files found.
qgroundcontrol.pro
View file @
68a2f242
...
...
@@ -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
\
...
...
src/ui/map3D/CheetahGL.cc
View file @
68a2f242
/*
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
src/ui/map3D/CheetahGL.h
View file @
68a2f242
#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
);
...
...
src/ui/map3D/CheetahModel.h
View file @
68a2f242
#ifndef CHEETAHMODEL_H_
#define CHEETAHMODEL_H_
#if (defined __APPLE__) & (defined __MACH__)
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
class
CheetahModel
{
...
...
src/ui/map3D/Q3DWidget.cc
View file @
68a2f242
#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.0
f
;
static
const
float
KEY_MOVE_AMOUNT
=
10.0
f
;
...
...
src/ui/map3D/Q3DWidget.h
View file @
68a2f242
#ifndef Q3DWIDGET_H_
#define Q3DWIDGET_H_
#include <boost/scoped_ptr.hpp>
#include <inttypes.h>
#include <string>
#include <QtOpenGL>
...
...
src/ui/map3D/QMap3DWidget.cc
View file @
68a2f242
#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.0
f
);
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.0
f
,
1.0
f
,
1.0
f
);
glPushMatrix
();
glTranslatef
(
0.0
f
,
30.0
f
,
0.0
f
);
for
(
int32_t
i
=
0
;
i
<
6
;
++
i
)
{
glTranslatef
(
60.0
f
,
0.0
f
,
0.0
f
);
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();
}
/**
...
...
src/ui/map3D/QMap3DWidget.h
View file @
68a2f242
#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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment