Px4 + rtk + raspberryPi fed rtk correction data: is it possible?

Hey there,

I wanted to start a little project to build a rtk drone with a raspberry pi mounted as well, which receives the rtk via cellular from SAPOS (it’s a provider in Germany offering rtk data over the internet in real time in the Ntrip standard.) I know it’s possible for DJI drones, but after quite some search I couldn’t come up with someone in the pixhawk community writing about this.

So I wonder mainly about two things:

  1. Can I transmit the rtk data via cable from pi to px4 or do I have to do the go around via bluetooth (from which I know it’s working, but quite unreliable)?
  2. Which RTK receiver is able to be fed rtk data not from the designated base station of the same brand, but rtk data from this online provider?

Help is much appreciated!

You will just need to send the rtcm data to the flight controller from the pi over mavlink.

Understood, thanks.
Do you know which rtk receivers are able to handle SAPOS data?

I don’t believe the Ublox F9P can use SAPOS.

Hi @louiluiloui,

I can give you my feedback as I implemented a RTK stream with:
Internet ↔ Companion computer (RPi) ↔ Ntripclient + MAVSDK ↔ Pixhawk 4 ↔ Ublox F9P

Yes. In my case, I use UART of RPi to TELEM2 of Pixhawk 4. Then I use an adaptation of a C++ ntrip client here and send the ntrip correction with the send_rtcm_data provided in MAVSDK. MAVProxy also have something to send ntrip data in Python here

I use the F9P ublox chip. I don’t know SAPOS but I would say if it respect the ntrip standard it worth giving a try.

One possibility also could be to use something already done such as ArduSimple do with their 4G Ntrip module or one of their kit so that you just have to worry about finding an internet provider.

I hope this help !

1 Like

what makes you think that?

That helps a lot, thanks!
My problem is the UART of my Pi is already used for my cellular module.
I saw there are some workarounds using the USB port of the Pi and going into the telem2 of the pixhawk via an adaptor, but they all seemed to work rather poorly. Have you a any tips for establishing such a connection?

ah never mind I just saw that a normal usb cable works just fine from pi to pixhawk. Is it really that simple?

When you forward the Ntrip data to the Pixhawk you should see the drone switching to RTK fixed or float if it’s working properly

No mention of SAPOS in the data sheet.

@AlexKlimaj Well I would be surprised if they list it there, after all it’s an official provider from the German government. SAPOS is just available in Germany. There are those providers of the rtk data in many countries and none of them are listed.

@all Anyways I have now all the parts together and will update you if it works the way I hope (it probably won’t)
Thanks again!

1 Like

Hi can you please explain more about this?

I am very new to this and what you implemented a RTK stream is exactly I am trying to reach!!!

Hi @Benjamin1994,

Happy to help but I would need more specific question :sweat_smile: You already implemented something and fail to make it works or you don’t understand the setup I propose ?

Thank you for reply!

Here is my setup:
raspberryPi fed RTK correction data to Pixawk: is it possible? - PX4 Autopilot - Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink

All I want to do is sending RTK Correction Data to Drone without telemetry, therefore my idea is

  1. Streaming RTK correction data (RTCM only, because I can only find python function that feed rtcm data to Pixhawk) from Holybro RTK Base Station to RPi(A) connected to it <— I have done this part

  2. Once the RPi(A) connected to Holybro RTK Base Station, it will send the correction data to another RPi(B) connected to Pixhawk via Wi-Fi (they are both in the network) <---- I barely have done this part

  3. Once RPi(B) received the correction data from RPi(A), it feed the data to Pixhawk for getting RTK float or even RTK Fixed <----- this is the part I am struggling, I could not find any example for me to achieve this part

I was doing research and found this post, I think Mr.Katawan your set-up is much lighter (sorry for my poor english). The idea I got from your set-up is, you do not need the RTK base station because you directly get the NTRIP data from online and feed it to Pixhawk. My RPi(B) which connected to Pixhawk is plugged in a 4G SIM Card Dongle, therefore I think your system may also can be applied on my system.

However, at this stage, I would like to ask Mr.Katawan, can you please explain or teach me, how do I use the send_rtcm_data provided in MAVSDK, to feed the RTK correction data I got from RTK base station, to Pixhawk?

Thank you very much!!!

Here is the RTCM correction data I got from RTK base station

So I guess you have also a Holybro RTK connected in you drone through UART or something like this ?

Basically you need to send the raw data of RTCM to the Pixhawk and it will forward it automatically to your onboard GPS RTK

If you are working with Python, you might found a good example of use in MAVProxy here. In my case I wrote the bridge in C++ using MAVSDK but I can share it to you if necessary.

P.S: You can mp me in the PX4 discord it would be easier to discuss Dronecode Foundation

Thank you for the reply again!!!

Yes, I do have the Holybro RTK rover connected to my drone through UART, here is my RTK rover

My Raspberry Pi(B) is connected to my drone through Serial Port (/dev/ttyAMA1) to TELEM2 of PX4

And I have this RTK base connected to my Raspberry Pi(A)

I do have search for example code of MAVSDK and I think this example is what I would like to achieve

I tried to run this code in my Raspberry Pi(B) (Connected to PX4) but I don’t think it send the RTK data to PX4, can you help me with that? I sure my Raspberry Pi(B) can communicated to PX4 since I can run this code and get all the parameters:

Yes I am working with Python but I am really new to it, I do not know quite much about it and therefore I would like to use the existed system, which is Raspberry Pi(A) sends the RTCM data to Raspberry Pi(B) via Wi-Fi, and then Raspberry Pi(B) send the data to Pixhawk.

as you said “Basically you need to send the raw data of RTCM to the Pixhawk and it will forward it automatically to your onboard GPS RTK”

THIS IS THE PART I AM REALLY STRUGGLING, I do not know how to send the raw data of RTCM to the Pixhawk via python code. Can you please help me with this?

Sorry I tried to understand the MAVProxy code but I really do not understand…
Is the code run in base station or run in drone?

the PX4 I am using was bought 2 yrs before and I did not upgrade its firmware,
will it be the reason I run the MAVSDK example and got nothing? The old firmware can not communicate with new python code?