jt78
jt78

Reputation: 926

Python, DroneKit, Pixhawk and ArduPilot Mission Planner: how to send text messages via the built-in telemetry to a ground station

I am working on a student project involving a drone which runs on the Pixhawk platform but has a 'companion computer' in the form of a Raspberry Pi. The Pi runs its own Python software and uses DroneKit (and therefore MAVLink?) to communicate with the Pixhawk via USB - giving it commands, transferring data and so on. Additionally, we have a 'ground station' laptop running ArduPilot Mission Planner which can view and interact with the aircraft remotely and also view it's telemetry. I noticed a 'Messages' tab which essentially acts like a remote console, showing 'logged' messages from the Pixhawk - this is what the question is referring to.

For debugging and information purposes, I would like to be able to add to this from Python on the Pi. I assumed this would be easily achievable through DroneKit but it does not seem trivial - send_mavlink and message_factory looked hopeful but I have found nobody else trying to do this specifically.

How can I easily redirect my 'console messages' from Python to the ground station? I realise there are alternative methods but going through the Pixhawk's existing telemetry system seems a much better option.

Thanks

Upvotes: 0

Views: 1518

Answers (1)

Jose Benitez
Jose Benitez

Reputation: 163

One thing you can do is to create a bridge (proxy) between Pixhawk and GCS with your RPi, similar to this question.

Then in the middle of that you can send your own text messages with:

gcs_conn.mav.statustext_send(mavutil.mavlink.MAV_SEVERITY_INFO, "your message here")

Be careful not blocking too much the telemetry transmission, otherwise you could have intermittent connection to the drone from your GCS.

Upvotes: 0

Related Questions