I am putting the final touches on my control software that automates a grid pattern survey for my ROV using the Waterlinked GPS system and a custom camera system that is attached to the BlueROV2. I’ve mostly got it working but wanted to seek a little bit of advice here about driving the ROV via pymavlink and discuss the differences between the MANUAL_CONTROL and RC_CHANNELS_OVERRIDE commands.
Here is my real use scenario. I place the ROV in the water, I drive it around a little bit and get it into position using QGC and an Xbox controller as normal. I then have my separate python program start and take over command and control of the ROV. I want QGC to stay open and running as I’m watching the video there and if I run into a problem, it is easiest to just hit disarm right there and then on the Xbox controller (though I will be adding a big STOP button for this in my other digital and physical control interfaces). Also, easier to manually drive the ROV with the controller if I run into a problem.
When I was testing my code with the ROV in the water this weekend, the navigation was super choppy. The ROV would surge forward then stop then surge then stop etc. I was using the RC_CHANNELS_OVERRIDE command to send forward/back commands and turning left/right. I’m now thinking that the choppiness wasn’t my code but a conflict with QGC and the Xbox controller that was plugged in. Could this be the case? Should I be using MANUAL_CONTROL commands instead? EDIT: If it matters, the ROV will be in Depth Hold mode or possibly in Stablize mode.
My navigation loop is pretty simple. I pull the current GPS point, calculate the required heading to the target GPS point, turn left/right to match the heading, and then drive forward. This loops until I reach the target GPS point. Really, what I want is to set the forward speed and then only send additional left/right adjustments to stay on heading until I reach the target point. Do I need to continue to send the forward command in that loop or once I send the forward command, will it continue to drive forward until I send a stop command? Looking at the MANUAL_CONTROL command, it looks like I will always have to send an x, y, z, and r value for each command while with RC_OVERRIDE I could have just sent the drive forward command and then waited. Am I understanding this correctly?
I’m going to install SITL now to see if I can test this without getting the ROV wet but am hoping to get it back in the water and do some testing again this weekend. Thanks for the guidance!