Differential GPS Mavlink and Matripilot

54 views
Skip to first unread message

Guy-François MESNIL

unread,
Jul 28, 2020, 9:25:17 AM7/28/20
to uavdevboard
Hi Gentlenav!
To achieve the navigation accuracy that I aim, 0.1 meter, I plan to connect a differential GPS ZED-F9P.
I have good hope to succeed after prototyping the couple Base/Rover (from Ardusimple) with a dedicated Delphi/Pascal software developped for that purpose.

I have already upgraded MatrixPilot to receive the two new nav messages UBX_NAV_PVT and UBX_NAV_RELPOSNED that I will use for the multicopter navigation.

It must be very simple to implement this differential GPS in MatrixPilot : The only thing to do is to transmit RTCM3 data from the Base to the DGPS via Mavlink and UDB5 UART1.
It seems that 2 messages have been created to do the job :
  1. message name="GPS_INJECT_DATA" id="123"
  2. message id="233" name="GPS_RTCM_DATA"
I will use my own GCS and so no problems are seen on this side.

The difficulty is to transmit a Mavlink long message where the length of the data is only known when the base sent them to the GCS and depend upon the number of satellites (that could be greater than 20) used to correct the rover.
Have any of you done the work yet in MatrixPilot?
Or any suggestions will be apreciated to receive the Mavelink RTCM message from the GCS and sent these data to the GPS connected to the UDB port during the flight?

Many thanks in advance,
Best wishes,
gfm


Guy-François MESNIL

unread,
Sep 13, 2020, 4:23:58 AM9/13/20
to uavdevboard
Hi Gentlenav,
I am happy to give you some feedbacks about the project to connect a differential GPS ZED-F9P to MatrixPilot.
Of course, it was not a plug and play replacement of the standard GPS and I had to solve some difficulties.
In a first step I connected directly, with USB connectors, the base and the rover to the PC. I created specific software to receive the RTCM3 message from the base and send them to the rover.
I try to read the RELPOSNED message, but unsuccessfully. The description of the message had changed and must be conform to this document : ZED-F9P_InterfaceDescription_(UBX-18010854).pdf.
When all was correct "on the table" I tried to connect the base to the GCS, sending the RTCM3 messages via the telemetry with Mavlink protocol (using the message 233), receiving and decoding the message in MatrixPilot which send it to the GPS. MatrixPilot was upgraded to decode RELPOSNED message.
I encountered two difficulties:
1- The first is obvious but gave me some time to fix: the mavlink_message_CRCs table must be the same in the GCS and in PatrixPilot. In MatrixPilot the CRC constants are defined in two files (MAVlink/include/common/common.h and MAVlink/include/matrixpilot/matrixpilot.h). These to files have different CRC for the message 233. The table retained by matrixpilot is defined in the last file ( matrixpilot.h). I do not remember where I picked up the mavlink_message_CRCs for the GCS but the CRC for the message 233 was different from those in Matrixpilot.
So we have to take care about that!
2- Matrixpilot initializes the GPS by sending some configuration data during the GPS setup (gps_startup_sequence procedure), using gpsoutbin(int16_t length, const uint8_t msg[]).
This is done when we have time to send small messages at low rate. But, the 5 RTCM messages are heavy (some time shared in several 180 data length messages) and need to integrate a kind of FIFO in the gpsoutbin procedure.
I have upgraded this procedure in my MatrixPilot version.

Now, the rover receives the RTCM3 messages correctly and commutes in RTK mode.

I will go ahead to adapt the navigation loop for this accuracy announced to be close to centimeter!

Best regards,
gfm 

Peter Hollands

unread,
Sep 14, 2020, 3:11:17 AM9/14/20
to uavdevboard
Hi Guy Francois,

Congratulations on making the improvements for  high precision RTK2 GPS positioning.

Out of a general interest, I will try to take a look at your code changes over the next few days. I will be looking at this branch. Please can you confirm that I am looking at the correct and up to date code.

Best wishes, Pete


--
--
---
You received this message because you are subscribed to the Google Groups "uavdevboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/uavdevboard/58547829-3746-4ea3-8041-52698b49b662o%40googlegroups.com.

Guy-François MESNIL

unread,
Sep 14, 2020, 3:35:53 PM9/14/20
to uavdevboard
Hi Pete,
Yes, the branch you point into is the right one.
Please, pay attention to this code, it concerns only the capacity to send RTCM3 messages from the GCS to the rover to obtain its RTK capacity. I have not yet implemented this new behaviour of the GPS into the deadreckoning part of MatrixPilot ;)
And I have not yet cleaned the code, like, for instance, the PX4 implementation of rtcm_data_message which I used as model.
Best wishes, gfm  
Reply all
Reply to author
Forward
0 new messages