Hi! I am starting a project where i will need to automatize a BlueROV2. For that i need to send basic controller commands via a script, for example up or down, and receive sensor information on the same script.
Can anyone tell me where is the best place to start? I am a bit lost in the ardusub/mavlink/qgroundcontrol documentation!
Thank you for your answer!
So the mavros package and pymavlink have the same roll right?
It will be something quite simple. We will only use the internal sensors (gyroscope, accelarometer and baromete) and we are planning to run the mission offline (no tether connected). So, the robot will need to be completely autonomous.
The mission itself will be only image capturing of the bottom of a square tank!!
pymavlink is a python implementation of the MAVLink protocol, actually it’s a submodule of the mavlink package.
mavros is a ROS-MAVLink abstraction package, it’ll provide /mavros/* topics for ROS development.
Mavros need the mavlink package (that comes with a specific version of pymavlink) to operate properly, if you need to change the mavlink or pymavlink version, in the both cases are possible.
It’s a nice project that you are working on, please feedback us with the news
Are you planning to create an orthomosaic of the surface ?
Thanks a lot for your input @patrickelectric!
Unfortunately no, it will be a rather simple project, as me and the rest of the team have a severe lack o time
I hope to give you news soon!
I am trying to install pymavlink on ubuntu through their installation README, but i get the following error when testing:
from pymavlink import mavlinkv10 as mavlink
Traceback (most recent call last):
File “”, line 1, in
from pymavlink import mavlinkv10 as mavlink
File “/home/gilp/anaconda3/envs/seai/lib/python2.7/site-packages/pymavlink/mavlinkv10.py”, line 10, in
from …generator.mavcrc import x25crc
Can you say exactly what are you doing and which step are you in the readme ?
If you want to test pymavlink, you can try this simple udp example, if you’re not running the SITL, please change the localhost to 192.168.2.1
SITL is a simulator right? No, i am not running it!
So, can i test without SITL or the BlueROV2 connected?
I completed the README (although not sure if i have done it correctly…) and in the installation i chose the developer option, right?
I will try the example you gave me later and give you some feedback
The best option if you want to start working with this kind of integration is with S.I.T.L (Software In The Loop), you can run ArduSub with it.
As far as I know, you’ll need something to communicate via mavlink with your code, like: BlueRov2, SITL, pixhawk and etc. SITL in the best option for development.
If you want to install pymavlink use pip: pip install pymavlink.
If you have any further question related to mavlink, check this link for FAQ, API documentation, messages and etc.
I will test the simple code you gave me today with the BlueROV and I will give you feedback later!
This is the main idea of what we want to do:
But there is still a lot of confusion on how to accomplish it…
Our main two doubts reside in these main points:
How to receive the sensor data in our python program, running in the Odroid? This program will calculate our robot current location using this sensor data received.
How to send (with the same python program) the location to Qgroundcontrol, that will use the already implemented auto-mode to follow the waypoints defined by a user?
The Odroid will be added in a different cylinder and will act as our computer (having ubuntu installed), running Qgroundcontrol and being connected to the ROV by the tether.
Sorry for the persistence…
EDIT: I’ve run your test code and I think pymavlink is correctly installed. Using SITL, this is what I’ve got:
How to receive the sensor data in our python program, running in the Odroid? This program will calculate our robot current location using this sensor data received.
With pymavlink, you can use my example as a prove of concept.
You can get more information about pymavlink api here.
How to send (with the same python program) the location to Qgroundcontrol, that will use the already implemented auto-mode to follow the waypoints defined by a user?
Probably the best idea is to use odroid as a man-in-the-middle, you can pass the data to odroid and than odroid can deal with QGC doing what you want.
EDIT: I’ve run your test code and I think pymavlink is correctly installed. Using SITL, this is what I’ve got:
Waiting for APM heartbeat
Heartbeat from APM (system 1 component 1)
HEARTBEAT {type : 1, autopilot : 3, base_mode : 81, custom_mode : 0, system_status : 3, mavlink_version : 3}
Maybe my scheme is not clear enough… I intend to run QGroundControl and also the python program (that calculates the location) in the Odroid XU4.
The main problem here is how to send a spoof GPS location to the QGroundControl, so that the ROV can enter “auto” mode and follow the waypoints defined by the user.
@patrickelectric@jwalser If I send fake GPS positions to Ardusub with the commands you gave me (e.g. SET_POSITION_TARGET_INT) will this allow me to use position enabled modes?
Effectively, yes. ArduSub doesn’t assume that the information is coming from a GPS antenna, but it accepts it as an alternative. You will still need a ‘positioning system’, not necessarily a GPS antenna.