Home        Store        Docs        Blog

[Autonomous BlueROV2] MavLink/Ardusub help

(Gil Martins Pinheiro) #21

Sorry for the persistence, but does that mean that I can give the ROV an estimated position and that it will assume that as a positioning system?

(Patrick José Pereira) #22

@gilpinheiro, @jwalser is correct. If you want to make BlueRov2 completely autonomous using only the sensors that you said, it’ll be necessary to estimate and provide position information via GPS_INPUT.

(Gil Martins Pinheiro) #23


(Gil Martins Pinheiro) #24

One more question, we intend to connect our ROV to an external ODROID. Like this:

Untitled Diagram

I know Raspberry uses mavlink to send and receive data and commands from Ardusub…
But, in this case, can I use python commands or scripts, sent from an odroid to the raspberry, and those commands be applied to the Ardusub?

(Patrick José Pereira) #25

Yes, take a look in @jwalser comment about the software components, and you can use my example to test the pymavlink installation and connection.

(Gil Martins Pinheiro) #26

I am encountering a problem while trying to test using SITL, maybe you can help me.

I need to run the simulator an then run Mavproxy so that it connects to Qgroundcontrol. But by doing this I am not able to send commands using a python script, as it is impossible for me to connect.

The error I get is the following:
“Link timeout, no heartbeat in last 5 seconds”

EDIT: Sovled!

(Gil Martins Pinheiro) #27

@patrickelectric @jwalser, I already have the ROV velocity and attitude, but as I am using dronekit python (mainly used for land and air vehicles) I can’t find any command to get the Barometer sensor data.
Do you know any Mavlink command to get IMU data or even barometer data?

Thanks in advance!

(Patrick José Pereira) #28

Hi @gilpinheiro,
Take a look in RAW_IMU and SCALED_PRESSURE messages.
This website have all the necessary information about the mavlink protocol.

(Gil Martins Pinheiro) #29

Is there any easy workaround or any way to disable the “No IO thread heartbeat” warning? I don’t have access to the interior of the BlueROV2, so it won’t be easy to re-flash the RP3 SD card.

(Patrick José Pereira) #30

I’ll talk with @jwalser to make sure, but probably no.

Edit: Try this ardusub guide.

(Gil Martins Pinheiro) #31

Thanks for your answer!! :slight_smile:
Can you please just help on how to implement this: “LOG_BACKEND_TYPE parameter to None (0).”

(Jacob) #32

In QGC, Vehicle Settings (click the gear icon) -> Parameters.

(Gil Martins Pinheiro) #33

It doesn’t work. :frowning:

(Jacob) #34

Did you reboot?

(Gil Martins Pinheiro) #35

I don’t think so! I will have to try it again later, thank you :smiley:

(Antonio Cayulao) #36

I was reading and I would like do something similar.
I want start to run this script directly in the RPi from the BlueROV2, without lose the telemetry and video in QGC.
But when I do, the script remains frozen and only I see this result:

pi@raspberrypi:~ $ python test_auv.py
Waiting for APM heartbeat

The script to split the telemetry is for default:

# this starts mavproxy so that the serial link to the companion computer (on /dev/ttyACM0)
# is available to a companion computer and external GCSs via UDP. This broadcasts so that
# multiple IP addresses can receive the telemetry.

# For PixHawk or other connected via USB on Raspberry Pi
cd /home/pi
mavproxy.py --master=/dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00,115200
–cmd=“set heartbeat 0”
–out udpin:localhost:9000
–out udpbcast:

I try change in my code of ‘test mavlink messages’ with:
master = mavutil.mavlink_connection(‘udp:localhost:14550’)
master = mavutil.mavlink_connection(‘udp:’)
master = mavutil.mavlink_connection(‘udp:’)
master = mavutil.mavlink_connection(‘udp:localhost:9000’)

But, none works.
Can you help me please?
Thanks a lot!

Autonomous Bluerov2
(Jacob) #37

Hello, it looks like there is some misunderstanding.

master = mavutil.mavlink_connection(‘udp:localhost:14550’) << no one is sending any data here, so if we listen here, we won’t hear anything
master = mavutil.mavlink_connection(‘udp:’) << we are sending data here by default, but this is an IP for another system (the surface computer), so we can’t listen here because it is not our address
master = mavutil.mavlink_connection(‘udp:’) << no one is sending any data here, so if we listen here, we won’t hear anything
master = mavutil.mavlink_connection(‘udp:localhost:9000’) << no one is sending any data here, so if we listen here, we won’t hear anything

Your script is waiting for a mavlink heartbeat, but you are not listening in the right spot. The autopilot data comes through the serial port /dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00.

There is a problem though in that there is an application already running and talking to the autopilot on that port (there is a script ~/companion/.companion.rc to start MAVProxy at boot). If your program tries to talk on the same port at the same time, there will be conflicts.

The solution is to add an output port to mavproxy, and mavproxy will manage the communications between your program and the autopilot. Go to and change the line udpin:localhost:9000 to udpout:localhost:9000, then you can use localhost:9000 to connect with your program.

(Patrick José Pereira) #38

To get the video without losing the output in QGC, you will need to add a second output. Check the gstreamer settings and modify the line ! udpsink host= port=5600 to ! multiudpsink clients=,, where is the ip and port of the raspberry. After that, you’ll be able to run this script after changing the port from 5600 to 5601.

(Antonio Cayulao) #39

Oh thanks a lot!
Now I can read telemetry without problems! :slight_smile:

Now I was reading of the documentation API, because the next step for me is send command to the ROV, up/down/move to right, move servo 1 or 2 or 3, turn on lights.

Then, I did test use the function motors_armed_wait() and to see in QGroundControl if the change works or not, but when I do, again the script is wait for something.

I think, that I can use some command from Here but I can’t found a function like recv_match but with a name like send_match or something there.

Also, I would like know learn more about this use with pymavlink, examples, tutorials, etc…
You can help me again with this?


(jakkala kalvik) #40

Why don’t you just use mavros? you will be able to connect to the pi with the pi image br provides without making any changes and its a lot easier to control the rov with mavros. Mavros takes care of getting your telemetry.