Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
effe0fd
Add support for configuring other GNSS constellations
mmosca Jun 8, 2023
f70cbbe
Initial attempt, not sure it is working yet
mmosca Jun 8, 2023
73012cf
Move type declarations to header file
mmosca Jun 8, 2023
b242488
Changes to avoid issues in c++ unit tests
mmosca Jun 8, 2023
96a8644
split gps_ublox to facilitate unit tests
mmosca Jun 8, 2023
7cec2be
Cleanup
mmosca Jun 8, 2023
f984f05
small changes to unit test
mmosca Jun 8, 2023
94e7c07
Add first assert
mmosca Jun 8, 2023
0ddcadb
Passing check agains packet generated in u-center2
mmosca Jun 9, 2023
f87f657
Add missing files.
mmosca Jun 9, 2023
9512600
remove header that is not needed
mmosca Jun 9, 2023
2cdba83
Debugging changes
mmosca Jun 9, 2023
0ea6c59
Merge remote-tracking branch 'origin/master' into mmosca-gps-glonass
mmosca Jun 9, 2023
e950ba8
Re-enable gss full bulk gnss config
mmosca Jun 14, 2023
3bc96dd
Disable beidous and gzss config for UBLOX8 and older
mmosca Jun 14, 2023
2de339e
Add support for configuring more GNSS constelations in M9+
mmosca Jun 14, 2023
3a4d475
Add file header
mmosca Jun 14, 2023
d56509b
Add file header
mmosca Jun 14, 2023
eb723d6
remove left over debug code
mmosca Jun 14, 2023
3b2118b
remove more debug code
mmosca Jun 14, 2023
7da7b89
Fix typo
mmosca Jun 14, 2023
552cc2c
skip brew update for a faster build
mmosca Jun 14, 2023
716bcbe
Remove redundant definition from CMakeList.txt
mmosca Jun 14, 2023
e3bd1df
Ensure ck_a and ck_b are initialized before calculating checksum
mmosca Jun 15, 2023
ef7984f
Use 5Hz as fallback value in all cases.
mmosca Jun 15, 2023
0fda8d9
Refaactor GNSS capabilities detection for M8+ devices
mmosca Jun 15, 2023
26f69a2
Change format of GPS status
mmosca Jun 15, 2023
68571a6
Simplify capabilities parsing
mmosca Jun 15, 2023
7cd8076
Make sure we poll for gnss capabilities after config
mmosca Jun 15, 2023
e1798a7
Merge remote-tracking branch 'origin/master' into mmosca-gps-glonass
mmosca Jun 15, 2023
7d355a7
Merge remote-tracking branch 'origin/master' into mmosca-gps-glonass
mmosca Jun 15, 2023
adf022e
Merge remote-tracking branch 'origin/master' into mmosca-gps-glonass
mmosca Jun 16, 2023
a2df1a6
Update pdf links to for M9 and M10 interface descriptions
mmosca Jun 16, 2023
58799bb
Fix old school detection, for backwards compatibility.
mmosca Jun 16, 2023
9b39cdf
Parse protocol version in ublox messages
mmosca Jun 16, 2023
c091678
fix sigCfgMsk
mmosca Jun 16, 2023
6feb1e4
Simplify capabilities detection and consolidate gnss info into 3
mmosca Jun 16, 2023
1205b69
remove debug info and fix a typo
mmosca Jun 16, 2023
ca6910a
Retry version polling on the same interval as capabilities
mmosca Jun 16, 2023
4923888
Remove debug info
mmosca Jun 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,16 @@ Navigation update rate for UBLOX7 receivers. Some receivers may limit the maximu

---

### gps_ublox_use_beidou

Enable use of Beidou satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires gps hardware support [OFF/ON].

| Default | Min | Max |
| --- | --- | --- |
| OFF | OFF | ON |

---

### gps_ublox_use_galileo

Enable use of Galileo satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires M8N and Ublox firmware 3.x (or later) [OFF/ON].
Expand All @@ -1442,6 +1452,16 @@ Enable use of Galileo satellites. This is at the expense of other regional const

---

### gps_ublox_use_glonass

Enable use of Glonass satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires gps haardware support [OFF/ON].

| Default | Min | Max |
| --- | --- | --- |
| OFF | OFF | ON |

---

### ground_test_mode

