Start coding bluerov

Hi i write this message to ask some advice;
I have a bluerov drone and i would under stand how to program (with c or python) in such way i can test some Path planning, computer vision, etc… programs, but i don’t under stand where i have to go to write the script and how to access to the data;
The Ideal thing would be that the Rov Is autonomus so It don’t Need the PC attached to work
Some One can give me some suggestion or, if the argument was already discuss, link me to the documentation/exaples?

Thx in advance

P.s. there Is some virtual simulator to test the program and how the Rov Will respond without directly test It on the real world?

1 Like

Hi @fusari !

I’m currently in the process of learning coding for ROV’s and AUV’s and can share with you what I have learned so far!

MAVLink is a protocol that you can use to send commands to the drone and collect some temeletry data from it. Check the documentation to learn more!

There’s a python library called pymavlink that is used to send these MAVLink commands to a GCS (ground control station) and then to the ROV. Learn more about it here.

There’s a simulation from BlueRobotics that you can download and connect it to a GCS like QGroundControl and run python codes to test the MAVLink commands. It’s called BlueSim, download it here.

I reccomend you to download QGroundControl and the simulator above, and watch these series of youtube videos to take your first steps: click here!

I’m a begginer but if you have any questions I’ll be glad to help with what I know.

Good luck to us both and have fun!

3 Likes

Ok thx for the advice and Sorry of i respond only now;
So to program using pyMavlink i have to go on the promp on the blueOS web appication right? And in that case the code Will not run on the rasbarry on the drone but in the PC where you are coding right?

And for the simulator you Say that It simulate the behaviour of the drone right? But i don’t under stand if i can simulate the enviroments (like currents and fisical obstacle or target) and of It Will ricreate the behaviour in a 3d mapp

1 Like

Hi @fusari ! My time to appologize for the delay haha

With the example that I gave you, you will run the code using your PC. The python code will set a TPC or UDP connection with the vehicle and command it. Check the step by step tutorial that I recommended.

The only thing different is that you will set a TPC connection instead of UDP if you use the simmulation.

Here’s my code that I created following the tutorial and testing it on the simulation. I used BlueSim, QGroundControl and VS Code to run the python code.

from pymavlink import mavutil

# Start a connection listening on a TCP port
the_connection = mavutil.mavlink_connection('tcp:127.0.0.1:5763')

# Wait for the first heartbeat
#   This sets the system and component ID of remote system for the link
the_connection.wait_heartbeat()
print("Heartbeat from system (system %u component %u)" % (the_connection.target_system, the_connection.target_component))
while 1:
    msg = the_connection.recv_match(blocking=True)

To be honest, I don’t know that either. I know that they have two available environments on the link that put up there for you, but I only tested the first one, a simple pool.

Concerning currents, I’m not sure how you could do that, but I’m pretty sure it’s possible to add obstacles using some programs. Try searching for ROS, Gazebo, Movelt, but I’m afraid I can’t help you with them.

Good luck!

2 Likes

Ok thx in case if i find something i Will write It here

1 Like