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
adc5ee2c
Commit
adc5ee2c
authored
Feb 13, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added debug output for QMapControl library, added GPS_RAW_INT message
parent
cb9774ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
6 deletions
+49
-6
mapnetwork.cpp
lib/QMapControl/src/mapnetwork.cpp
+9
-6
UAS.cc
src/uas/UAS.cc
+40
-0
No files found.
lib/QMapControl/src/mapnetwork.cpp
View file @
adc5ee2c
...
...
@@ -63,10 +63,10 @@ namespace qmapcontrol
void
MapNetwork
::
requestFinished
(
int
id
,
bool
error
)
{
// sleep(1);
// qDebug() << "
MapNetwork::requestFinished" << http->state() << ", id: " << id;
qDebug
()
<<
"QMapControl:
MapNetwork::requestFinished"
<<
http
->
state
()
<<
", id: "
<<
id
;
if
(
error
)
{
qDebug
()
<<
"network error: "
<<
http
->
errorString
();
qDebug
()
<<
"
QMapControl:
network error: "
<<
http
->
errorString
();
//restart query
}
...
...
@@ -79,7 +79,7 @@ namespace qmapcontrol
QString
url
=
loadingMap
[
id
];
loadingMap
.
remove
(
id
);
vectorMutex
.
unlock
();
//
qDebug() << "
request finished for id: " << id << ", belongs to: " << notifier.url << endl;
//
qDebug() << "QMapControl:
request finished for id: " << id << ", belongs to: " << notifier.url << endl;
QByteArray
ax
;
if
(
http
->
bytesAvailable
()
>
0
)
...
...
@@ -87,17 +87,20 @@ namespace qmapcontrol
QPixmap
pm
;
ax
=
http
->
readAll
();
qDebug
()
<<
"QMapControl: Request consisted of "
<<
ax
.
size
()
<<
"bytes"
;
if
(
pm
.
loadFromData
(
ax
))
{
loaded
+=
pm
.
size
().
width
()
*
pm
.
size
().
height
()
*
pm
.
depth
()
/
8
/
1024
;
// qDebug() << "
Network loaded: " << (loaded);
qDebug
()
<<
"QMapControl:
Network loaded: "
<<
(
loaded
);
parent
->
receivedImage
(
pm
,
url
);
}
else
if
(
pm
.
width
()
==
0
||
pm
.
height
()
==
0
)
{
// Silently ignore map request for a
// 0xn pixel map
qDebug
()
<<
"QMapControl: IGNORED 0x0 pixel map request, widthxheight:"
<<
pm
.
width
()
<<
"x"
<<
pm
.
height
();
qDebug
()
<<
"QMapControl: HTML ERROR MESSAGE:"
<<
ax
<<
"at "
<<
__FILE__
<<
__LINE__
;
}
else
{
...
...
@@ -105,7 +108,7 @@ namespace qmapcontrol
// TODO Error is currently undetected
//qDebug() << "NETWORK_PIXMAP_ERROR: " << ax;
qDebug
()
<<
"QMapControl external library: ERROR loading map:"
<<
"width:"
<<
pm
.
width
()
<<
"heigh:"
<<
pm
.
height
()
<<
"at "
<<
__FILE__
<<
__LINE__
;
//qDebug() << "
HTML ERROR MESSAGE:" << ax << "at " << __FILE__ << __LINE__;
qDebug
()
<<
"QMapControl:
HTML ERROR MESSAGE:"
<<
ax
<<
"at "
<<
__FILE__
<<
__LINE__
;
}
}
...
...
src/uas/UAS.cc
View file @
adc5ee2c
...
...
@@ -628,6 +628,46 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
}
break
;
case
MAVLINK_MSG_ID_GPS_RAW_INT
:
{
mavlink_gps_raw_int_t
pos
;
mavlink_msg_gps_raw_int_decode
(
&
message
,
&
pos
);
// SANITY CHECK
// only accept values in a realistic range
// quint64 time = getUnixTime(pos.usec);
quint64
time
=
getUnixTime
();
emit
valueChanged
(
uasId
,
"latitude"
,
"deg"
,
pos
.
lat
/
(
double
)
1E7
,
time
);
emit
valueChanged
(
uasId
,
"longitude"
,
"deg"
,
pos
.
lon
/
(
double
)
1E7
,
time
);
if
(
pos
.
fix_type
>
0
)
{
emit
globalPositionChanged
(
this
,
pos
.
lat
/
(
double
)
1E7
,
pos
.
lon
/
(
double
)
1E7
,
pos
.
alt
/
1000.0
,
time
);
emit
valueChanged
(
uasId
,
"gps speed"
,
"m/s"
,
pos
.
v
,
time
);
// Check for NaN
int
alt
=
pos
.
alt
;
if
(
alt
!=
alt
)
{
alt
=
0
;
emit
textMessageReceived
(
uasId
,
message
.
compid
,
255
,
"GCS ERROR: RECEIVED NaN FOR ALTITUDE"
);
}
emit
valueChanged
(
uasId
,
"altitude"
,
"m"
,
pos
.
alt
/
(
double
)
1E7
,
time
);
// Smaller than threshold and not NaN
if
(
pos
.
v
<
1000000
&&
pos
.
v
==
pos
.
v
)
{
emit
valueChanged
(
uasId
,
"speed"
,
"m/s"
,
pos
.
v
,
time
);
//qDebug() << "GOT GPS RAW";
// emit speedChanged(this, (double)pos.v, 0.0, 0.0, time);
}
else
{
emit
textMessageReceived
(
uasId
,
message
.
compid
,
255
,
QString
(
"GCS ERROR: RECEIVED INVALID SPEED OF %1 m/s"
).
arg
(
pos
.
v
));
}
}
}
break
;
case
MAVLINK_MSG_ID_GPS_STATUS
:
{
mavlink_gps_status_t
pos
;
...
...
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