Programming my ROV a step further

Hello everyone,
I want to understand ardusub programming but I really don’t know we’re to start. I don’t know the programming language involve. On this forum I also see things like mavlink / pyvmalink and there is the raspberry companion. This is all new to me and I am lost. I followed the documentation and was able to gain control on my new ROV. I can move the camera with my controller, see the image or start and stop the motors and calibrated the compass etc. The raspberry and the pixhawk are configured and qgc work but I want to understand how this is really working to eventually modify it.
Can someone be so kind to summarize what programming languages is involve here and how it is link between the different components?

I don’t start from total scratch. I have good experience with Arduino/esp and other data logger but none with raspberry or “communication” protocols like mavlink. I want to invest time into this but I want to do it with the good programming language.

Thanks

I dig into this today. Is this correct to say that the companion computer run raspbian OS and that ardusub is in fact a software that run on the raspberry OS?
This would also mean that in theory I could install other software on the OS to do thing while ardusub is running?
Is this one of the common approach to implement new thing on a ROV? I am thinking about water quality sensors here.

Ardusub run on Pixhawk
Basic schematic: Required Software · GitBook
You can do other software on the companion computer (Raspian)

Ok I understood that. I guess my question is more what are the ardusub folder and files that are on the raspberry Pi image. Together with ardusub folder there is also files with title like pymavlink, mavlink, gps.py. Is this some sort of info relay between qgc and the pixhawk(ardusub)?

Hi @Charles ,

The best place to start is probably our Pymavlink Section of ArduSub docs. MAVLink is the communication protocol used by Ardusub, and pymavlink is a python implementation of it. Most things should be doable using it. More advanced features may require firmware modification.

The only component in Companion relevant to automating the ROV is probably MAVProxy, which bridges everything together and is where you would create a new endpoint for your script. The rest of the files are drivers for different systems and tools for Companion to orchestrate everything.

Thank you for the clarification.
I guess I have to learn Python now!

Charles

I’m interested in how you’ve gone about understanding this. Do you think the existing documentation and diagrams are sufficient in explaining how the software and hardware fit together and interface together with the different protocols, or would it be helpful to have some more diagrams and/or a blog post explaining things in a bit more depth?

If you think more documentation would be useful, is there anything in particular you’re finding difficult to wrap your head around, or some component that seems to be missing an explanation?

@EliotBR , well first thing is English is not my native language. It’s hard to be clear on forums. I often have to say or ask simple thing with way to much words…
That being said, the pymavlink link suggested by @williangalvani show bunch of code and it is in python (at least it look like it). If I want to customized my ROV, and that is my goal, I will have to understand how it work from the inside.
My final goal is to merge my descent skill on water sensor integration and gps to my close to zero knowledge on ROV. I aim for a arduboat-ardusub hybrid design.

To answer your last question. I will have to read and digest the material from @williangalvani post before concluding anything. I am sure there is a lot of usefull stuff there!

Thanks for the response :slight_smile:

Pymavlink is a Python interface to working with the mavlink protocol, so the code in those examples is indeed Python.

The Bluerobotics ROV system is designed to be modular, in both software and hardware, so while it’s true that modifications/customisations require some understanding of the inner workings, you’ll find that many modifications can be done without needing to know how all the parts work :slight_smile:

As an example, all the bluerobotics accessories (thruster ESCs, lights, gripper, etc) are controlled with a PWM signal with a pulse-width of 1100 to 1900 microseconds. That consistent interface means that if you have an actuator or light which can be controlled with that signal you can easily plug it into the pixhawk (assuming you have a port available) and connect to it/control it through QGroundControl (QGC) by adding an extra ‘servo’ control. For that kind of addition you only need to know the electrical requirements of your device, and one feature of QGC, which means it doesn’t require any knowledge of ArduSub or mavlink, or the companion software.

Bluerobotics provides some information about a suitable underwater GPS, and they have some extra information on how to connect one to ardusub.

Adding custom sensors is a bit more complicated, and may require working with pymavlink and possibly modifying QGC, but it depends quite a bit on how you want to view, use, and/or record your sensor results.

Definitely a good place to start! This forum is great for getting help with any components you don’t understand or are struggling to get working. As mentioned earlier, if there’s anything you find that seems missing from the documentation, I’d be interested in what you’re trying to achieve and how the documentation could be improved to better support that :slight_smile:

Also, keep in mind that although most people think “How do i do (X) in QGC?”…

From a hardware standpoint, you have a topside computer connected via ethernet to a Raspberry Pi in the ROV. If you want to add extra lights, servos, cameras, etc…you don’t necessarily have to modify BlueRobotics code to do it. You can ignore the Pixhawk and just use the Pi to control an Arduino (that has more analog outputs) to control lights and servos separately.

To get extra camera views, you could install a 4-port ethernet switch in the ROV, plug in the Pi (that controls the Pixhawk that ‘flies’ the ROV), but then also plug in the board from a stripped-down 8-camera security-system DVR. This will allow you to send the video from 8 medium-resolution FPV cameras up the tether to a topside computer, completely separate from the QGC/ Pixhawk interface.