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

ZED-F9P UART2 Baudrate Configurability and New UBX Mode. #20133

Merged
merged 4 commits into from Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 src/drivers/gps/devices
Submodule devices updated 2 files
+6 −7 src/ubx.cpp
+5 −1 src/ubx.h
13 changes: 12 additions & 1 deletion src/drivers/gps/gps.cpp
Expand Up @@ -783,9 +783,20 @@ GPS::run()

} else if (gps_ubx_mode == 4) {
ubx_mode = GPSDriverUBX::UBXMode::MovingBaseUART1;

} else if (gps_ubx_mode == 5) { // rover with static base on Uart2
ubx_mode = GPSDriverUBX::UBXMode::RoverWithStaticBaseUart2;

}
}

handle = param_find("GPS_UBX_BAUD2");
int32_t f9p_uart2_baudrate = 57600;

if (handle != PARAM_INVALID) {
param_get(handle, &f9p_uart2_baudrate);
}

int32_t gnssSystemsParam = static_cast<int32_t>(GPSHelper::GNSSSystemsMask::RECEIVER_DEFAULTS);

if (_instance == Instance::Main) {
Expand Down Expand Up @@ -846,7 +857,7 @@ GPS::run()
/* FALLTHROUGH */
case gps_driver_mode_t::UBX:
_helper = new GPSDriverUBX(_interface, &GPS::callback, this, &_report_gps_pos, _p_report_sat_info,
gps_ubx_dynmodel, heading_offset, ubx_mode);
gps_ubx_dynmodel, heading_offset, f9p_uart2_baudrate, ubx_mode);
set_device_type(DRV_GPS_DEVTYPE_UBX);
break;
#ifndef CONSTRAINED_FLASH
Expand Down
18 changes: 18 additions & 0 deletions src/drivers/gps/params.c
Expand Up @@ -87,6 +87,7 @@ PARAM_DEFINE_INT32(GPS_SAT_INFO, 0);
* Select the u-blox configuration setup. Most setups will use the default, including RTK and
* dual GPS without heading.
*
* If rover has RTCM corrections from a static base (or other static correction source) coming in on UART2, then select Mode 5.
* The Heading mode requires 2 F9P devices to be attached. The main GPS will act as rover and output
* heading information, whereas the secondary will act as moving base.
* Modes 1 and 2 require each F9P UART1 to be connected to the Autopilot. In addition, UART2 on the
Expand All @@ -101,13 +102,30 @@ PARAM_DEFINE_INT32(GPS_SAT_INFO, 0);
* @value 2 Moving Base (UART1 Connected To Autopilot, UART2 Connected To Rover)
* @value 3 Heading (Rover With Moving Base UART1 Connected to Autopilot Or Can Node At 921600)
* @value 4 Moving Base (Moving Base UART1 Connected to Autopilot Or Can Node At 921600)
* @value 5 Rover with Static Base on UART2 (similar to Default, except coming in on UART2)
*
* @reboot_required true
* @group GPS
*/
PARAM_DEFINE_INT32(GPS_UBX_MODE, 0);


/**
* u-blox F9P UART2 Baudrate
*
* Select a baudrate for the F9P's UART2 port.
* In GPS_UBX_MODE 1, 2, and 3, the F9P's UART2 port is configured to send/receive RTCM corrections.
* Set this to 57600 if you want to attach a telemetry radio on UART2.
*
* @min 0
* @unit B/s
*
* @reboot_required true
* @group GPS
*/
PARAM_DEFINE_INT32(GPS_UBX_BAUD2, 230400);


/**
* Heading/Yaw offset for dual antenna GPS
*
Expand Down