I am trying to connect to BlueROV2 using Python and pymavlink.
I installed Python 3.8 and the pymavlink package with pip command, everything went well.
def connect(self):
master = mavutil.mavlink_connection(self.url)
wait_conn(master)
# Get some information !
while True:
try:
print(master.recv_match().to_dict())
except:
pass
time.sleep(0.1)
can you inform which version of pymavlink do you have installed ?
You can see it in: pip search pymavlink
Also, please inform the output of the test installation step of our guide.
There is some problems with your script that does not reproduce the same error message.
I would recommend to check where are you running this script and move it to a folder where there is no other file besides this same script. From the error message that you are describing, it’s probably a file with the same name of the libraries.
As you can see from your previous test, the “test installation” works, so it’s probably a problem in your script/project folder.
It works by naming the script file other than with the same name as a library.
thank you,
Now I am trying to run the script at the same time as QGroundControl. If I saw correctly, you must define a new output port via the web interface of the companion. That’s it ?
The address --out udpbcast:192.168.2.255:14550 is by default in MAVProxy in companion interface.
So I run QGC, then my python script with the connection to the udpin address: 192.168.2.255: 14555
But I have an error message on the connection address
If I run the script alone, it works, I have the mavlink messages that appear.
But if I run QGC and then run the script in parallel, QGC works and commands the ROV, but the script does not display anything.
What have I forgotten?
Sorry if I was not clear, but check what the documentation from the example that I said:
# If you want to use QGroundControl in parallel with your python script,
# it's possible to add a new output port in http:192.168.2.2:2770/mavproxy as a new line.
# E.g: --out udpbcast:192.168.2.255:yourport
You need to add this line, where yourport is the port for your script, to have both running.
OK it works by defining a new connection in the MAVProxy options, with port 14551.
Now I have the mavlink messages that appear when I run my script.
I would like to recover the values of a certain number of parameters (motor gain level, light level, battery level, camera tilt)
For the camera tilt for example, in the message of type NAMED_VALUE_FLOT, there is indeed a CamTilt parameter, but it has the value of the camera tilt when launching the python script, and when I modify the tilt with the radiocommand via QGC, this value does not change.
How to recover the value of these parameters in real time?
This isn’t working for me. I added the line and used 14551 for the “yourport” number. I think the problem is it’s not updating MAVProxy. When I refresh the page the line i just added goes away. I tried rebooting after I add the line, but that also just deletes the line. I tried clicking “restart MAVProxy” button, but that just greys out both the bottom buttons and nothing actually happens. After 5 minutes or so of nothing happening, I refreshed the page and the line i added disappeared again.
@AWDRONE How did you add the port? I wrote the line, “–out udpbcast:192.168.2.255:14551” in the MAVProxy options box, but it won’t actually update MAVProxy. If I refresh the page, the line I added goes away. If I click “restart MAVProxy” at the bottom of the page, it just greys out the buttons and nothing actually happens. I even tried clicking the reboot button at the top of the page, but when it reboots, the line I just wrote also disappears. How do you actually add the port after typing in the line?