bastikr / python-ubx

Library implementing the binary u-blox UBX protocol
8 stars 2 forks source link

RTK capability: (base-station) receive RTCM (1005, 1077 and 1087) corrections #1

Open AlexisTM opened 6 years ago

AlexisTM commented 6 years ago

Is it possible to use this library on the UBX M8P for RTK purpose (base-station)?

If not, do you plan on supporting it, is this project open for contributions?

bastikr commented 6 years ago

This library focuses on implementing just the UBX protocol - at the moment only the M8 version. So setting the dynamic model on your device should work by sending a CFG-NAV5 message.

I have no experience with the RTCM protocol but it should probably be implemented in a separate library. If there are good reasons to include it in this package, I would be glad to hear them.

Contributions are of course always welcome. Simply testing and giving feedback would be great already and pull requests are even better!

AlexisTM commented 6 years ago

The RTCM3 messages are specific to the M8P to allow RTK positioning. (Not M8T)

Normally it requires only to configure that we want the RTCM messages output on the base station. The message is then sent to the moving agent (UAV, UGV, boat,...) and it injects the message directly to the M8P, which needs to be configured with RTCM input.

bastikr commented 6 years ago

Is the RTCM protocol similar to the ubx rotocol? I couldn't find its specification online without having to pay 80$... If it's similar then it could make sense to implement it here, otherwise probably not.

AlexisTM commented 6 years ago

We get the RTCM messages using the UBX protocol, enabling them like the NMEA output for example.

We don't need to understand the message itself but only to forward them to the second m8p GPS device.

AlexisTM commented 6 years ago

It finally seems pretty simple, you can configure the messages via UBX-CFG-MSG, using:

#define UBX_CLASS_RTCM3 0xF5

/* UBX ID for RTCM3 output messages */
/* Minimal messages for RTK: 1005, 1077 + (1087 or 1127) */
/* Reduced message size using MSM4: 1005, 1074 + (1084 or 1124)  */
#define UBX_ID_RTCM3_1005   0x05    /**< Stationary RTK reference station ARP */
#define UBX_ID_RTCM3_1074   0x4A    /**< GPS MSM4 */
#define UBX_ID_RTCM3_1077   0x4D    /**< GPS MSM7 */
#define UBX_ID_RTCM3_1084   0x54    /**< GLONASS MSM4 */
#define UBX_ID_RTCM3_1087   0x57    /**< GLONASS MSM7 */
#define UBX_ID_RTCM3_1124   0x7C    /**< BeiDou MSM4 */
#define UBX_ID_RTCM3_1127   0x7F    /**< BeiDou MSM7 */
#define UBX_ID_RTCM3_1230   0xE6    /**< GLONASS code-phase biases */
#define UBX_ID_RTCM3_4072   0xFE    /**< Reference station PVT (u-blox proprietary RTCM Message) - Used for moving baseline */

#define UBX_MSG_RTCM3_1005  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_1005 << 8)
#define UBX_MSG_RTCM3_1077  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_1077 << 8)
#define UBX_MSG_RTCM3_1087  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_1087 << 8)
#define UBX_MSG_RTCM3_1074  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_1074 << 8)
#define UBX_MSG_RTCM3_1084  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_1084 << 8)
#define UBX_MSG_RTCM3_1124  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_1124 << 8)
#define UBX_MSG_RTCM3_1127  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_1127 << 8)
#define UBX_MSG_RTCM3_1230  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_1230 << 8)
#define UBX_MSG_RTCM3_4072  ((UBX_CLASS_RTCM3) | UBX_ID_RTCM3_4072 << 8)

The important messages are: 1005 + 1077(GPS) + 1087(Glonass)/1127 (Beidou) + 4072 (for moving baseline)

I finally "just made it": https://github.com/AlexisTM/rtk_ros