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
260c0ce4
Commit
260c0ce4
authored
Jul 02, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show detected letters
parent
cac8880f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+4
-2
UASInterface.h
src/uas/UASInterface.h
+1
-0
ObjectDetectionView.cc
src/ui/ObjectDetectionView.cc
+14
-0
ObjectDetectionView.h
src/ui/ObjectDetectionView.h
+2
-0
No files found.
src/uas/PxQuadMAV.cc
View file @
260c0ce4
...
...
@@ -43,13 +43,15 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
break
;
case
MAVLINK_MSG_ID_PATTERN_DETECTED
:
{
mavlink_pattern_detected_t
detected
;
mavlink_msg_pattern_detected_decode
(
&
message
,
&
detected
);
QByteArray
b
;
b
.
resize
(
256
);
mavlink_msg_pattern_detected_get_file
(
&
message
,
(
int8_t
*
)
b
.
data
());
b
.
append
(
'\0'
);
QString
path
=
QString
(
b
);
bool
detected
(
mavlink_msg_pattern_detected_get_detected
(
&
message
)
==
1
?
true
:
false
);
emit
detectionReceived
(
uasId
,
path
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
mavlink_msg_pattern_detected_get_confidence
(
&
message
),
detected
);
emit
detectionReceived
(
uasId
,
path
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
mavlink_msg_pattern_detected_get_confidence
(
&
message
),
detected
.
detected
);
emit
letterDetected
(
uasId
,
path
,
detected
.
confidence
,
detected
.
detected
);
}
break
;
case
MAVLINK_MSG_ID_WATCHDOG_HEARTBEAT
:
...
...
src/uas/UASInterface.h
View file @
260c0ce4
...
...
@@ -291,6 +291,7 @@ signals:
void
autoModeChanged
(
bool
autoMode
);
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
float
value
);
void
detectionReceived
(
int
uasId
,
QString
patternPath
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
x3
,
int
y3
,
int
x4
,
int
y4
,
double
confidence
,
bool
detected
);
void
letterDetected
(
int
uasId
,
QString
letter
,
float
confidence
,
bool
detected
);
/**
* @brief The battery status has been updated
*
...
...
src/ui/ObjectDetectionView.cc
View file @
260c0ce4
...
...
@@ -75,9 +75,18 @@ void ObjectDetectionView::setUAS(UASInterface* uas)
//{
this
->
uas
=
uas
;
connect
(
uas
,
SIGNAL
(
detectionReceived
(
int
,
QString
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
double
,
bool
)),
this
,
SLOT
(
newDetection
(
int
,
QString
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
int
,
double
,
bool
)));
connect
(
uas
,
SIGNAL
(
letterDetected
(
int
,
QString
,
float
,
bool
)),
this
,
SLOT
(
newLetter
(
int
,
QString
,
float
,
bool
)));
//}
}
void
ObjectDetectionView
::
newLetter
(
int
uasId
,
QString
letter
,
float
confidence
,
bool
detected
)
{
// Emit audio message on detection
if
(
detected
)
GAudioOutput
::
instance
()
->
say
(
"System "
+
QString
::
number
(
uasId
)
+
" detected letter "
+
letter
);
m_ui
->
nameLabel
->
setText
(
letter
);
m_ui
->
imageLabel
->
setText
(
letter
);
}
void
ObjectDetectionView
::
newDetection
(
int
uasId
,
QString
patternPath
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
x3
,
int
y3
,
int
x4
,
int
y4
,
double
confidence
,
bool
detected
)
{
Q_UNUSED
(
x1
);
...
...
@@ -88,6 +97,11 @@ void ObjectDetectionView::newDetection(int uasId, QString patternPath, int x1, i
Q_UNUSED
(
y3
);
Q_UNUSED
(
x4
);
Q_UNUSED
(
y4
);
newDetection
(
uasId
,
patternPath
,
confidence
,
detected
);
}
void
ObjectDetectionView
::
newDetection
(
int
uasId
,
QString
patternPath
,
float
confidence
,
bool
detected
)
{
if
(
detected
)
{
if
(
patternList
.
contains
(
patternPath
))
...
...
src/ui/ObjectDetectionView.h
View file @
260c0ce4
...
...
@@ -59,6 +59,8 @@ public slots:
void
setUAS
(
UASInterface
*
uas
);
/** @brief Report new detection */
void
newDetection
(
int
uasId
,
QString
patternPath
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
x3
,
int
y3
,
int
x4
,
int
y4
,
double
confidence
,
bool
detected
);
void
newLetter
(
int
uasId
,
QString
letter
,
float
confidence
,
bool
detected
);
void
newDetection
(
int
uasId
,
QString
patternPath
,
float
confidence
,
bool
detected
);
/** @brief Accept an internal action, update name and preview image label */
void
takeAction
();
...
...
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