Dronekit and and RC commands at the same time


I have a pixhawk 4 with its companion computer (Raspberry 3 +). I need to get the drone location and put in a code to do some stuff so:

  1. I would like to know if it is possible to connect my drone to a python script (the script will get the drone location only) and using rc command to guide my drone at the same time??

  2. My second question is if there is a way to get the drone location without starting a python script like: pi@raspberry: $ python simple_goto.py – connect /dev/ttyAM0 ?
    Because as I am connected to my pixhawk via Raspberry, the dev/ttyAM0 port is occupied by the command mavproxy.py --master=/dev/ttyAMA0 --baudrate 921600 --aircraft MyCopter

So I don’t know what option is better to get the drone location

Thank you for your help guys

1.yes take a look at the vehicle state example
2.No, you will need to use another serial port like telm 2


I encounter an issue with 2 serial ports using the same serial protocol with dronekit 2.9.2