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!