Commit f4504903 authored by LM's avatar LM

Updated to latest MAVLink

parent 7fe1c809
...@@ -767,6 +767,8 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -767,6 +767,8 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
imagePayload = p.payload; imagePayload = p.payload;
imageQuality = p.jpg_quality; imageQuality = p.jpg_quality;
imageType = p.type; imageType = p.type;
imageWidth = p.width;
imageHeight = p.height;
imageStart = QGC::groundTimeMilliseconds(); imageStart = QGC::groundTimeMilliseconds();
} }
break; break;
...@@ -1392,16 +1394,13 @@ QImage UAS::getImage() ...@@ -1392,16 +1394,13 @@ QImage UAS::getImage()
// RAW greyscale // RAW greyscale
if (imageType == MAVLINK_DATA_STREAM_IMG_RAW8U) if (imageType == MAVLINK_DATA_STREAM_IMG_RAW8U)
{ {
// TODO FIXME Fabian // TODO FIXME
// RAW hardcoded to 22x22 int imgColors = 255;//imageSize/(imageWidth*imageHeight);
int imgWidth = 22;
int imgHeight = 22;
int imgColors = 255;
//const int headerSize = 15; //const int headerSize = 15;
// Construct PGM header // Construct PGM header
QString header("P5\n%1 %2\n%3\n"); QString header("P5\n%1 %2\n%3\n");
header = header.arg(imgWidth).arg(imgHeight).arg(imgColors); header = header.arg(imageWidth).arg(imageHeight).arg(imgColors);
QByteArray tmpImage(header.toStdString().c_str(), header.toStdString().size()); QByteArray tmpImage(header.toStdString().c_str(), header.toStdString().size());
tmpImage.append(imageRecBuffer); tmpImage.append(imageRecBuffer);
...@@ -1451,7 +1450,7 @@ void UAS::requestImage() ...@@ -1451,7 +1450,7 @@ void UAS::requestImage()
if (imagePacketsArrived == 0) if (imagePacketsArrived == 0)
{ {
mavlink_message_t msg; 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); sendMessage(msg);
} }
#endif #endif
......
...@@ -214,6 +214,8 @@ protected: //COMMENTS FOR TEST UNIT ...@@ -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 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 imageQuality; ///< Quality of the transmitted image (percentage)
int imageType; ///< Type of the transmitted image (BMP, PNG, JPEG, RAW 8 bit, RAW 32 bit) 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 QByteArray imageRecBuffer; ///< Buffer for the incoming bytestream
QImage image; ///< Image data of last completely transmitted image QImage image; ///< Image data of last completely transmitted image
quint64 imageStart; quint64 imageStart;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment