Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
f4504903
Commit
f4504903
authored
Jan 10, 2012
by
LM
Browse files
Updated to latest MAVLink
parent
7fe1c809
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/uas/UAS.cc
View file @
f4504903
...
...
@@ -767,6 +767,8 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
imagePayload
=
p
.
payload
;
imageQuality
=
p
.
jpg_quality
;
imageType
=
p
.
type
;
imageWidth
=
p
.
width
;
imageHeight
=
p
.
height
;
imageStart
=
QGC
::
groundTimeMilliseconds
();
}
break
;
...
...
@@ -1392,16 +1394,13 @@ QImage UAS::getImage()
// RAW greyscale
if
(
imageType
==
MAVLINK_DATA_STREAM_IMG_RAW8U
)
{
// TODO FIXME Fabian
// RAW hardcoded to 22x22
int
imgWidth
=
22
;
int
imgHeight
=
22
;
int
imgColors
=
255
;
// TODO FIXME
int
imgColors
=
255
;
//imageSize/(imageWidth*imageHeight);
//const int headerSize = 15;
// Construct PGM header
QString
header
(
"P5
\n
%1 %2
\n
%3
\n
"
);
header
=
header
.
arg
(
im
g
Width
).
arg
(
im
g
Height
).
arg
(
imgColors
);
header
=
header
.
arg
(
im
age
Width
).
arg
(
im
age
Height
).
arg
(
imgColors
);
QByteArray
tmpImage
(
header
.
toStdString
().
c_str
(),
header
.
toStdString
().
size
());
tmpImage
.
append
(
imageRecBuffer
);
...
...
@@ -1451,7 +1450,7 @@ void UAS::requestImage()
if
(
imagePacketsArrived
==
0
)
{
mavlink_message_t
msg
;
mavlink_msg_data_transmission_handshake_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
DATA_TYPE_JPEG_IMAGE
,
0
,
0
,
0
,
50
);
mavlink_msg_data_transmission_handshake_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
DATA_TYPE_JPEG_IMAGE
,
0
,
0
,
0
,
0
,
0
,
50
);
sendMessage
(
msg
);
}
#endif
...
...
src/uas/UAS.h
View file @
f4504903
...
...
@@ -214,6 +214,8 @@ protected: //COMMENTS FOR TEST UNIT
int
imagePayload
;
///< Payload size per transmitted packet (bytes). Standard is 254, and decreases when image resolution increases.
int
imageQuality
;
///< Quality of the transmitted image (percentage)
int
imageType
;
///< Type of the transmitted image (BMP, PNG, JPEG, RAW 8 bit, RAW 32 bit)
int
imageWidth
;
///< Width of the image stream
int
imageHeight
;
///< Width of the image stream
QByteArray
imageRecBuffer
;
///< Buffer for the incoming bytestream
QImage
image
;
///< Image data of last completely transmitted image
quint64
imageStart
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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