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
2c92489b
Commit
2c92489b
authored
Jan 03, 2011
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added VICON position message
parent
1858cf10
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
9 deletions
+57
-9
Core.cc
src/Core.cc
+4
-5
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+14
-1
MAVLinkProtocol.h
src/comm/MAVLinkProtocol.h
+8
-0
SerialLink.cc
src/comm/SerialLink.cc
+2
-0
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+15
-0
MAVLinkSettingsWidget.cc
src/ui/MAVLinkSettingsWidget.cc
+7
-3
MAVLinkSettingsWidget.ui
src/ui/MAVLinkSettingsWidget.ui
+7
-0
No files found.
src/Core.cc
View file @
2c92489b
...
...
@@ -91,8 +91,6 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// "Warning: Do not use this function in conjunction with Qt Style Sheets."
// setFont(fontDatabase.font(fontFamilyName, "Roman", 12));
mainWindow
=
MainWindow
::
instance
();
// Start the comm link manager
splashScreen
->
showMessage
(
tr
(
"Starting Communication Links"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
startLinkManager
();
...
...
@@ -108,9 +106,6 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
splashScreen
->
showMessage
(
tr
(
"Starting User Interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
// Start UI
// Remove splash screen
splashScreen
->
finish
(
mainWindow
);
// Connect links
// to make sure that all components are initialized when the
// first messages arrive
...
...
@@ -130,6 +125,10 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
simulationLink
->
disconnect
();
//mainWindow->addLink(simulationLink);
mainWindow
=
MainWindow
::
instance
();
// Remove splash screen
splashScreen
->
finish
(
mainWindow
);
// Check if link could be connected
if
(
!
udpLink
->
connect
())
{
...
...
src/comm/MAVLinkProtocol.cc
View file @
2c92489b
...
...
@@ -60,6 +60,7 @@ MAVLinkProtocol::MAVLinkProtocol() :
m_heartbeatsEnabled
(
false
),
m_loggingEnabled
(
false
),
m_logfile
(
NULL
),
m_enable_version_check
(
true
),
versionMismatchIgnore
(
false
)
{
start
(
QThread
::
LowPriority
);
...
...
@@ -77,6 +78,8 @@ MAVLinkProtocol::MAVLinkProtocol() :
lastIndex
[
i
][
j
]
=
-
1
;
}
}
emit
versionCheckChanged
(
m_enable_version_check
);
}
MAVLinkProtocol
::~
MAVLinkProtocol
()
...
...
@@ -161,7 +164,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
mavlink_msg_heartbeat_decode
(
&
message
,
&
heartbeat
);
// Check if the UAS has a different protocol version
if
(
heartbeat
.
mavlink_version
!=
MAVLINK_VERSION
)
if
(
m_enable_version_check
&&
(
heartbeat
.
mavlink_version
!=
MAVLINK_VERSION
)
)
{
// Bring up dialog to inform user
if
(
!
versionMismatchIgnore
)
...
...
@@ -400,6 +403,11 @@ void MAVLinkProtocol::enableLogging(bool enabled)
m_loggingEnabled
=
enabled
;
}
void
MAVLinkProtocol
::
enableVersionCheck
(
bool
enabled
)
{
m_enable_version_check
=
enabled
;
}
bool
MAVLinkProtocol
::
heartbeatsEnabled
(
void
)
{
return
m_heartbeatsEnabled
;
...
...
@@ -410,6 +418,11 @@ bool MAVLinkProtocol::loggingEnabled(void)
return
m_loggingEnabled
;
}
bool
MAVLinkProtocol
::
versionCheckEnabled
(
void
)
{
return
m_enable_version_check
;
}
/**
* The default rate is 1 Hertz.
*
...
...
src/comm/MAVLinkProtocol.h
View file @
2c92489b
...
...
@@ -68,6 +68,8 @@ public:
bool
heartbeatsEnabled
(
void
);
/** @brief Get logging state */
bool
loggingEnabled
(
void
);
/** @brief Get protocol version check state */
bool
versionCheckEnabled
(
void
);
/** @brief Get the name of the packet log file */
static
QString
getLogfileName
();
...
...
@@ -87,6 +89,9 @@ public slots:
/** @brief Enable/disable binary packet logging */
void
enableLogging
(
bool
enabled
);
/** @brief Enable / disable version check */
void
enableVersionCheck
(
bool
enabled
);
/** @brief Send an extra heartbeat to all connected units */
void
sendHeartbeat
();
...
...
@@ -96,6 +101,7 @@ protected:
bool
m_heartbeatsEnabled
;
///< Enabled/disable heartbeat emission
bool
m_loggingEnabled
;
///< Enable/disable packet logging
QFile
*
m_logfile
;
///< Logfile
bool
m_enable_version_check
;
///< Enable checking of version match of MAV and QGC
QMutex
receiveMutex
;
///< Mutex to protect receiveBytes function
int
lastIndex
[
256
][
256
];
int
totalReceiveCounter
;
...
...
@@ -111,6 +117,8 @@ signals:
void
heartbeatChanged
(
bool
heartbeats
);
/** @brief Emitted if logging is started / stopped */
void
loggingChanged
(
bool
enabled
);
/** @brief Emitted if version check is enabled / disabled */
void
versionCheckChanged
(
bool
enabled
);
/** @brief Emitted if a message from the protocol should reach the user */
void
protocolStatusMessage
(
const
QString
&
title
,
const
QString
&
message
);
};
...
...
src/comm/SerialLink.cc
View file @
2c92489b
...
...
@@ -85,6 +85,8 @@ SerialLink::SerialLink(QString portname, BaudRateType baudrate, FlowType flow, P
#endif
loadSettings
();
// Link is setup, register it with link manager
LinkManager
::
instance
()
->
add
(
this
);
}
...
...
src/uas/PxQuadMAV.cc
View file @
2c92489b
...
...
@@ -118,6 +118,21 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit
valueChanged
(
uasId
,
"vis. z"
,
pos
.
z
,
time
);
}
break
;
case
MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE
:
{
mavlink_vicon_position_estimate_t
pos
;
mavlink_msg_vicon_position_estimate_decode
(
&
message
,
&
pos
);
quint64
time
=
getUnixTime
(
pos
.
usec
);
//emit valueChanged(uasId, "vis. time", pos.usec, time);
emit
valueChanged
(
uasId
,
"vicon roll"
,
pos
.
roll
,
time
);
emit
valueChanged
(
uasId
,
"vicon pitch"
,
pos
.
pitch
,
time
);
emit
valueChanged
(
uasId
,
"vicon yaw"
,
pos
.
yaw
,
time
);
emit
valueChanged
(
uasId
,
"vicon x"
,
pos
.
x
,
time
);
emit
valueChanged
(
uasId
,
"vicon y"
,
pos
.
y
,
time
);
emit
valueChanged
(
uasId
,
"vicon z"
,
pos
.
z
,
time
);
emit
localPositionChanged
(
this
,
pos
.
x
,
pos
.
y
,
pos
.
z
,
time
);
}
break
;
case
MAVLINK_MSG_ID_AUX_STATUS
:
{
mavlink_aux_status_t
status
;
...
...
src/ui/MAVLinkSettingsWidget.cc
View file @
2c92489b
...
...
@@ -37,15 +37,19 @@ MAVLinkSettingsWidget::MAVLinkSettingsWidget(MAVLinkProtocol* protocol, QWidget
{
m_ui
->
setupUi
(
this
);
// Initialize state
m_ui
->
heartbeatCheckBox
->
setChecked
(
protocol
->
heartbeatsEnabled
());
m_ui
->
loggingCheckBox
->
setChecked
(
protocol
->
loggingEnabled
());
m_ui
->
versionCheckBox
->
setChecked
(
protocol
->
versionCheckEnabled
());
// Connect actions
connect
(
protocol
,
SIGNAL
(
heartbeatChanged
(
bool
)),
m_ui
->
heartbeatCheckBox
,
SLOT
(
setChecked
(
bool
)));
connect
(
m_ui
->
heartbeatCheckBox
,
SIGNAL
(
toggled
(
bool
)),
protocol
,
SLOT
(
enableHeartbeats
(
bool
)));
connect
(
protocol
,
SIGNAL
(
loggingChanged
(
bool
)),
m_ui
->
loggingCheckBox
,
SLOT
(
setChecked
(
bool
)));
connect
(
m_ui
->
loggingCheckBox
,
SIGNAL
(
toggled
(
bool
)),
protocol
,
SLOT
(
enableLogging
(
bool
)));
connect
(
protocol
,
SIGNAL
(
versionCheckChanged
(
bool
)),
m_ui
->
versionCheckBox
,
SLOT
(
setChecked
(
bool
)));
connect
(
m_ui
->
versionCheckBox
,
SIGNAL
(
toggled
(
bool
)),
protocol
,
SLOT
(
enableVersionCheck
(
bool
)));
// Initialize state
m_ui
->
heartbeatCheckBox
->
setChecked
(
protocol
->
heartbeatsEnabled
());
m_ui
->
loggingCheckBox
->
setChecked
(
protocol
->
loggingEnabled
());
}
MAVLinkSettingsWidget
::~
MAVLinkSettingsWidget
()
...
...
src/ui/MAVLinkSettingsWidget.ui
View file @
2c92489b
...
...
@@ -31,6 +31,13 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"versionCheckBox"
>
<property
name=
"text"
>
<string>
Only accept MAVs with same protocol version
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
...
...
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