Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration of Beidou and Glonass to M8, M9 and M10 gps modules #9124

Merged
merged 40 commits into from Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from 22 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -79,7 +79,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
brew update
#brew update
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build was failing on dependencies. brew update would reinstall a lot of things and wastes a lot of time.

Commenting it out make the sitl build for mac much faster

brew install cmake ninja ruby

- name: Setup environment
Expand Down
20 changes: 20 additions & 0 deletions docs/Settings.md
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
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
6 changes: 6 additions & 0 deletions src/main/fc/cli.c
Expand Up @@ -3468,6 +3468,12 @@ 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 Baud: %d", getGpsHwVersion(), getGpsBaudrate());
cliPrintLinefeed();
}

// 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
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
46 changes: 46 additions & 0 deletions src/main/io/gps.c
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,54 @@ 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";
}
}

void gpsSetState(gpsState_e state)
{
gpsState.state = state;
Expand Down
5 changes: 5 additions & 0 deletions src/main/io/gps.h
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,9 @@ struct serialPort_s;
void gpsEnablePassthrough(struct serialPort_s *gpsPassthroughPort);
void mspGPSReceiveNewData(const uint8_t * bufferPtr);

const char *getGpsHwVersion(void);
int getGpsBaudrate(void);

#if defined(USE_GPS_FAKE)
void gpsFakeSet(
gpsFixType_e fixType,
Expand Down