I’ve now completed my hardware upgrades to the ROV and am now working on the software side of things, mostly focused on incorporating the Ping into my system. Before I dive into the nitty gritty of the code, I want to make sure I’ve got the big picture implementation correct in my head.
I have multiple programs that need to access the Ping data as outlined below.
MavProxy - I’d like to send the data out to QGC to allow terrain following. I’ve done this in the past with my own DIY depth sounder/altimeter but due to other unrelated technical issues I never really got to play with it in the field and ensured it worked correctly. My understanding is that if QGC has a height value, it should turn Depth Hold mode to Terrain Hold. For my old system, I have a switch on my topside control station to stop sending height data to QGC so I can use Depth Hold Mode and then switch it to provide data to QGC and allow Terrain Follow mode. Again, never fully tested that this worked. (sort of hard to do in a pool or in the ocean on a gently sloping sandy bottom).
Data Logger - Located on a secondary raspberry pi on the same network. I need to grab the current distance value and log it to an XML file whenever I want to based on whatever my mission is. I used to grab this from MavProxy but in my configuration above, I wouldn’t be able to grab that data if I had the switch set to Depth Mode rather than Terrain Follow mode. That means I want to grab data straight from the ping program, rather than MavProxy.
PingViewer - I’d also like to have the option to run PingViewer on my topside computer while the other two are running.
With all of this in mind, my strategy was to create a script on the companion computer that connected to the Ping, grabbed the data and then served it up to my data logger, PingViewer, and sent it to QGC via Mavproxy. As I was poking around the companion software, I found the ping1d_mavlink_driver.py script. This looks like it is already sending the Ping Data to QGC via Mavlink but I can’t seem to find that data anywhere in QGC. The rangefinder field is blank. Is this script currently running? I don’t have PingViewer or anything else running. However, if I do launch PingViewer, it does work giving me a 1.97m height with 100% confidence (it is sitting on a 30" high desk pointing at the ground but I’m guessing that has to do with the speed of sound in air vs water calculations). Should I be able to see this value in QGC somewhere?
Is there an easy way to also access this data myself from my own software at the same time? Do I need to run my own instance of ping-proxy or is that already running and I just need to connect to it? I haven’t poked around in companion all that much so I’m not exactly sure what is already running. Thanks!
EDIT: I also realize that the Ping software is in Beta and I’m pushing it beyond where it is already supported. I understand I will probably have to write a lot of this implementation myself, I just am trying to grasp what is already in place! Thanks