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
64c3c562
Commit
64c3c562
authored
Apr 12, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of pixhawk.ethz.ch:groundcontrol
parents
2075abda
36a43a28
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
72 additions
and
99 deletions
+72
-99
.gitignore
.gitignore
+3
-2
libflite_cmu_time_awb.a
lib/flite/linux32/libflite_cmu_time_awb.a
+0
-0
libflite_cmu_us_awb.a
lib/flite/linux32/libflite_cmu_us_awb.a
+0
-0
libflite_cmu_us_kal.a
lib/flite/linux32/libflite_cmu_us_kal.a
+0
-0
libflite_cmu_us_kal16.a
lib/flite/linux32/libflite_cmu_us_kal16.a
+0
-0
qgroundcontrol.pri
qgroundcontrol.pri
+4
-7
qgroundcontrol.pro
qgroundcontrol.pro
+1
-1
GAudioOutput.cc
src/GAudioOutput.cc
+31
-42
GAudioOutput.h
src/GAudioOutput.h
+4
-2
HUD.cc
src/ui/HUD.cc
+29
-45
No files found.
.gitignore
View file @
64c3c562
...
...
@@ -15,5 +15,6 @@ qrc_*.cpp
tmp
debug
release
qgroundcontrol.xcodeproj/**
qgroundcontrol
qgroundcontrol *.wav
qgroundcontrol.xcodeproj/**
...
...
lib/flite/linux32/libflite_cmu_time_awb.a
deleted
100644 → 0
View file @
2075abda
File deleted
lib/flite/linux32/libflite_cmu_us_awb.a
deleted
100644 → 0
View file @
2075abda
File deleted
lib/flite/linux32/libflite_cmu_us_kal.a
deleted
100644 → 0
View file @
2075abda
File deleted
lib/flite/linux32/libflite_cmu_us_kal16.a
deleted
100644 → 0
View file @
2075abda
File deleted
mavground
.pri
→
qgroundcontrol
.pri
View file @
64c3c562
...
...
@@ -40,11 +40,6 @@ OBJECTS_DIR = $$BUILDDIR/obj
MOC_DIR = $$BUILDDIR/moc
UI_HEADERS_DIR = src/ui/generated
# Add external libraries
INCLUDEPATH += $$BASEDIR/lib/flite/include \
$$BASEDIR/lib/flite/lang
#$$BASEDIR/lib/qextserialport/include
# $$BASEDIR/lib/openjaus/libjaus/include \
# $$BASEDIR/lib/openjaus/libopenJaus/include
...
...
@@ -99,7 +94,10 @@ linux-g++ {
release {
DESTDIR = $$BASEDIR
}
INCLUDEPATH += /usr/include
INCLUDEPATH += /usr/include \
$$BASEDIR/lib/flite/include \
$$BASEDIR/lib/flite/lang
HARDWARE_PLATFORM = $$system(uname -a)
contains( HARDWARE_PLATFORM, x86_64 ) {
...
...
@@ -114,7 +112,6 @@ linux-g++ {
message(Building for GNU/Linux 32bit/i386)
}
LIBS += -lm \
-lflite_cmu_us_awb \
-lflite_cmu_us_rms \
-lflite_cmu_us_slt \
-lflite_usenglish \
...
...
mavground
.pro
→
qgroundcontrol
.pro
View file @
64c3c562
# Include general settings for MAVGround
include
(
mavground
.
pri
)
include
(
qgroundcontrol
.
pri
)
#
Include
serial
port
library
include
(
src
/
lib
/
qextserialport
/
qextserialport
.
pri
)
...
...
src/GAudioOutput.cc
View file @
64c3c562
...
...
@@ -49,13 +49,13 @@ using System.Speech.Synthesis;
#ifdef Q_OS_LINUX
extern
"C"
{
#include <flite.h>
#include <cmu_us_awb/voxdefs.h>
#include <flite.h>
#include <cmu_us_awb/voxdefs.h>
//#include <cmu_us_slt/voxdefs.h>
//cst_voice *REGISTER_VOX(const char *voxdir);
//void UNREGISTER_VOX(cst_voice *vox);
cst_voice
*
register_cmu_us_awb
(
const
char
*
voxdir
);
void
unregister_cmu_us_awb
(
cst_voice
*
vox
);
//
cst_voice *register_cmu_us_awb(const char *voxdir);
//
void unregister_cmu_us_awb(cst_voice *vox);
cst_voice
*
register_cmu_us_slt
(
const
char
*
voxdir
);
void
unregister_cmu_us_slt
(
cst_voice
*
vox
);
cst_voice
*
register_cmu_us_rms
(
const
char
*
voxdir
);
...
...
@@ -92,9 +92,12 @@ emergency(false)
#ifdef Q_OS_LINUX
flite_init
();
#endif
// Initialize audio output
m_media
=
new
Phonon
::
MediaObject
(
this
);
Phonon
::
AudioOutput
*
audioOutput
=
new
Phonon
::
AudioOutput
(
Phonon
::
MusicCategory
,
this
);
createPath
(
m_media
,
audioOutput
);
// Prepare regular emergency signal, will be fired off on calling startEmergency()
emergencyTimer
=
new
QTimer
();
connect
(
emergencyTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
beep
()));
...
...
@@ -103,11 +106,8 @@ emergency(false)
case
0
:
selectFemaleVoice
();
break
;
case
1
:
selectMaleVoice
();
break
;
default:
select
Neutral
Voice
();
select
Male
Voice
();
break
;
}
}
...
...
@@ -133,7 +133,6 @@ bool GAudioOutput::say(QString text, int severity)
// file.fileName() returns the unique file name
cst_wave_save
(
wav
,
file
.
fileName
().
toStdString
().
c_str
(),
"riff"
);
m_media
->
setCurrentSource
(
Phonon
::
MediaSource
(
file
.
fileName
().
toStdString
().
c_str
()));
qDebug
()
<<
"TYPE:"
<<
m_media
->
currentSource
().
type
();
m_media
->
play
();
qDebug
()
<<
"Synthesized: "
<<
text
<<
", tmp file:"
<<
file
.
fileName
().
toStdString
().
c_str
();
res
=
true
;
...
...
@@ -150,10 +149,6 @@ bool GAudioOutput::say(QString text, int severity)
SpeakString
(
str2
);
qDebug
()
<<
"Synthesized: "
<<
text
.
toAscii
();
#endif
#ifdef Q_OS_WIN32
qDebug
()
<<
"Synthesized: "
<<
text
<<
", NO OUTPUT SUPPORT ON WINDOWS!"
;
#endif
}
return
res
;
}
...
...
@@ -228,52 +223,46 @@ void GAudioOutput::beep()
void
GAudioOutput
::
selectFemaleVoice
()
{
#ifdef Q_OS_LINUX
//
this->voice = register_cmu_us_slt(NULL);
this
->
voice
=
register_cmu_us_slt
(
NULL
);
#endif
}
void
GAudioOutput
::
selectMaleVoice
()
{
#ifdef Q_OS_LINUX
//
this->voice = register_cmu_us_rms(NULL);
this
->
voice
=
register_cmu_us_rms
(
NULL
);
#endif
}
/*
void GAudioOutput::selectNeutralVoice()
{
#ifdef Q_OS_LINUX
//
this->voice = register_cmu_us_awb(NULL);
this->voice = register_cmu_us_awb(NULL);
#endif
}
}
*/
#ifdef __cplusplus
extern
"C"
{
#endif
/* __cplusplus */
QStringList
GAudioOutput
::
listVoices
(
void
)
{
QStringList
l
;
QStringList
GAudioOutput
::
listVoices
(
void
)
{
QStringList
l
;
#ifdef Q_OS_LINUX
cst_voice
*
voice
;
const
cst_val
*
v
;
cst_voice
*
voice
;
const
cst_val
*
v
;
/*
printf("Voices available: ");
for (v=flite_voice_list; v; v=val_cdr(v))
{
voice = val_voice(val_car(v));
QString s;
s.sprintf("%s",voice->name);
printf("%s",voice->name);
l.append(s);
}
printf("\n");
*/
#endif
return
l
;
printf
(
"Voices available: "
);
for
(
v
=
flite_voice_list
;
v
;
v
=
val_cdr
(
v
))
{
voice
=
val_voice
(
val_car
(
v
));
QString
s
;
s
.
sprintf
(
"%s"
,
voice
->
name
);
printf
(
"%s"
,
voice
->
name
);
l
.
append
(
s
);
}
#ifdef __cplusplus
printf
(
"
\n
"
);
#endif
return
l
;
}
#endif
/* __cplusplus */
src/GAudioOutput.h
View file @
64c3c562
...
...
@@ -65,6 +65,10 @@ public:
static
GAudioOutput
*
instance
();
/** @brief List available voices */
QStringList
listVoices
(
void
);
enum
{
VOICE_MALE
=
0
,
VOICE_FEMALE
}
QGVoice
;
public
slots
:
/** @brief Say this text if current output priority matches */
...
...
@@ -79,8 +83,6 @@ public slots:
void
selectFemaleVoice
();
/** @brief Select male voice */
void
selectMaleVoice
();
/** @brief Select neutral voice */
void
selectNeutralVoice
();
/** @brief Play emergency sound */
void
beep
();
...
...
src/ui/HUD.cc
View file @
64c3c562
...
...
@@ -449,13 +449,12 @@ void HUD::paintText(QString text, QColor color, float fontSize, float refX, floa
void
HUD
::
initializeGL
()
{
glEnable
(
GL_MULTISAMPLE
);
bool
antialiasing
=
true
;
// Antialiasing setup
if
(
antialiasing
)
{
glEnable
(
GL_MULTISAMPLE
);
glEnable
(
GL_BLEND
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
...
...
@@ -468,9 +467,9 @@ void HUD::initializeGL()
}
else
{
glDisable
(
GL_BLEND
);
glDisable
(
GL_POINT_SMOOTH
);
glDisable
(
GL_LINE_SMOOTH
);
//
glDisable(GL_BLEND);
//
glDisable(GL_POINT_SMOOTH);
//
glDisable(GL_LINE_SMOOTH);
}
}
...
...
@@ -513,6 +512,7 @@ void HUD::paintRollPitchStrips()
void
HUD
::
paintGL
()
{
// Read out most important values to limit hash table lookups
float
roll
=
roll
*
0.5
+
0.5
*
values
.
value
(
"roll"
,
0.0
f
);
float
pitch
=
pitch
*
0.5
+
0.5
*
values
.
value
(
"pitch"
,
0.0
f
);
...
...
@@ -527,7 +527,7 @@ void HUD::paintGL()
double
scalingFactorH
=
this
->
height
()
/
vheight
;
if
(
scalingFactorH
<
scalingFactor
)
scalingFactor
=
scalingFactorH
;
makeCurrent
();
//
makeCurrent();
glClear
(
GL_COLOR_BUFFER_BIT
);
//if(!noCamera) glDrawPixels(glImage.width(), glImage.height(), GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits());
glDrawPixels
(
glImage
.
width
(),
glImage
.
height
(),
GL_RGBA
,
GL_UNSIGNED_BYTE
,
glImage
.
bits
());
// FIXME Remove after testing
...
...
@@ -536,22 +536,7 @@ void HUD::paintGL()
// Blue / Brown background
if
(
noCamera
)
paintCenterBackground
(
roll
,
pitch
,
yaw
);
glFlush
();
// Draw instruments
// TESTING THIS SHOULD BE MOVED INTO A QGRAPHICSVIEW
/*
QPainter painter(this);
painter.setRenderHint(QPainter::HighQualityAntialiasing);
const float gaugeWidth = 15.0f;
const QColor gaugeColor = QColor(200, 200, 200);
drawSystemIndicator(vwidth+10.0f-gaugeWidth/2.0f, 20.0f, 10.0f, 40.0f, 15.0f, &painter);
drawGauge(vwidth+10.0f, 50.0f, gaugeWidth/2.0f, 0, 1.0f, "thrust", values.value("thrust", 0.0f), gaugeColor, &painter, qMakePair(0.45f, 0.8f), qMakePair(0.8f, 1.0f), true);
drawGauge(vwidth+10.0f+gaugeWidth*1.7f, 50.0f, gaugeWidth/2.0f, 0, 10.0f, "altitude", values.value("altitude", 0.0f), gaugeColor, &painter, qMakePair(1.0f, 2.5f), qMakePair(0.0f, 0.5f), true);
*/
// END TESTING
//glFlush();
// // Store current GL model view
// glMatrixMode(GL_MODELVIEW);
...
...
@@ -571,7 +556,7 @@ void HUD::paintGL()
QPainter
painter
(
this
);
painter
.
setRenderHint
(
QPainter
::
Antialiasing
,
true
);
painter
.
setRenderHint
(
QPainter
::
HighQualityAntialiasing
,
true
);
//
painter.setRenderHint(QPainter::HighQualityAntialiasing, true);
painter
.
translate
((
this
->
vwidth
/
2.0
+
xCenterOffset
)
*
scalingFactor
,
(
this
->
vheight
/
2.0
+
yCenterOffset
)
*
scalingFactor
);
// COORDINATE FRAME IS NOW (0,0) at CENTER OF WIDGET
...
...
@@ -603,6 +588,8 @@ void HUD::paintGL()
painter
.
setPen
(
defaultColor
);
painter
.
drawPolyline
(
yawIndicator
);
// CENTER
// HEADING INDICATOR
//
// __ __
...
...
@@ -624,6 +611,23 @@ void HUD::paintGL()
painter
.
drawPolyline
(
hIndicator
);
// SETPOINT
const
float
centerWidth
=
4.0
f
;
painter
.
setPen
(
defaultColor
);
painter
.
setBrush
(
Qt
::
NoBrush
);
// TODO
//painter.drawEllipse(QPointF(refToScreenX(qMin(10.0f, values.value("roll desired", 0.0f) * 10.0f)), refToScreenY(qMin(10.0f, values.value("pitch desired", 0.0f) * 10.0f))), refToScreenX(centerWidth/2.0f), refToScreenX(centerWidth/2.0f));
const
float
centerCrossWidth
=
10.0
f
;
// left
painter
.
drawLine
(
QPointF
(
refToScreenX
(
-
centerWidth
/
2.0
f
),
refToScreenY
(
0.0
f
)),
QPointF
(
refToScreenX
(
-
centerCrossWidth
/
2.0
f
),
refToScreenY
(
0.0
f
)));
// right
painter
.
drawLine
(
QPointF
(
refToScreenX
(
centerWidth
/
2.0
f
),
refToScreenY
(
0.0
f
)),
QPointF
(
refToScreenX
(
centerCrossWidth
/
2.0
f
),
refToScreenY
(
0.0
f
)));
// top
painter
.
drawLine
(
QPointF
(
refToScreenX
(
0.0
f
),
refToScreenY
(
-
centerWidth
/
2.0
f
)),
QPointF
(
refToScreenX
(
0.0
f
),
refToScreenY
(
-
centerCrossWidth
/
2.0
f
)));
// COMPASS
const
float
compassY
=
-
vheight
/
2.0
f
+
10.0
f
;
QRectF
compassRect
(
QPointF
(
refToScreenX
(
-
5.0
f
),
refToScreenY
(
compassY
)),
QSizeF
(
refToScreenX
(
10.0
f
),
refToScreenY
(
5.0
f
)));
...
...
@@ -656,8 +660,6 @@ void HUD::paintGL()
// MOVING PARTS
// Translate for yaw
const
float
maxYawTrans
=
60.0
f
;
float
yawDiff
=
valuesDot
.
value
(
"yaw"
,
0.0
f
);
...
...
@@ -675,7 +677,7 @@ void HUD::paintGL()
yawInt
*=
0.6
f
;
//qDebug() << "yaw translation" << yawTrans << "integral" << yawInt << "difference" << yawDiff << "yaw" << yaw << "asin(yawInt)" << asinYaw;
painter
.
translate
(
0
,
(
pitch
/
M_PI
)
*
-
180.0
f
*
refToScreenY
(
2.0
f
));
painter
.
translate
(
0
,
(
pitch
/
M_PI
)
*
-
180.0
f
*
refToScreenY
(
1.8
));
painter
.
translate
(
refToScreenX
(
yawTrans
),
0
);
...
...
@@ -684,25 +686,7 @@ void HUD::paintGL()
// Rotate view and draw all roll-dependent indicators
painter
.
rotate
((
roll
/
M_PI
)
*
-
180.0
f
);
qDebug
()
<<
"ROLL"
<<
roll
<<
"PITCH"
<<
pitch
<<
"YAW DIFF"
<<
valuesDot
.
value
(
"roll"
,
0.0
f
);
// CENTER
// SETPOINT
const
float
centerWidth
=
4.0
f
;
painter
.
setPen
(
defaultColor
);
painter
.
setBrush
(
Qt
::
NoBrush
);
// TODO
//painter.drawEllipse(QPointF(refToScreenX(qMin(10.0f, values.value("roll desired", 0.0f) * 10.0f)), refToScreenY(qMin(10.0f, values.value("pitch desired", 0.0f) * 10.0f))), refToScreenX(centerWidth/2.0f), refToScreenX(centerWidth/2.0f));
const
float
centerCrossWidth
=
10.0
f
;
// left
painter
.
drawLine
(
QPointF
(
refToScreenX
(
-
centerWidth
/
2.0
f
),
refToScreenY
(
0.0
f
)),
QPointF
(
refToScreenX
(
-
centerCrossWidth
/
2.0
f
),
refToScreenY
(
0.0
f
)));
// right
painter
.
drawLine
(
QPointF
(
refToScreenX
(
centerWidth
/
2.0
f
),
refToScreenY
(
0.0
f
)),
QPointF
(
refToScreenX
(
centerCrossWidth
/
2.0
f
),
refToScreenY
(
0.0
f
)));
// top
painter
.
drawLine
(
QPointF
(
refToScreenX
(
0.0
f
),
refToScreenY
(
-
centerWidth
/
2.0
f
)),
QPointF
(
refToScreenX
(
0.0
f
),
refToScreenY
(
-
centerCrossWidth
/
2.0
f
)));
//qDebug() << "ROLL" << roll << "PITCH" << pitch << "YAW DIFF" << valuesDot.value("roll", 0.0f);
// PITCH
...
...
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