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
66753e21
Unverified
Commit
66753e21
authored
Oct 07, 2020
by
Don Gagne
Committed by
GitHub
Oct 07, 2020
Browse files
VehicleLinkManager: Major refactor on how QGC manages comm links (#9101)
New VehicleLinkManager implementation
parent
affc9f96
Changes
93
Hide whitespace changes
Inline
Side-by-side
QGCCommon.pri
View file @
66753e21
...
...
@@ -31,6 +31,7 @@ linux {
message("Linux clang")
QMAKE_CXXFLAGS += -Qunused-arguments -fcolor-diagnostics
} else {
#QMAKE_CXXFLAGS += -H # Handy for debugging why something is getting built when an include file is touched
QMAKE_CXXFLAGS_WARN_ON += -Werror \
-Wno-deprecated-copy \ # These come from mavlink headers
-Wno-unused-parameter \ # gst_plugins-good has these errors
...
...
UnitTest.qrc
View file @
66753e21
...
...
@@ -14,5 +14,6 @@
<file alias="PolygonMissingNode.kml">src/MissionManager/UnitTest/PolygonMissingNode.kml</file>
<file alias="PolygonBadXml.kml">src/MissionManager/UnitTest/PolygonBadXml.kml</file>
<file alias="PolygonBadCoordinatesNode.kml">src/MissionManager/UnitTest/PolygonBadCoordinatesNode.kml</file>
<file alias="MockLinkOptionsDlg.qml">src/comm/MockLinkOptionsDlg.qml</file>
</qresource>
</RCC>
qgroundcontrol.pro
View file @
66753e21
...
...
@@ -431,7 +431,6 @@ HEADERS += \
src
/
api
/
QGCOptions
.
h
\
src
/
api
/
QGCSettings
.
h
\
src
/
api
/
QmlComponentInfo
.
h
\
src
/
comm
/
MavlinkMessagesTimer
.
h
\
src
/
GPS
/
Drivers
/
src
/
base_station
.
h
\
contains
(
DEFINES
,
QGC_ENABLE_PAIRING
)
{
...
...
@@ -445,7 +444,6 @@ SOURCES += \
src
/
api
/
QGCOptions
.
cc
\
src
/
api
/
QGCSettings
.
cc
\
src
/
api
/
QmlComponentInfo
.
cc
\
src
/
comm
/
MavlinkMessagesTimer
.
cc
\
contains
(
DEFINES
,
QGC_ENABLE_PAIRING
)
{
SOURCES
+=
\
...
...
@@ -492,17 +490,16 @@ DebugBuild { PX4FirmwarePlugin { PX4FirmwarePluginFactory { APMFirmwarePlugin {
src
/
MissionManager
/
TransectStyleComplexItemTestBase
.
h
\
src
/
MissionManager
/
VisualMissionItemTest
.
h
\
src
/
qgcunittest
/
GeoTest
.
h
\
src
/
qgcunittest
/
LinkManagerTest
.
h
\
src
/
qgcunittest
/
MavlinkLogTest
.
h
\
src
/
qgcunittest
/
MultiSignalSpy
.
h
\
src
/
qgcunittest
/
TCPLinkTest
.
h
\
src
/
qgcunittest
/
TCPLoopBackServer
.
h
\
src
/
qgcunittest
/
MultiSignalSpyV2
.
h
\
src
/
qgcunittest
/
UnitTest
.
h
\
src
/
Vehicle
/
FTPManagerTest
.
h
\
src
/
Vehicle
/
InitialConnectTest
.
h
\
src
/
Vehicle
/
RequestMessageTest
.
h
\
src
/
Vehicle
/
SendMavCommandWithHandlerTest
.
h
\
src
/
Vehicle
/
SendMavCommandWithSignallingTest
.
h
\
src
/
Vehicle
/
VehicleLinkManagerTest
.
h
\
#
src
/
qgcunittest
/
RadioConfigTest
.
h
\
#
src
/
AnalyzeView
/
LogDownloadTest
.
h
\
#
src
/
qgcunittest
/
FileDialogTest
.
h
\
...
...
@@ -540,11 +537,9 @@ DebugBuild { PX4FirmwarePlugin { PX4FirmwarePluginFactory { APMFirmwarePlugin {
src
/
MissionManager
/
TransectStyleComplexItemTestBase
.
cc
\
src
/
MissionManager
/
VisualMissionItemTest
.
cc
\
src
/
qgcunittest
/
GeoTest
.
cc
\
src
/
qgcunittest
/
LinkManagerTest
.
cc
\
src
/
qgcunittest
/
MavlinkLogTest
.
cc
\
src
/
qgcunittest
/
MultiSignalSpy
.
cc
\
src
/
qgcunittest
/
TCPLinkTest
.
cc
\
src
/
qgcunittest
/
TCPLoopBackServer
.
cc
\
src
/
qgcunittest
/
MultiSignalSpyV2
.
cc
\
src
/
qgcunittest
/
UnitTest
.
cc
\
src
/
qgcunittest
/
UnitTestList
.
cc
\
src
/
Vehicle
/
FTPManagerTest
.
cc
\
...
...
@@ -552,6 +547,7 @@ DebugBuild { PX4FirmwarePlugin { PX4FirmwarePluginFactory { APMFirmwarePlugin {
src
/
Vehicle
/
RequestMessageTest
.
cc
\
src
/
Vehicle
/
SendMavCommandWithHandlerTest
.
cc
\
src
/
Vehicle
/
SendMavCommandWithSignallingTest
.
cc
\
src
/
Vehicle
/
VehicleLinkManagerTest
.
cc
\
#
src
/
qgcunittest
/
RadioConfigTest
.
cc
\
#
src
/
AnalyzeView
/
LogDownloadTest
.
cc
\
#
src
/
qgcunittest
/
FileDialogTest
.
cc
\
...
...
@@ -705,6 +701,7 @@ HEADERS += \
src
/
Vehicle
/
VehicleDistanceSensorFactGroup
.
h
\
src
/
Vehicle
/
VehicleEstimatorStatusFactGroup
.
h
\
src
/
Vehicle
/
VehicleGPSFactGroup
.
h
\
src
/
Vehicle
/
VehicleLinkManager
.
h
\
src
/
Vehicle
/
VehicleSetpointFactGroup
.
h
\
src
/
Vehicle
/
VehicleTemperatureFactGroup
.
h
\
src
/
Vehicle
/
VehicleVibrationFactGroup
.
h
\
...
...
@@ -933,6 +930,7 @@ SOURCES += \
src
/
Vehicle
/
VehicleDistanceSensorFactGroup
.
cc
\
src
/
Vehicle
/
VehicleEstimatorStatusFactGroup
.
cc
\
src
/
Vehicle
/
VehicleGPSFactGroup
.
cc
\
src
/
Vehicle
/
VehicleLinkManager
.
cc
\
src
/
Vehicle
/
VehicleSetpointFactGroup
.
cc
\
src
/
Vehicle
/
VehicleTemperatureFactGroup
.
cc
\
src
/
Vehicle
/
VehicleVibrationFactGroup
.
cc
\
...
...
src/AnalyzeView/LogDownloadController.cc
View file @
66753e21
...
...
@@ -474,11 +474,11 @@ LogDownloadController::_requestLogData(uint16_t id, uint32_t offset, uint32_t co
mavlink_msg_log_request_data_pack_chan
(
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
getSystemId
(),
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
getComponentId
(),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
()
->
id
(),
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
()
->
defaultComponentId
(),
id
,
offset
,
count
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
}
}
...
...
@@ -502,13 +502,13 @@ LogDownloadController::_requestLogList(uint32_t start, uint32_t end)
mavlink_msg_log_request_list_pack_chan
(
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
getSystemId
(),
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
getComponentId
(),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
_vehicle
->
id
(),
_vehicle
->
defaultComponentId
(),
start
,
end
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
//-- Wait 5 seconds before bitching about not getting anything
_timer
.
start
(
5000
);
}
...
...
@@ -646,7 +646,7 @@ LogDownloadController::_setDownloading(bool active)
{
if
(
_downloadingLogs
!=
active
)
{
_downloadingLogs
=
active
;
_vehicle
->
setConnec
tionLostEnabled
(
!
active
);
_vehicle
->
vehicleLinkManager
()
->
setCommunica
tionLostEnabled
(
!
active
);
emit
downloadingLogsChanged
();
}
}
...
...
@@ -657,7 +657,7 @@ LogDownloadController::_setListing(bool active)
{
if
(
_requestingLogEntries
!=
active
)
{
_requestingLogEntries
=
active
;
_vehicle
->
setConnec
tionLostEnabled
(
!
active
);
_vehicle
->
vehicleLinkManager
()
->
setCommunica
tionLostEnabled
(
!
active
);
emit
requestingListChanged
();
}
}
...
...
@@ -671,10 +671,10 @@ LogDownloadController::eraseAll(void)
mavlink_msg_log_erase_pack_chan
(
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
getSystemId
(),
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
getComponentId
(),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
()
->
id
(),
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
()
->
defaultComponentId
());
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
refresh
();
}
}
...
...
src/AnalyzeView/MavlinkConsoleController.cc
View file @
66753e21
...
...
@@ -116,12 +116,12 @@ MavlinkConsoleController::_sendSerialData(QByteArray data, bool close)
uint8_t
flags
=
SERIAL_CONTROL_FLAG_EXCLUSIVE
|
SERIAL_CONTROL_FLAG_RESPOND
|
SERIAL_CONTROL_FLAG_MULTI
;
if
(
close
)
flags
=
0
;
auto
protocol
=
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
();
auto
priority_
link
=
_vehicle
->
priorit
yLink
();
auto
link
=
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
();
mavlink_message_t
msg
;
mavlink_msg_serial_control_pack_chan
(
protocol
->
getSystemId
(),
protocol
->
getComponentId
(),
priority_
link
->
mavlinkChannel
(),
link
->
mavlinkChannel
(),
&
msg
,
SERIAL_CONTROL_DEV_SHELL
,
flags
,
...
...
@@ -129,7 +129,7 @@ MavlinkConsoleController::_sendSerialData(QByteArray data, bool close)
0
,
chunk
.
size
(),
reinterpret_cast
<
uint8_t
*>
(
chunk
.
data
()));
_vehicle
->
sendMessageOnLinkThreadSafe
(
priority_
link
,
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
link
,
msg
);
data
.
remove
(
0
,
chunk
.
size
());
}
}
...
...
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
View file @
66753e21
...
...
@@ -198,6 +198,8 @@ QString APMAutoPilotPlugin::prerequisiteSetup(VehicleComponent* component) const
void
APMAutoPilotPlugin
::
_checkForBadCubeBlack
(
void
)
{
bool
cubeBlackFound
=
false
;
#if 0
// FIXME: Put back
for (const QVariant& varLink: _vehicle->links()) {
SerialLink* serialLink = varLink.value<SerialLink*>();
if (serialLink && QSerialPortInfo(*serialLink->_hackAccessToPort()).description().contains(QStringLiteral("CubeBlack"))) {
...
...
@@ -205,6 +207,7 @@ void APMAutoPilotPlugin::_checkForBadCubeBlack(void)
}
}
#endif
if
(
!
cubeBlackFound
)
{
return
;
}
...
...
src/AutoPilotPlugins/APM/APMSensorsComponentController.cc
View file @
66753e21
...
...
@@ -150,7 +150,7 @@ void APMSensorsComponentController::_resetInternalState(void)
void
APMSensorsComponentController
::
_stopCalibration
(
APMSensorsComponentController
::
StopCalibrationCode
code
)
{
_vehicle
->
setConnec
tionLostEnabled
(
true
);
_vehicle
->
vehicleLinkManager
()
->
setCommunica
tionLostEnabled
(
true
);
disconnect
(
_vehicle
,
&
Vehicle
::
textMessageReceived
,
this
,
&
APMSensorsComponentController
::
_handleUASTextMessage
);
...
...
@@ -292,7 +292,7 @@ void APMSensorsComponentController::calibrateCompass(void)
void
APMSensorsComponentController
::
calibrateAccel
(
void
)
{
_calTypeInProgress
=
CalTypeAccel
;
_vehicle
->
setConnec
tionLostEnabled
(
false
);
_vehicle
->
vehicleLinkManager
()
->
setCommunica
tionLostEnabled
(
false
);
_startLogCalibration
();
_vehicle
->
startCalibration
(
Vehicle
::
CalibrationAccel
);
}
...
...
@@ -300,7 +300,7 @@ void APMSensorsComponentController::calibrateAccel(void)
void
APMSensorsComponentController
::
calibrateMotorInterference
(
void
)
{
_calTypeInProgress
=
CalTypeCompassMot
;
_vehicle
->
setConnec
tionLostEnabled
(
false
);
_vehicle
->
vehicleLinkManager
()
->
setCommunica
tionLostEnabled
(
false
);
_startLogCalibration
();
_appendStatusLog
(
tr
(
"Raise the throttle slowly to between 50% ~ 75% (the props will spin!) for 5 ~ 10 seconds."
));
_appendStatusLog
(
tr
(
"Quickly bring the throttle back down to zero"
));
...
...
@@ -311,7 +311,7 @@ void APMSensorsComponentController::calibrateMotorInterference(void)
void
APMSensorsComponentController
::
levelHorizon
(
void
)
{
_calTypeInProgress
=
CalTypeLevelHorizon
;
_vehicle
->
setConnec
tionLostEnabled
(
false
);
_vehicle
->
vehicleLinkManager
()
->
setCommunica
tionLostEnabled
(
false
);
_startLogCalibration
();
_appendStatusLog
(
tr
(
"Hold the vehicle in its level flight position."
));
_vehicle
->
startCalibration
(
Vehicle
::
CalibrationLevel
);
...
...
@@ -320,7 +320,7 @@ void APMSensorsComponentController::levelHorizon(void)
void
APMSensorsComponentController
::
calibratePressure
(
void
)
{
_calTypeInProgress
=
CalTypePressure
;
_vehicle
->
setConnec
tionLostEnabled
(
false
);
_vehicle
->
vehicleLinkManager
()
->
setCommunica
tionLostEnabled
(
false
);
_startLogCalibration
();
_appendStatusLog
(
tr
(
"Requesting pressure calibration..."
));
_vehicle
->
startCalibration
(
Vehicle
::
CalibrationAPMPressureAirspeed
);
...
...
@@ -329,7 +329,7 @@ void APMSensorsComponentController::calibratePressure(void)
void
APMSensorsComponentController
::
calibrateGyro
(
void
)
{
_calTypeInProgress
=
CalTypeGyro
;
_vehicle
->
setConnec
tionLostEnabled
(
false
);
_vehicle
->
vehicleLinkManager
()
->
setCommunica
tionLostEnabled
(
false
);
_startLogCalibration
();
_appendStatusLog
(
tr
(
"Requesting gyro calibration..."
));
_vehicle
->
startCalibration
(
Vehicle
::
CalibrationGyro
);
...
...
@@ -507,7 +507,7 @@ void APMSensorsComponentController::nextClicked(void)
mavlink_message_t
msg
;
mavlink_msg_command_ack_pack_chan
(
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
getSystemId
(),
qgcApp
()
->
toolbox
()
->
mavlinkProtocol
()
->
getComponentId
(),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
0
,
// command
1
,
// result
...
...
@@ -516,7 +516,7 @@ void APMSensorsComponentController::nextClicked(void)
0
,
// target_system
0
);
// target_component
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
if
(
_calTypeInProgress
==
CalTypeCompassMot
)
{
_stopCalibration
(
StopCalibrationSuccess
);
...
...
@@ -535,7 +535,7 @@ bool APMSensorsComponentController::accelSetupNeeded(void) const
bool
APMSensorsComponentController
::
usingUDPLink
(
void
)
{
return
_vehicle
->
priorit
yLink
()
->
getL
inkConfiguration
()
->
type
()
==
LinkConfiguration
::
TypeUdp
;
return
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
l
inkConfiguration
()
->
type
()
==
LinkConfiguration
::
TypeUdp
;
}
void
APMSensorsComponentController
::
_handleCommandAck
(
mavlink_message_t
&
message
)
...
...
src/AutoPilotPlugins/PX4/AirframeComponentController.cc
View file @
66753e21
...
...
@@ -7,15 +7,12 @@
*
****************************************************************************/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#include
"AirframeComponentController.h"
#include
"AirframeComponentAirframes.h"
#include
"QGCMAVLink.h"
#include
"MultiVehicleManager.h"
#include
"QGCApplication.h"
#include
"LinkManager.h"
#include
<QVariant>
#include
<QQmlProperty>
...
...
src/AutoPilotPlugins/PX4/SensorsComponentController.cc
View file @
66753e21
...
...
@@ -65,7 +65,7 @@ SensorsComponentController::SensorsComponentController(void)
bool
SensorsComponentController
::
usingUDPLink
(
void
)
{
return
_vehicle
->
priorit
yLink
()
->
getL
inkConfiguration
()
->
type
()
==
LinkConfiguration
::
TypeUdp
;
return
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
l
inkConfiguration
()
->
type
()
==
LinkConfiguration
::
TypeUdp
;
}
/// Appends the specified text to the status log area in the ui
...
...
src/Camera/QGCCameraControl.cc
View file @
66753e21
...
...
@@ -1176,12 +1176,12 @@ QGCCameraControl::_requestAllParameters()
mavlink_msg_param_ext_request_list_pack_chan
(
static_cast
<
uint8_t
>
(
mavlink
->
getSystemId
()),
static_cast
<
uint8_t
>
(
mavlink
->
getComponentId
()),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
static_cast
<
uint8_t
>
(
_vehicle
->
id
()),
static_cast
<
uint8_t
>
(
compID
()),
0
);
// trimmed messages = false
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
qCDebug
(
CameraControlVerboseLog
)
<<
"Request all parameters"
;
}
...
...
src/Camera/QGCCameraIO.cc
View file @
66753e21
...
...
@@ -188,10 +188,10 @@ QGCCameraParamIO::_sendParameter()
mavlink_msg_param_ext_set_encode_chan
(
static_cast
<
uint8_t
>
(
_pMavlink
->
getSystemId
()),
static_cast
<
uint8_t
>
(
_pMavlink
->
getComponentId
()),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
&
p
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
_paramWriteTimer
.
start
();
}
...
...
@@ -358,13 +358,13 @@ QGCCameraParamIO::paramRequest(bool reset)
mavlink_msg_param_ext_request_read_pack_chan
(
static_cast
<
uint8_t
>
(
_pMavlink
->
getSystemId
()),
static_cast
<
uint8_t
>
(
_pMavlink
->
getComponentId
()),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
static_cast
<
uint8_t
>
(
_vehicle
->
id
()),
static_cast
<
uint8_t
>
(
_control
->
compID
()),
param_id
,
-
1
,
0
);
// trimmed messages = false
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
_paramRequestTimer
.
start
();
}
src/FactSystem/ParameterManager.cc
View file @
66753e21
...
...
@@ -81,7 +81,7 @@ ParameterManager::ParameterManager(Vehicle* vehicle)
,
_waitingForDefaultComponent
(
false
)
,
_saveRequired
(
false
)
,
_metaDataAddedToFacts
(
false
)
,
_logReplay
(
vehicle
->
priorityLink
()
&&
vehicle
->
priorit
yLink
()
->
isLogReplay
())
,
_logReplay
(
vehicle
->
vehicleLinkManager
()
->
primaryLink
()
&&
vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
isLogReplay
())
,
_parameterSetMajorVersion
(
-
1
)
,
_prevWaitingReadParamIndexCount
(
0
)
,
_prevWaitingReadParamNameCount
(
0
)
...
...
@@ -477,7 +477,11 @@ void ParameterManager::_valueUpdated(const QVariant& value)
void
ParameterManager
::
refreshAllParameters
(
uint8_t
componentId
)
{
if
(
_vehicle
->
highLatencyLink
()
||
_logReplay
)
{
if
(
!
_vehicle
->
vehicleLinkManager
()
->
primaryLink
())
{
return
;
}
if
(
_vehicle
->
vehicleLinkManager
()
->
primaryLink
()
->
linkConfiguration
()
->
isHighLatency
()
||
_logReplay
)
{
// These links don't load params
_parametersReady
=
true
;
_missingParameters
=
true
;
...
...
@@ -511,11 +515,11 @@ void ParameterManager::refreshAllParameters(uint8_t componentId)
mavlink_message_t
msg
;
mavlink_msg_param_request_list_pack_chan
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
_vehicle
->
id
(),
componentId
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
QString
what
=
(
componentId
==
MAV_COMP_ID_ALL
)
?
"MAV_COMP_ID_ALL"
:
QString
::
number
(
componentId
);
qCDebug
(
ParameterManagerLog
)
<<
_logVehiclePrefix
(
-
1
)
<<
"Request to refresh all parameters for component ID:"
<<
what
;
...
...
@@ -814,13 +818,13 @@ void ParameterManager::_readParameterRaw(int componentId, const QString& paramNa
strncpy
(
fixedParamName
,
paramName
.
toStdString
().
c_str
(),
sizeof
(
fixedParamName
));
mavlink_msg_param_request_read_pack_chan
(
_mavlink
->
getSystemId
(),
// QGC system id
_mavlink
->
getComponentId
(),
// QGC component id
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
// Pack into this mavlink_message_t
_vehicle
->
id
(),
// Target system id
componentId
,
// Target component id
fixedParamName
,
// Named parameter being requested
paramIndex
);
// Parameter index being requested, -1 for named
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
}
void
ParameterManager
::
_writeParameterRaw
(
int
componentId
,
const
QString
&
paramName
,
const
QVariant
&
value
)
...
...
@@ -876,10 +880,10 @@ void ParameterManager::_writeParameterRaw(int componentId, const QString& paramN
mavlink_message_t
msg
;
mavlink_msg_param_set_encode_chan
(
_mavlink
->
getSystemId
(),
_mavlink
->
getComponentId
(),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
&
p
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
}
void
ParameterManager
::
_writeLocalParamCache
(
int
vehicleId
,
int
componentId
)
...
...
@@ -975,10 +979,10 @@ void ParameterManager::_tryCacheHashLoad(int vehicleId, int componentId, QVarian
mavlink_message_t
msg
;
mavlink_msg_param_set_encode_chan
(
_mavlink
->
getSystemId
(),
_mavlink
->
getComponentId
(),
_vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
&
p
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
priorit
yLink
(),
msg
);
_vehicle
->
sendMessageOnLinkThreadSafe
(
_vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
// Give the user some feedback things loaded properly
QVariantAnimation
*
ani
=
new
QVariantAnimation
(
this
);
...
...
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
View file @
66753e21
...
...
@@ -970,11 +970,11 @@ void APMFirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitu
mavlink_msg_set_position_target_local_ned_encode_chan
(
static_cast
<
uint8_t
>
(
mavlink
->
getSystemId
()),
static_cast
<
uint8_t
>
(
mavlink
->
getComponentId
()),
vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
msg
,
&
cmd
);
vehicle
->
sendMessageOnLinkThreadSafe
(
vehicle
->
priorit
yLink
(),
msg
);
vehicle
->
sendMessageOnLinkThreadSafe
(
vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
msg
);
}
void
APMFirmwarePlugin
::
guidedModeTakeoff
(
Vehicle
*
vehicle
,
double
altitudeRel
)
...
...
@@ -1103,7 +1103,7 @@ void APMFirmwarePlugin::_handleRCChannels(Vehicle* vehicle, mavlink_message_t* m
mavlink_msg_rc_channels_encode_chan
(
static_cast
<
uint8_t
>
(
mavlink
->
getSystemId
()),
static_cast
<
uint8_t
>
(
mavlink
->
getComponentId
()),
vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
message
,
&
channels
);
}
...
...
@@ -1120,7 +1120,7 @@ void APMFirmwarePlugin::_handleRCChannelsRaw(Vehicle* vehicle, mavlink_message_t
mavlink_msg_rc_channels_raw_encode_chan
(
static_cast
<
uint8_t
>
(
mavlink
->
getSystemId
()),
static_cast
<
uint8_t
>
(
mavlink
->
getComponentId
()),
vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
message
,
&
channels
);
}
...
...
@@ -1165,8 +1165,8 @@ void APMFirmwarePlugin::_sendGCSMotionReport(Vehicle* vehicle, FollowMe::GCSMoti
mavlink_message_t
message
;
mavlink_msg_global_position_int_encode_chan
(
static_cast
<
uint8_t
>
(
mavlinkProtocol
->
getSystemId
()),
static_cast
<
uint8_t
>
(
mavlinkProtocol
->
getComponentId
()),
vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
message
,
&
globalPositionInt
);
vehicle
->
sendMessageOnLinkThreadSafe
(
vehicle
->
priorit
yLink
(),
message
);
vehicle
->
sendMessageOnLinkThreadSafe
(
vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
message
);
}
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
66753e21
...
...
@@ -1051,8 +1051,8 @@ void FirmwarePlugin::sendGCSMotionReport(Vehicle* vehicle, FollowMe::GCSMotionRe
mavlink_message_t
message
;
mavlink_msg_follow_target_encode_chan
(
static_cast
<
uint8_t
>
(
mavlinkProtocol
->
getSystemId
()),
static_cast
<
uint8_t
>
(
mavlinkProtocol
->
getComponentId
()),
vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
message
,
&
follow_target
);
vehicle
->
sendMessageOnLinkThreadSafe
(
vehicle
->
priorit
yLink
(),
message
);
vehicle
->
sendMessageOnLinkThreadSafe
(
vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
message
);
}
src/FlightDisplay/FlightDisplayViewVideo.qml
View file @
66753e21
...
...
@@ -29,7 +29,7 @@ Item {
property
double
_ar
:
QGroundControl
.
videoManager
.
aspectRatio
property
bool
_showGrid
:
QGroundControl
.
settingsManager
.
videoSettings
.
gridLines
.
rawValue
>
0
property
var
_dynamicCameras
:
globals
.
activeVehicle
?
globals
.
activeVehicle
.
cameraManager
:
null
property
bool
_connected
:
globals
.
activeVehicle
?
!
globals
.
activeVehicle
.
co
nnec
tionLost
:
false
property
bool
_connected
:
globals
.
activeVehicle
?
!
globals
.
activeVehicle
.
co
mmunica
tionLost
:
false
property
int
_curCameraIndex
:
_dynamicCameras
?
_dynamicCameras
.
currentCamera
:
0
property
bool
_isCamera
:
_dynamicCameras
?
_dynamicCameras
.
cameras
.
count
>
0
:
false
property
var
_camera
:
_isCamera
?
_dynamicCameras
.
cameras
.
get
(
_curCameraIndex
)
:
null
...
...
src/FlightDisplay/FlyViewMissionCompleteDialog.qml
View file @
66753e21
...
...
@@ -85,7 +85,7 @@ Item {
QGCButton
{
Layout.fillWidth
:
true
text
:
qsTr
(
"
Remove plan from vehicle
"
)
visible
:
!
_activeVehicle
.
co
nnec
tionLost
// && !_activeVehicle.apmFirmware // ArduPilot has a bug somewhere with mission clear
visible
:
!
_activeVehicle
.
co
mmunica
tionLost
// && !_activeVehicle.apmFirmware // ArduPilot has a bug somewhere with mission clear
onClicked
:
{
_planController
.
removeAllFromVehicle
()
hideDialog
()
...
...
@@ -108,7 +108,7 @@ Item {
ColumnLayout
{
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelHeight
visible
:
!
_activeVehicle
.
co
nnec
tionLost
&&
globals
.
guidedControllerFlyView
.
showResumeMission
visible
:
!
_activeVehicle
.
co
mmunica
tionLost
&&
globals
.
guidedControllerFlyView
.
showResumeMission
QGCButton
{
Layout.fillWidth
:
true
...
...
src/FlightDisplay/FlyViewWidgetLayer.qml
View file @
66753e21
...
...
@@ -156,12 +156,12 @@ Item {
z
:
QGroundControl
.
zOrderTopMost
+
1
width
:
parent
.
width
-
(
_pipOverlay
.
width
/
2
)
height
:
Math
.
min
(
parent
.
height
*
0.25
,
ScreenTools
.
defaultFontPixelWidth
*
16
)
visible
:
_virtualJoystickEnabled
&&
!
QGroundControl
.
videoManager
.
fullScreen
&&
!
(
_activeVehicle
?
_activeVehicle
.
h
ighLatencyLink
:
false
)
visible
:
_virtualJoystickEnabled
&&
!
QGroundControl
.
videoManager
.
fullScreen
&&
!
(
_activeVehicle
?
_activeVehicle
.
usingH
ighLatencyLink
:
false
)
anchors.bottom
:
parent
.
bottom
anchors.bottomMargin
:
parentToolInsets
.
leftEdgeBottomInset
+
ScreenTools
.
defaultFontPixelHeight
*
2
anchors.horizontalCenter
:
parent
.
horizontalCenter
source
:
"
qrc:/qml/VirtualJoystick.qml
"
active
:
_virtualJoystickEnabled
&&
!
(
_activeVehicle
?
_activeVehicle
.
h
ighLatencyLink
:
false
)
active
:
_virtualJoystickEnabled
&&
!
(
_activeVehicle
?
_activeVehicle
.
usingH
ighLatencyLink
:
false
)
property
bool
autoCenterThrottle
:
QGroundControl
.
settingsManager
.
appSettings
.
virtualJoystickAutoCenterThrottle
.
rawValue
...
...
src/FlightMap/MapItems/PlanMapItems.qml
View file @
66753e21
...
...
@@ -32,13 +32,12 @@ Item {
property
var
_rallyPointController
:
masterController
.
rallyPointController
property
var
_guidedController
:
globals
.
guidedControllerFlyView
property
var
_missionLineViewComponent
property
bool
_isActiveVehicle
:
vehicle
.
active
property
string
fmode
:
vehicle
.
flightMode
// Add the mission item visuals to the map
Repeater
{
model
:
_isActiveVehicle
&&
largeMapView
?
_missionController
.
visualItems
:
0
model
:
largeMapView
?
_missionController
.
visualItems
:
0
delegate
:
MissionItemMapVisual
{
map
:
_map
...
...
src/GPS/RTCM/RTCMMavlink.cc
View file @
66753e21
...
...
@@ -69,9 +69,9 @@ void RTCMMavlink::sendMessageToVehicle(const mavlink_gps_rtcm_data_t& msg)
mavlink_message_t
message
;
mavlink_msg_gps_rtcm_data_encode_chan
(
mavlinkProtocol
->
getSystemId
(),
mavlinkProtocol
->
getComponentId
(),
vehicle
->
priorit
yLink
()
->
mavlinkChannel
(),
vehicle
->
vehicleLinkManager
()
->
primar
yLink
()
->
mavlinkChannel
(),
&
message
,
&
msg
);
vehicle
->
sendMessageOnLinkThreadSafe
(
vehicle
->
priorit
yLink
(),
message
);
vehicle
->
sendMessageOnLinkThreadSafe
(
vehicle
->
vehicleLinkManager
()
->
primar
yLink
(),
message
);
}
}
src/MissionManager/GeoFenceManager.cc
View file @
66753e21
...
...
@@ -18,18 +18,16 @@
QGC_LOGGING_CATEGORY
(
GeoFenceManagerLog
,
"GeoFenceManagerLog"
)
GeoFenceManager
::
GeoFenceManager
(
Vehicle
*
vehicle
)
:
_vehicle
(
vehicle
)
,
_planManager
(
vehicle
,
MAV_MISSION_TYPE_FENCE
)
,
_firstParamLoadComplete
(
false
)
:
PlanManager
(
vehicle
,
MAV_MISSION_TYPE_FENCE
)
#if defined(QGC_AIRMAP_ENABLED)
,
_airspaceManager
(
qgcApp
()
->
toolbox
()
->
airspaceManager
())
,
_airspaceManager
(
qgcApp
()
->
toolbox
()
->
airspaceManager
())
#endif
{
connect
(
&
_planManager
,
&
PlanManager
::
inProgressChanged
,
this
,
&
GeoFenceManager
::
inProgressChanged
);
connect
(
&
_planManager
,
&
PlanManager
::
error
,
this
,
&
GeoFenceManager
::
error
);
connect
(
&
_planManager
,
&
PlanManager
::
removeAllComplete
,
this
,
&
GeoFenceManager
::
removeAllComplete
);
connect
(
&
_planManager
,
&
PlanManager
::
sendComplete
,
this
,
&
GeoFenceManager
::
_sendComplete
);
connect
(
&
_planManager
,
&
PlanManager
::
newMissionItemsAvailable
,
this
,
&
GeoFenceManager
::
_planManagerLoadComplete
);
connect
(
this
,
&
PlanManager
::
inProgressChanged
,
this
,
&
GeoFenceManager
::
inProgressChanged
);
connect
(
this
,
&
PlanManager
::
error
,
this
,
&
GeoFenceManager
::
error
);
connect
(
this
,
&
PlanManager
::
removeAllComplete
,
this
,
&
GeoFenceManager
::
removeAllComplete
);
connect
(
this
,
&
PlanManager
::
sendComplete
,
this
,
&
GeoFenceManager
::
_sendComplete
);
connect
(
this
,
&
PlanManager
::
newMissionItemsAvailable
,
this
,
&
GeoFenceManager
::
_planManagerLoadComplete
);
}
GeoFenceManager
::~
GeoFenceManager
()
...
...
@@ -37,16 +35,6 @@ GeoFenceManager::~GeoFenceManager()
}
bool
GeoFenceManager
::
inProgress
(
void
)
const
{
return
_planManager
.
inProgress
();
}
void
GeoFenceManager
::
loadFromVehicle
(
void
)
{
_planManager
.
loadFromVehicle
();
}
void
GeoFenceManager
::
sendToVehicle
(
const
QGeoCoordinate
&
breachReturn
,
QmlObjectListModel
&
polygons
,
QmlObjectListModel
&
circles
)
...
...
@@ -117,7 +105,7 @@ void GeoFenceManager::sendToVehicle(const QGeoCoordinate& breachReturn,
}
// Plan manager takes control of MissionItems, so no need to delete
_planManager
.
writeMissionItems
(
fenceItems
);
writeMissionItems
(
fenceItems
);
}
void
GeoFenceManager
::
removeAll
(
void
)
...
...
@@ -126,7 +114,7 @@ void GeoFenceManager::removeAll(void)
_circles
.
clear
();
_breachReturnPoint
=
QGeoCoordinate
();
_p
lanManager
.
removeAll
();
P
lanManager
::
removeAll
();
}
void
GeoFenceManager
::
_sendComplete
(
bool
error
)
...
...
@@ -156,7 +144,7 @@ void GeoFenceManager::_planManagerLoadComplete(bool removeAllRequested)
MAV_CMD
expectedCommand
=
(
MAV_CMD
)
0
;
int
expectedVertexCount
=
0
;
QGCFencePolygon
nextPolygon
(
true
/* inclusion */
);
const
QList
<
MissionItem
*>&
fenceItems
=
_planManager
.
missionItems
();
const
QList
<
MissionItem
*>&
fenceItems
=
missionItems
();
for
(
int
i
=
0
;
i
<
fenceItems
.
count
();
i
++
)
{
MissionItem
*
item
=
fenceItems
[
i
];
...
...
Prev
1
2
3
4
5
Next
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