Home        Store        Learn        Blog

Receiving Depth Info Without QGroundControl

Hello,

I am using components of the BlueROV2 to construct a custom AUV. While I am using ArduSub I would like to forward the depth information for use in controlling the vehicle. I created a custom script, based off of the “Receive data and filter by message type” example for pymavlink, found at https://www.ardusub.com/developers/pymavlink.html. The script listens for the “VFR_HUD”, as that contains the depth information in an easy to use format. If I run the script while a surface computer is connecting and running QGroundControl, everything works great, however, if I run the script without a surface computer running QGroundControl then the only two message types that I am able to receive are “HEARTBEAT” and “NAMED_VALUE_FLOAT”.

Is there a way that I can run my script and receive the depth information of the vehicle, without having a surface computer connected, and without the use of QGroundControl?

The script that I am trying to use is:

from pymavlink import mavutil
import time

def wait_conn():
    """
    Sends a ping to stabilish the UDP communication and awaits for a response
    """
    msg = None
    while not msg:
        master.mav.ping_send(
            int(time.time() * 1e6), # Unix time in microseconds
            0, # Ping number
            0, # Request ping of all systems
            0 # Request ping of all components
        )
        msg = master.recv_match()
        time.sleep(0.5)

master = mavutil.mavlink_connection('udpout:0.0.0.0:9000')
wait_conn()

while True:
    msg = master.recv_match()
    if not msg:
        continue
    if msg.get_type() == "VFR_HUD":
        # Do Stuff Here (Forward The Depth Information using LCM)

In order to show what was happening when I was not receiving the “VFR_HUD” message, I modified the while loop to be

while True:
    msg = master.recv_match()
    if not msg:
        continue
    if msg.get_type() == "VFR_HUD":
        # Do Stuff Here (Forward The Depth Information using LCM)
    else:
        print(mgs.to_dict())

And that is how I was able to see the message names of “HEARTBEAT” and “NAMED_VALUE_FLOAT”.

Any help is appreciated. Thank you!

Hi,

You can either set SR0_EXTRA2 to a value in Hz you want to receive this message (works only for VFR_HUD). Or you can request specific messages at a desired interval using the mavlink message REQUEST_MESSAGE_INTERVAL

Hi William,

I tried what you suggested, but it did not appear to help with my issue.
It appears that your response is geared towards modifying how frequently the pressure sensor reports data. However, I am unable to receive the VFR_HUD message, unless I first run QGroundControl on a computer attached to the tether. I would like to be able to receive the VFR_HUD message (among others) without running QGroundControl.

I’m uncertain if there is a file on the Raspberry Pi that QGroundControl is calling that I can simply run by myself on vehicle startup, or if there is something that I can add into my python script that will trigger those messages so that I can receive them?

Hi @KNorm,

Can you try the rest api ?

After preparing to try out the REST API by updating the companion version (I was on 0.0.17 which was too old for the API, and am now on 0.0.25), as well as ArduSub to the latest stable version (4.0.2 at the time of writing this) my script began working! It appears that I no longer need to run QGroundControl to get those messages to trigger, so while I’m still not sure what QGroundControl was triggering, it appears that it is no longer an issue with the updated companion and ArduSub software.

Thank you for your help in different things to try that did ultimately lead to a solution!

Side note: I did verify that I could access the REST API on a surface computer, but never ended up testing accessing it using only the RPi in the enclosure, as my problem was resolved.

1 Like

This topic was automatically closed after 6 days. New replies are no longer allowed.