Python Script for Machine Vision Control in Mission Planner

Hi!

Is it possible to write write a python script that I can upload to mission planner.
I want the script to take a picture, extract distance data from the picture, and then use it to guide the drone.

I have a basic script that uses mavutil from pymavlink right now but am having trouble connection it to the port of my telemetry radio. I was hoping instead to directly upload the script. Can I still use mavutil.mavlink commands if I upload a Script rather than send commands?

Can mission planner scripts use OpenCV?

Also, should I be able to get a heartbeat nessage by simply running mission planner and connecting it to the radio port my connection is set too?

Side note: I am using WSL2 and want to access the COM12 port in windows, is mavutil.mavlink_connection(‘/dev/tty12’, baud=57600) the correct way to do so?