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
89f0da26
Commit
89f0da26
authored
Dec 09, 2011
by
hengli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for Google Protocol Buffers.
parent
b0fd22a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
qgroundcontrol.pri
qgroundcontrol.pri
+22
-0
qgroundcontrol.pro
qgroundcontrol.pro
+13
-1
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+12
-0
No files found.
qgroundcontrol.pri
View file @
89f0da26
...
...
@@ -179,6 +179,17 @@ message("Compiling for linux 32")
DEFINES += QGC_OSG_ENABLED
}
exists(/usr/local/include/google/protobuf) {
message("Building support for Protocol Buffers")
DEPENDENCIES_PRESENT += protobuf
# Include Protocol Buffers libraries
LIBS += -lprotobuf \
-lprotobuf-lite \
-lprotoc
DEFINES += QGC_PROTOBUF_ENABLED
}
exists(/usr/local/include/libfreenect/libfreenect.h) {
message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
...
...
@@ -249,6 +260,17 @@ linux-g++-64 {
DEFINES += QGC_OSG_ENABLED
}
exists(/usr/local/include/google/protobuf) {
message("Building support for Protocol Buffers")
DEPENDENCIES_PRESENT += protobuf
# Include Protocol Buffers libraries
LIBS += -lprotobuf \
-lprotobuf-lite \
-lprotoc
DEFINES += QGC_PROTOBUF_ENABLED
}
exists(/usr/local/include/libfreenect) {
message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect
...
...
qgroundcontrol.pro
View file @
89f0da26
...
...
@@ -95,7 +95,7 @@ contains(MAVLINK_CONF, pixhawk) {
#
Remove
the
default
set
-
it
is
included
anyway
INCLUDEPATH
-=
$$
BASEDIR
/../
mavlink
/
include
/
common
INCLUDEPATH
-=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
common
#
PIXHAWK
SPECIAL
MESSAGES
INCLUDEPATH
+=
$$
BASEDIR
/../
mavlink
/
include
/
pixhawk
INCLUDEPATH
+=
$$
BASEDIR
/
thirdParty
/
mavlink
/
include
/
pixhawk
...
...
@@ -372,6 +372,12 @@ contains(DEPENDENCIES_PRESENT, osg) {
src
/
ui
/
map3D
/
HUDScaleGeode
.
h
\
src
/
ui
/
map3D
/
WaypointGroupNode
.
h
}
contains
(
DEPENDENCIES_PRESENT
,
protobuf
)
:
contains
(
MAVLINK_CONF
,
pixhawk
)
{
message
(
"Including headers for Protocol Buffers"
)
#
Enable
only
if
protobuf
is
available
HEADERS
+=
..
/
mavlink
/
include
/
pixhawk
/
pixhawk
.
pb
.
h
}
contains
(
DEPENDENCIES_PRESENT
,
libfreenect
)
{
message
(
"Including headers for libfreenect"
)
...
...
@@ -501,6 +507,12 @@ contains(DEPENDENCIES_PRESENT, osg) {
SOURCES
+=
src
/
ui
/
map3D
/
QMap3D
.
cc
}
}
contains
(
DEPENDENCIES_PRESENT
,
protobuf
)
:
contains
(
MAVLINK_CONF
,
pixhawk
)
{
message
(
"Including sources for Protocol Buffers"
)
#
Enable
only
if
protobuf
is
available
SOURCES
+=
..
/
mavlink
/
src
/
pixhawk
/
pixhawk
.
pb
.
cc
}
contains
(
DEPENDENCIES_PRESENT
,
libfreenect
)
{
message
(
"Including sources for libfreenect"
)
...
...
src/comm/MAVLinkProtocol.cc
View file @
89f0da26
...
...
@@ -31,6 +31,10 @@
#include "QGCMAVLinkUASFactory.h"
#include "QGC.h"
#ifdef QGC_PROTOBUF_ENABLED
#include "mavlink_protobuf_manager.hpp"
#endif
/**
* The default constructor will create a new MAVLink object sending heartbeats at
* the MAVLINK_HEARTBEAT_DEFAULT_RATE to all connected links.
...
...
@@ -169,6 +173,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
// receiveMutex.lock();
mavlink_message_t
message
;
mavlink_status_t
status
;
for
(
int
position
=
0
;
position
<
b
.
size
();
position
++
)
{
unsigned
int
decodeState
=
mavlink_parse_char
(
link
->
getId
(),
(
uint8_t
)(
b
.
at
(
position
)),
&
message
,
&
status
);
...
...
@@ -181,6 +186,13 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
// continue;
// }
//#endif
#ifdef QGC_PROTOBUF_ENABLED
if
(
message
.
msgid
==
MAVLINK_MSG_ID_EXTENDED_MESSAGE
)
{
mavlink
::
ProtobufManager
::
instance
();
}
#endif
// Log data
if
(
m_loggingEnabled
&&
m_logfile
)
{
const
int
len
=
MAVLINK_MAX_PACKET_LEN
+
sizeof
(
quint64
);
...
...
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