How can I get the GPS time from the pixhawk, on a “companion computer”

岁酱吖の 提交于 2019-12-24 16:31:09

问题


My project will have two "companion computers" on-board a quadcopter. One will speak to APMCopter autopilot running on a pixhawk, using dronekit python, and the other will communicate with it's peer over ethernet.

I'd like both computers to have closely synchronized time, and I'd like them both to be synchronized to the GPS time from the GPS connected to the pixhawk.

The documentation for mavlink indicates that there is a "system time" message which includes the GPS time in uSec. How do I obtain this data on the companion computer, using DroneKit?


回答1:


@vehicle.on_message('SYSTEM_TIME')
def listener(self, name, message):
    print message.time_unix_usec

ArduCopter will send the system time about 4 times per second. This method will run every time.



来源:https://stackoverflow.com/questions/34313892/how-can-i-get-the-gps-time-from-the-pixhawk-on-a-companion-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!