For developer ground test use. Disables motors, sets heading status = Trusted on FW.
Expand Down
1 change: 1 addition & 0 deletions src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ main_sources(COMMON_SRC
io/gps.c
io/gps.h
io/gps_ublox.c
io/gps_ublox_utils.c
io/gps_nmea.c
io/gps_msp.c
io/gps_fake.c
Expand Down
18 changes: 18 additions & 0 deletions src/main/fc/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ bool cliMode = false;
#include "io/beeper.h"
#include "io/flashfs.h"
#include "io/gps.h"
#include "io/gps_ublox.h"
#include "io/ledstrip.h"
#include "io/osd.h"
#include "io/serial.h"
Expand Down Expand Up @@ -3468,6 +3469,23 @@ static void cliStatus(char *cmdline)
cliPrintLinefeed();
#endif

if (featureConfigured(FEATURE_GPS) && (gpsConfig()->provider == GPS_UBLOX || gpsConfig()->provider == GPS_UBLOX7PLUS)) {
cliPrint("GPS: ");
cliPrintf("HW Version: %s Proto: %d.%02d Baud: %d", getGpsHwVersion(), getGpsProtoMajorVersion(), getGpsProtoMinorVersion(), getGpsBaudrate());
cliPrintLinefeed();
//cliPrintLinef(" GNSS Capabilities: %d", gpsUbloxCapLastUpdate());
cliPrintLinef(" GNSS Capabilities:");
cliPrintLine(" GNSS Provider active/default");
cliPrintLine(" GPS 1/1");
if(gpsUbloxHasGalileo())
cliPrintLinef(" Galileo %d/%d", gpsUbloxGalileoEnabled(), gpsUbloxGalileoDefault());
if(gpsUbloxHasBeidou())
cliPrintLinef(" BeiDou %d/%d", gpsUbloxBeidouEnabled(), gpsUbloxBeidouDefault());
if(gpsUbloxHasGlonass())
cliPrintLinef(" Glonass %d/%d", gpsUbloxGlonassEnabled(), gpsUbloxGlonassDefault());
cliPrintLinef(" Max concurrent: %d", gpsUbloxMaxGnss());
}

// If we are blocked by PWM init - provide more information
if (getPwmInitError() != PWM_INIT_ERROR_NONE) {
cliPrintLinef("PWM output init error: %s", getPwmInitErrorMessage());
Expand Down
10 changes: 10 additions & 0 deletions src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,16 @@ groups:
default_value: OFF
field: ubloxUseGalileo
type: bool
- name: gps_ublox_use_beidou
description: "Enable use of Beidou satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires gps hardware support [OFF/ON]."
default_value: OFF
field: ubloxUseBeidou
type: bool
- name: gps_ublox_use_glonass
description: "Enable use of Glonass satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires gps haardware support [OFF/ON]."
default_value: OFF
field: ubloxUseGlonass
type: bool
- name: gps_min_sats
description: "Minimum number of GPS satellites in view to acquire GPS_FIX and consider GPS position valid. Some GPS receivers appeared to be very inaccurate with low satellite count."
default_value: 6
Expand Down
56 changes: 56 additions & 0 deletions src/main/io/gps.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "io/serial.h"
#include "io/gps.h"
#include "io/gps_private.h"
#include "io/gps_ublox.h"

#include "navigation/navigation.h"

Expand Down Expand Up @@ -122,9 +123,64 @@ PG_RESET_TEMPLATE(gpsConfig_t, gpsConfig,
.dynModel = SETTING_GPS_DYN_MODEL_DEFAULT,
.gpsMinSats = SETTING_GPS_MIN_SATS_DEFAULT,
.ubloxUseGalileo = SETTING_GPS_UBLOX_USE_GALILEO_DEFAULT,
.ubloxUseBeidou = SETTING_GPS_UBLOX_USE_BEIDOU_DEFAULT,
.ubloxUseGlonass = SETTING_GPS_UBLOX_USE_GLONASS_DEFAULT,
.ubloxNavHz = SETTING_GPS_UBLOX_NAV_HZ_DEFAULT
);


int getGpsBaudrate(void)
{
switch(gpsState.baudrateIndex)
{
case GPS_BAUDRATE_115200:
return 115200;
case GPS_BAUDRATE_57600:
return 57600;
case GPS_BAUDRATE_38400:
return 38400;
case GPS_BAUDRATE_19200:
return 19200;
case GPS_BAUDRATE_9600:
return 9600;
case GPS_BAUDRATE_230400:
return 230400;
default:
return 0;
}
}

const char *getGpsHwVersion(void)
{
switch(gpsState.hwVersion)
{
case UBX_HW_VERSION_UBLOX5:
return "UBLOX5";
case UBX_HW_VERSION_UBLOX6:
return "UBLOX6";
case UBX_HW_VERSION_UBLOX7:
return "UBLOX7";
case UBX_HW_VERSION_UBLOX8:
return "UBLOX8";
case UBX_HW_VERSION_UBLOX9:
return "UBLOX9";
case UBX_HW_VERSION_UBLOX10:
return "UBLOX10";
default:
return "Unknown";
}
}

uint8_t getGpsProtoMajorVersion(void)
{
return gpsState.swVersionMajor;
}

uint8_t getGpsProtoMinorVersion(void)
{
return gpsState.swVersionMinor;
}

void gpsSetState(gpsState_e state)
{
gpsState.state = state;
Expand Down
8 changes: 8 additions & 0 deletions src/main/io/gps.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ typedef struct gpsConfig_s {
gpsAutoBaud_e autoBaud;
gpsDynModel_e dynModel;
bool ubloxUseGalileo;
bool ubloxUseBeidou;
bool ubloxUseGlonass;
uint8_t gpsMinSats;
uint8_t ubloxNavHz;
} gpsConfig_t;
Expand Down Expand Up @@ -166,6 +168,12 @@ struct serialPort_s;
void gpsEnablePassthrough(struct serialPort_s *gpsPassthroughPort);
void mspGPSReceiveNewData(const uint8_t * bufferPtr);

const char *getGpsHwVersion(void);
uint8_t getGpsProtoMajorVersion(void);
uint8_t getGpsProtoMinorVersion(void);

int getGpsBaudrate(void);

#if defined(USE_GPS_FAKE)
void gpsFakeSet(
gpsFixType_e fixType,
Expand Down
4 changes: 4 additions & 0 deletions src/main/io/gps_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ typedef struct {
serialPort_t * gpsPort; // Serial GPS only

uint32_t hwVersion;
uint8_t swVersionMajor;
uint8_t swVersionMinor;

gpsState_e state;
gpsBaudRate_e baudrateIndex;
Expand All @@ -54,6 +56,8 @@ typedef struct {
timeMs_t lastMessageMs;
timeMs_t timeoutMs;
timeMs_t baseTimeoutMs;
timeMs_t lastCapaPoolMs;
timeMs_t lastCapaUpdMs;
} gpsReceiverData_t;

extern gpsReceiverData_t gpsState;
Expand Down
Loading