简体   繁体   English

Python,DroneKit,Pixhawk和ArduPilot Mission Planner:如何通过内置遥测将文本消息发送到地面站

[英]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. 我正在研究一个学生项目,该项目涉及在Pixhawk平台上运行的无人机,但它具有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. Pi运行自己的Python软件,并使用DroneKit(因此使用MAVLink?)通过USB与Pixhawk进行通信-为其提供命令,传输数据等。 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. 此外,我们有一台运行ArduPilot Mission Planner的“地面站”笔记本电脑,它可以远程查看飞机并与之交互,还可以查看其遥测。 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. 我注意到“消息”选项卡在本质上类似于远程控制台,显示来自Pixhawk的“已记录”消息-这就是问题所在。

For debugging and information purposes, I would like to be able to add to this from Python on the Pi. 为了进行调试和提供信息,我希望能够在Pi上的Python中添加此功能。 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. 我认为这可以通过DroneKit轻松实现,但似乎并不简单-send_mavlink和message_factory看起来很有希望,但我发现没有其他人专门尝试这样做。

How can I easily redirect my 'console messages' from Python to the ground station? 如何轻松地将我的“控制台消息”从Python重定向到地面站? I realise there are alternative methods but going through the Pixhawk's existing telemetry system seems a much better option. 我意识到还有其他方法,但是通过Pixhawk现有的遥测系统似乎是一个更好的选择。

Thanks 谢谢

One thing you can do is to create a bridge (proxy) between Pixhawk and GCS with your RPi, similar to this question . 您可以做的一件事就是使用您的RPi在Pixhawk和GCS之间建立一个桥梁(代理),类似于此问题

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. 注意不要阻塞太多遥测传输,否则您可能会从GCS间歇性地连接到无人机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM