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
07d998cf
Unverified
Commit
07d998cf
authored
Jul 15, 2018
by
Don Gagne
Committed by
GitHub
Jul 15, 2018
Browse files
Merge pull request #6717 from mavlink/trimble_rtk
Add Trimble MB-Two GPS support #2
parents
fcc884e7
59ed0f52
Changes
11
Show whitespace changes
Inline
Side-by-side
qgroundcontrol.pro
View file @
07d998cf
...
@@ -642,6 +642,8 @@ HEADERS += \
...
@@ -642,6 +642,8 @@ HEADERS += \
src
/
AnalyzeView
/
GeoTagController
.
h
\
src
/
AnalyzeView
/
GeoTagController
.
h
\
src
/
AnalyzeView
/
MavlinkConsoleController
.
h
\
src
/
AnalyzeView
/
MavlinkConsoleController
.
h
\
src
/
GPS
/
Drivers
/
src
/
gps_helper
.
h
\
src
/
GPS
/
Drivers
/
src
/
gps_helper
.
h
\
src
/
GPS
/
Drivers
/
src
/
rtcm
.
h
\
src
/
GPS
/
Drivers
/
src
/
ashtech
.
h
\
src
/
GPS
/
Drivers
/
src
/
ubx
.
h
\
src
/
GPS
/
Drivers
/
src
/
ubx
.
h
\
src
/
GPS
/
GPSManager
.
h
\
src
/
GPS
/
GPSManager
.
h
\
src
/
GPS
/
GPSPositionMessage
.
h
\
src
/
GPS
/
GPSPositionMessage
.
h
\
...
@@ -823,6 +825,8 @@ SOURCES += \
...
@@ -823,6 +825,8 @@ SOURCES += \
src
/
AnalyzeView
/
GeoTagController
.
cc
\
src
/
AnalyzeView
/
GeoTagController
.
cc
\
src
/
AnalyzeView
/
MavlinkConsoleController
.
cc
\
src
/
AnalyzeView
/
MavlinkConsoleController
.
cc
\
src
/
GPS
/
Drivers
/
src
/
gps_helper
.
cpp
\
src
/
GPS
/
Drivers
/
src
/
gps_helper
.
cpp
\
src
/
GPS
/
Drivers
/
src
/
rtcm
.
cpp
\
src
/
GPS
/
Drivers
/
src
/
ashtech
.
cpp
\
src
/
GPS
/
Drivers
/
src
/
ubx
.
cpp
\
src
/
GPS
/
Drivers
/
src
/
ubx
.
cpp
\
src
/
GPS
/
GPSManager
.
cc
\
src
/
GPS
/
GPSManager
.
cc
\
src
/
GPS
/
GPSProvider
.
cc
\
src
/
GPS
/
GPSProvider
.
cc
\
...
...
Drivers
@
d7854b7b
Compare
41223e86
...
d7854b7b
Subproject commit
41223e860e0f3b7fed5075be8ac17ecb7e07e428
Subproject commit
d7854b7bcf1610bb42d89f4bae553744cbe4408c
src/GPS/GPSManager.cc
View file @
07d998cf
...
@@ -26,13 +26,22 @@ GPSManager::~GPSManager()
...
@@ -26,13 +26,22 @@ GPSManager::~GPSManager()
disconnectGPS
();
disconnectGPS
();
}
}
void
GPSManager
::
connectGPS
(
const
QString
&
device
)
void
GPSManager
::
connectGPS
(
const
QString
&
device
,
const
QString
&
gps_type
)
{
{
RTKSettings
*
rtkSettings
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
rtkSettings
();
RTKSettings
*
rtkSettings
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
rtkSettings
();
GPSProvider
::
GPSType
type
;
if
(
gps_type
.
contains
(
"trimble"
,
Qt
::
CaseInsensitive
))
{
type
=
GPSProvider
::
GPSType
::
trimble
;
qCDebug
(
RTKGPSLog
)
<<
"Connecting Trimble device"
;
}
else
{
type
=
GPSProvider
::
GPSType
::
u_blox
;
qCDebug
(
RTKGPSLog
)
<<
"Connecting U-blox device"
;
}
disconnectGPS
();
disconnectGPS
();
_requestGpsStop
=
false
;
_requestGpsStop
=
false
;
_gpsProvider
=
new
GPSProvider
(
device
,
true
,
rtkSettings
->
surveyInAccuracyLimit
()
->
rawValue
().
toDouble
(),
rtkSettings
->
surveyInMinObservationDuration
()
->
rawValue
().
toInt
(),
_requestGpsStop
);
_gpsProvider
=
new
GPSProvider
(
device
,
type
,
true
,
rtkSettings
->
surveyInAccuracyLimit
()
->
rawValue
().
toDouble
(),
rtkSettings
->
surveyInMinObservationDuration
()
->
rawValue
().
toInt
(),
_requestGpsStop
);
_gpsProvider
->
start
();
_gpsProvider
->
start
();
//create RTCM device
//create RTCM device
...
...
src/GPS/GPSManager.h
View file @
07d998cf
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
GPSManager
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
);
GPSManager
(
QGCApplication
*
app
,
QGCToolbox
*
toolbox
);
~
GPSManager
();
~
GPSManager
();
void
connectGPS
(
const
QString
&
device
);
void
connectGPS
(
const
QString
&
device
,
const
QString
&
gps_type
);
void
disconnectGPS
(
void
);
void
disconnectGPS
(
void
);
bool
connected
(
void
)
const
{
return
_gpsProvider
&&
_gpsProvider
->
isRunning
();
}
bool
connected
(
void
)
const
{
return
_gpsProvider
&&
_gpsProvider
->
isRunning
();
}
...
...
src/GPS/GPSProvider.cc
View file @
07d998cf
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include
<QDebug>
#include
<QDebug>
#include
"Drivers/src/ubx.h"
#include
"Drivers/src/ubx.h"
#include
"Drivers/src/ashtech.h"
#include
"Drivers/src/gps_helper.h"
#include
"Drivers/src/gps_helper.h"
#include
"definitions.h"
#include
"definitions.h"
...
@@ -53,7 +54,7 @@ void GPSProvider::run()
...
@@ -53,7 +54,7 @@ void GPSProvider::run()
_serial
->
setFlowControl
(
QSerialPort
::
NoFlowControl
);
_serial
->
setFlowControl
(
QSerialPort
::
NoFlowControl
);
unsigned
int
baudrate
;
unsigned
int
baudrate
;
GPS
DriverUBX
*
gpsDriver
=
nullptr
;
GPS
Helper
*
gpsDriver
=
nullptr
;
while
(
!
_requestStop
)
{
while
(
!
_requestStop
)
{
...
@@ -62,7 +63,13 @@ void GPSProvider::run()
...
@@ -62,7 +63,13 @@ void GPSProvider::run()
gpsDriver
=
nullptr
;
gpsDriver
=
nullptr
;
}
}
if
(
_type
==
GPSType
::
trimble
)
{
gpsDriver
=
new
GPSDriverAshtech
(
&
callbackEntry
,
this
,
&
_reportGpsPos
,
_pReportSatInfo
);
baudrate
=
115200
;
}
else
{
gpsDriver
=
new
GPSDriverUBX
(
GPSDriverUBX
::
Interface
::
UART
,
&
callbackEntry
,
this
,
&
_reportGpsPos
,
_pReportSatInfo
);
gpsDriver
=
new
GPSDriverUBX
(
GPSDriverUBX
::
Interface
::
UART
,
&
callbackEntry
,
this
,
&
_reportGpsPos
,
_pReportSatInfo
);
baudrate
=
0
;
// auto-configure
}
gpsDriver
->
setSurveyInSpecs
(
_surveyInAccMeters
*
10000
,
_surveryInDurationSecs
);
gpsDriver
->
setSurveyInSpecs
(
_surveyInAccMeters
*
10000
,
_surveryInDurationSecs
);
if
(
gpsDriver
->
configure
(
baudrate
,
GPSDriverUBX
::
OutputMode
::
RTCM
)
==
0
)
{
if
(
gpsDriver
->
configure
(
baudrate
,
GPSDriverUBX
::
OutputMode
::
RTCM
)
==
0
)
{
...
@@ -101,8 +108,9 @@ void GPSProvider::run()
...
@@ -101,8 +108,9 @@ void GPSProvider::run()
qCDebug
(
RTKGPSLog
)
<<
"Exiting GPS thread"
;
qCDebug
(
RTKGPSLog
)
<<
"Exiting GPS thread"
;
}
}
GPSProvider
::
GPSProvider
(
const
QString
&
device
,
bool
enableSatInfo
,
double
surveyInAccMeters
,
int
surveryInDurationSecs
,
const
std
::
atomic_bool
&
requestStop
)
GPSProvider
::
GPSProvider
(
const
QString
&
device
,
GPSType
type
,
bool
enableSatInfo
,
double
surveyInAccMeters
,
int
surveryInDurationSecs
,
const
std
::
atomic_bool
&
requestStop
)
:
_device
(
device
)
:
_device
(
device
)
,
_type
(
type
)
,
_requestStop
(
requestStop
)
,
_requestStop
(
requestStop
)
,
_surveyInAccMeters
(
surveyInAccMeters
)
,
_surveyInAccMeters
(
surveyInAccMeters
)
,
_surveryInDurationSecs
(
surveryInDurationSecs
)
,
_surveryInDurationSecs
(
surveryInDurationSecs
)
...
...
src/GPS/GPSProvider.h
View file @
07d998cf
...
@@ -29,7 +29,14 @@ class GPSProvider : public QThread
...
@@ -29,7 +29,14 @@ class GPSProvider : public QThread
{
{
Q_OBJECT
Q_OBJECT
public:
public:
GPSProvider
(
const
QString
&
device
,
bool
enableSatInfo
,
double
surveyInAccMeters
,
int
surveryInDurationSecs
,
const
std
::
atomic_bool
&
requestStop
);
enum
class
GPSType
{
u_blox
,
trimble
};
GPSProvider
(
const
QString
&
device
,
GPSType
type
,
bool
enableSatInfo
,
double
surveyInAccMeters
,
int
surveryInDurationSecs
,
const
std
::
atomic_bool
&
requestStop
);
~
GPSProvider
();
~
GPSProvider
();
/**
/**
...
@@ -57,6 +64,7 @@ private:
...
@@ -57,6 +64,7 @@ private:
int
callback
(
GPSCallbackType
type
,
void
*
data1
,
int
data2
);
int
callback
(
GPSCallbackType
type
,
void
*
data1
,
int
data2
);
QString
_device
;
QString
_device
;
GPSType
_type
;
const
std
::
atomic_bool
&
_requestStop
;
const
std
::
atomic_bool
&
_requestStop
;
double
_surveyInAccMeters
;
double
_surveyInAccMeters
;
int
_surveryInDurationSecs
;
int
_surveryInDurationSecs
;
...
...
src/GPS/vehicle_gps_position.h
View file @
07d998cf
...
@@ -63,6 +63,7 @@ struct vehicle_gps_position_s {
...
@@ -63,6 +63,7 @@ struct vehicle_gps_position_s {
float
vel_d_m_s
;
float
vel_d_m_s
;
float
cog_rad
;
float
cog_rad
;
int32_t
timestamp_time_relative
;
int32_t
timestamp_time_relative
;
float
heading
;
uint8_t
fix_type
;
uint8_t
fix_type
;
bool
vel_ned_valid
;
bool
vel_ned_valid
;
uint8_t
satellites_used
;
uint8_t
satellites_used
;
...
...
src/comm/LinkManager.cc
View file @
07d998cf
...
@@ -586,7 +586,7 @@ void LinkManager::_updateAutoConnectLinks(void)
...
@@ -586,7 +586,7 @@ void LinkManager::_updateAutoConnectLinks(void)
if
(
_autoConnectSettings
->
autoConnectRTKGPS
()
->
rawValue
().
toBool
()
&&
!
_toolbox
->
gpsManager
()
->
connected
())
{
if
(
_autoConnectSettings
->
autoConnectRTKGPS
()
->
rawValue
().
toBool
()
&&
!
_toolbox
->
gpsManager
()
->
connected
())
{
qCDebug
(
LinkManagerLog
)
<<
"RTK GPS auto-connected"
<<
portInfo
.
portName
().
trimmed
();
qCDebug
(
LinkManagerLog
)
<<
"RTK GPS auto-connected"
<<
portInfo
.
portName
().
trimmed
();
_autoConnectRTKPort
=
portInfo
.
systemLocation
();
_autoConnectRTKPort
=
portInfo
.
systemLocation
();
_toolbox
->
gpsManager
()
->
connectGPS
(
portInfo
.
systemLocation
());
_toolbox
->
gpsManager
()
->
connectGPS
(
portInfo
.
systemLocation
()
,
boardName
);
}
}
break
;
break
;
#endif
#endif
...
...
src/comm/USBBoardInfo.json
View file @
07d998cf
...
@@ -27,7 +27,8 @@
...
@@ -27,7 +27,8 @@
{
"vendorID"
:
1027
,
"productID"
:
24577
,
"boardClass"
:
"SiK Radio"
,
"name"
:
"SiK Radio"
,
"comment"
:
"3DR Radio on FTDI"
},
{
"vendorID"
:
1027
,
"productID"
:
24577
,
"boardClass"
:
"SiK Radio"
,
"name"
:
"SiK Radio"
,
"comment"
:
"3DR Radio on FTDI"
},
{
"vendorID"
:
4292
,
"productID"
:
60000
,
"boardClass"
:
"SiK Radio"
,
"name"
:
"SiK Radio"
,
"comment"
:
"SILabs Radio"
},
{
"vendorID"
:
4292
,
"productID"
:
60000
,
"boardClass"
:
"SiK Radio"
,
"name"
:
"SiK Radio"
,
"comment"
:
"SILabs Radio"
},
{
"vendorID"
:
5446
,
"productID"
:
424
,
"boardClass"
:
"RTK GPS"
,
"name"
:
"RTK GPS"
,
"comment"
:
"Ublox RTK GPS"
},
{
"vendorID"
:
5446
,
"productID"
:
424
,
"boardClass"
:
"RTK GPS"
,
"name"
:
"U-blox RTK GPS"
,
"comment"
:
"U-blox RTK GPS"
},
{
"vendorID"
:
1317
,
"productID"
:
42151
,
"boardClass"
:
"RTK GPS"
,
"name"
:
"Trimble RTK GPS"
,
"comment"
:
"Trimble RTK GPS"
},
{
"vendorID"
:
8352
,
"productID"
:
16732
,
"boardClass"
:
"OpenPilot"
,
"name"
:
"OpenPilot OPLink"
},
{
"vendorID"
:
8352
,
"productID"
:
16732
,
"boardClass"
:
"OpenPilot"
,
"name"
:
"OpenPilot OPLink"
},
{
"vendorID"
:
8352
,
"productID"
:
16733
,
"boardClass"
:
"OpenPilot"
,
"name"
:
"OpenPilot CC3D"
},
{
"vendorID"
:
8352
,
"productID"
:
16733
,
"boardClass"
:
"OpenPilot"
,
"name"
:
"OpenPilot CC3D"
},
...
...
src/ui/preferences/GeneralSettings.qml
View file @
07d998cf
...
@@ -402,7 +402,7 @@ QGCView {
...
@@ -402,7 +402,7 @@ QGCView {
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
columns
:
2
columns
:
2
QGCLabel
{
text
:
qsTr
(
"
Survey in accuracy
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Survey in accuracy
(U-blox only)
"
)
}
FactTextField
{
FactTextField
{
Layout.preferredWidth
:
_valueFieldWidth
Layout.preferredWidth
:
_valueFieldWidth
fact
:
QGroundControl
.
settingsManager
.
rtkSettings
.
surveyInAccuracyLimit
fact
:
QGroundControl
.
settingsManager
.
rtkSettings
.
surveyInAccuracyLimit
...
...
src/ui/toolbar/GPSRTKIndicator.qml
View file @
07d998cf
...
@@ -69,9 +69,11 @@ Item {
...
@@ -69,9 +69,11 @@ Item {
QGCLabel
{
QGCLabel
{
// during survey-in show the current accuracy, after that show the final accuracy
// during survey-in show the current accuracy, after that show the final accuracy
text
:
QGroundControl
.
gpsRtk
.
valid
.
value
?
qsTr
(
"
Accuracy:
"
)
:
qsTr
(
"
Current Accuracy:
"
)
text
:
QGroundControl
.
gpsRtk
.
valid
.
value
?
qsTr
(
"
Accuracy:
"
)
:
qsTr
(
"
Current Accuracy:
"
)
visible
:
QGroundControl
.
gpsRtk
.
currentAccuracy
.
value
>
0
}
}
QGCLabel
{
QGCLabel
{
text
:
QGroundControl
.
gpsRtk
.
currentAccuracy
.
valueString
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
text
:
QGroundControl
.
gpsRtk
.
currentAccuracy
.
valueString
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
visible
:
QGroundControl
.
gpsRtk
.
currentAccuracy
.
value
>
0
}
}
QGCLabel
{
text
:
qsTr
(
"
Satellites:
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Satellites:
"
)
}
QGCLabel
{
text
:
QGroundControl
.
gpsRtk
.
numSatellites
.
value
}
QGCLabel
{
text
:
QGroundControl
.
gpsRtk
.
numSatellites
.
value
}
...
...
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