Home        Store        Learn        Blog

Underwater GPS recv data

I just bought the underwater GPS kit and installed it on my BlueROV2.
I use a python program to control the ROV through MAVlink commands. Is it possible the get the X and Y coordinates for the ROV through a command? The other values as ATTITUDE i use the recv_match and save the values, but how would i do it with the Underwater GPS? can i do it the same way, and what msg ID is it send with?


The problem is that if we activate the GPS then it cuts out when we start the python program due to this line:
os.system(‘screen -XS mavproxy quit’)

Is it possible to allow the GPS signal while the program is running, so the GPS data can be used?

And is it possible to deactivate the sound when the battery is connected?

Can you give me a link on github to the line you are talking about? Find the line, then click the line number, and the url will change to a link to that line number like this. The piece of code you pointed out appears several places.

When we start the gps, mavproxy will continue to run. Whenever we stop mavproxy, it is for a good reason, and we restart it when we are able. The gps program and mavproxy run at the same time, and the gps is available for use. I’m not sure what your problem is, you should share more about your code, how you use it/want to use it, and what your problemm is.

Regarding the battery sound, it is possible to disable it, but you will need to reprogram the escs using BLHeliSuite.

Hi Kenneth,

The ESC start up sequence of beeps can be disabled, but it will require some work. This is default functionality built into the BLHEli_S firmware that cannot be disabled through the regular user interface and configuration options. To do so, you will need to compile your own variation of BLHeli_S with the beeps disabled, and flash your ESCs. If you have any questions and are interested in doing this, I suggest you get in contact with the author.

Disregard my previous answer, Jacob is correct. I forgot BLHeli_S does in fact have a default configuration option to increase, decrease, or completely disable the volume of all ESC beeps. You can use BLHeliSuite to interface with your ESCs and alter their beep strength.


Right now we just stop mavproxy at the start and do not turn it back on again, but as i understand we could turn it back on again later in the code, without getting an error message?

What sould you write to turn it back on?

The error message is as post 5 in this thread:

Hi Kenneth,

To turn mavproxy back again, you can run restart-mavproxy.sh that is in ~/companion/scripts/.

Why are you stopping it?

Hi Jacob

We are stopping mavproxy (screen -XS mavproxy quit) because else it will give us an error, when we try to use the following code:
from pymavlink import mavutil

autopilot = mavutil.mavlink_connection(‘udpin:’)

It gives the following error, if screen quit is not called before:

Ok, mavproxy needs to run for everything to work properly. You should connect to mavproxy instead of attempting to connect to QGC. Add another --out network port to mavproxy, and connect to that port instead.

That sounds right, but we are not sure how to add another -out network

We tried using mavproxy.py --master=/dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00 --out=udp:
but we can’t get it working. Can you see what we are doing wrong?

Hi Fredrik,

You need to add the line in ~/mavproxy.param, like this:

--cmd="set heartbeat 0"
--out udpin:localhost:9000
--out udp:
--out udp:

Where --out udp: is my new line.

Hi Patrick
I have tried to search around for mavproxy.param, but I was not able to find it.

Do you use the mavproxy.py command to change it or how?


Hi fredrik,

You can see the file under /home/pi/mavproxy.param or via the companion website

Hi Patrick

We have been working with the informations you gave us, at got along with receiving data from the GPS system.

Right now we use LOCAL_POSITION_NED to get x and y.

The only problem is, when i try to run a controller to make a reference swift in x position and it gets close to the reference, the gps data suddenly jumps 2 meters forward, meaning it starts going the other direction.

Is there another way to call the data than using LOCAL_POSITION_NED? :slight_smile:


Your problem sounds like it is unrelated to pulling the local position data out of the telemetry stream. It sounds like the GPS system is not performing too well, or having some errors. Can you please elaborate more, and share your code and your test setup/location? Are you in a small tank?

It is a large Swimmingpool (12.5mx25m), but we found out it was not a jump, but simply a large delay (approx. 2 sec.)


Are you still experiencing this issue?

Yes, we are making a controller, which should be able to make the robot change position, fx. go 1 meter forward and settle there.

The problem is that the data the robot receive is 2 seconds behind, where it actual is, which means the robot keeps going forward, when the reference is met (I reality), because the robot still think it is behind the reference.

Is there an easy way to solve this problem, or is the only solution some kind of predictor (e.g. smith predictor or MPC) :slight_smile:

Besides that the GPS values seems quit good :+1:


Can you please demonstrate how you have determined there is a two second lag in the values? Where are you pulling the numbers from?