# Full Real-Time Positioning and Attitude System Based on GNSS-RTK Technology
## Appendix A Configuration of the Prototype
### GNSS Receiver Configuration  
GNSS receiver 1 is configured as the mobile base, with the following parameters:  
* Enabled constellations: GPS, GLONASS, Galileo, BeiDou, QZSS
* UART1: 230,400 bps, Protocol out: UBX, 8-N-1
* UART2: 230,400 bps, Protocol out: UBX, 8-N-1 (optional, not used by default)
* Output frequency: 10 Hz
* Enabled messages: RTCM-1077, RTCM-1087, RTCM-1097, RTCM-1127, RTCM-1230, RTCM-4072.0, RTCM-4072.1 GNSS receivers 2 and 3 are configured as rovers with the following parameters:  
* Enabled constellations: GPS, GLONASS, Galileo, BeiDou, QZSS
* UART1: 230,400 bps, Protocol out: UBX, 8-N-1
* UART2: 230,400 bps, Protocol out: UBX, 8-N-1
* Output frequency: 10 Hz  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Peripheral** & **Parameter** & **Value** \\ \hline Main clock & Speed & 216 MHz \\  & Baudrate & 230,400 bps \\ UART1 & Mode & asynchronous \\  & NVIC Interrupts & RX \textgreater{} DMA1 \\  & Baudrate & 230,400 bps \\ UART2 & Mode & asynchronous \\  & NVIC Interrupts & RX \textgreater{} DMA2 \\ UART3 & Baudrate & 115,200 bps \\  & Mode & asynchronous (8-N-1) \\ DMA1 & Mode & circular \\  & Size & 1 byte \\ DMA1 & Mode & circular \\  & Size & 1 byte \\ \hline \hline \end{tabular}
\end{table}
Table 1: Configuration of the microcontroller peripherals.  
* Enabled messages: UBX-NAV-PVT, UBX-NAV-RELPOSNED, UBX-NAV-EOE, NMEA-GGA (only for GNSS receiver 2) For GNSS receiver 1, which, as mentioned, works as the mobile base, the messages recommended by the manufacturer were chosen:
* MSM: They are a standard of the RTCM protocol, and, particularly, MSM7 offers the maximum information with respect to observation and numeric resolution [35]. Messages MSM7 1077, 1087, 1097, and 1127 correspond to observations of the satellite constellations GPS, GLONASS, Galileo and BeiDou, respectively.
* Message 1230 provides the code/phase deviations of the GLONASS constellation. In this constellation, each satellite emits a different frequency, and this makes the solving of ambiguity even more complex.
* Messages 4072.0 and 4072.1, which are property of U-Blox, are used exclusively for the mobile base functionality, reporting detailed information about its position.  
For simplifying the mathematical computation and to avoid the use of one of the microcontroller UARTSs, the message UBX-NAV-RELPOSNED was chosen, which reports the relative position between the GNSS receiver and the mobile base in the NED reference system. For obtaining the receiver's absolute position, the message UBX-NAV-PVT was used, which reports the latitude, longitude, and ellipsoidal height. Using this message, a maximum accuracy of 1.1 cm may be obtained depending on the number of decimals used. In case more accuracy is needed, the message UBX-NAV-HPPOSLLH can be used, since it uses two additional decimals. For synchronizing the receivers, the message UBX-NAV-EOE is used, which notifies that the receiver finished sending all the messages of an epoch.  
The message NMEA-GGA is enabled in receiver 2 to help in the generation of the output message PAOGI of the NMEA protocol. This message is defined by the AgOpenGPS open-source project for the output information of attitude and position in the NMEA protocol. This means that the position of the system is, in fact, the position of receiver 2. For this reason, receiver 2 is configured to generate NMEA messages with high precision (using extra decimals).