python - 绘制 GPS 坐标
问题描述
我的问题是将 gps 坐标实时绘制到空白画布上,并保持最新的绘图居中。目标是在拖拉机中使用 StrawberryPi 和监视器,以保持覆盖地面的视野。不需要地图,只需一张空白画布。我已经可以使用 GPSPoller 线程和 gpsd 显示实时经纬度数据。我对如何绘制点并保持它们居中感到困惑。
class GpsPoller(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
global gpsd #bring it in scope
gpsd = gps(mode=WATCH_ENABLE) #starting the stream of info
self.current_value = None
self.running = True #setting the thread running to true
def run(self):
global gpsd
while gpsp.running:
gpsd.next() #this will continue to loop and grab EACH set of gpsd info to clear the buffer
if __name__ == '__main__':
gpsp = GpsPoller() # create the thread
try:
gpsp.start() # start it up
while True:
os.system('clear')
print
print ' GPS reading'
print '----------------------------------------'
print 'latitude ' , gpsd.fix.latitude
print 'longitude ' , gpsd.fix.longitude
.......... etc
感谢您的反馈。我的问题是确定一种合适的技术,使我能够在“画布”上绘制点并将“画布”保持在最后一点的中心。跟踪将使我能够跟随地面上的路径并确保完全覆盖例如施肥,这在实践中实际上非常棘手。扩展宽度可能是 12 m,我可以用绘制点的大小来模拟。距离和覆盖面积也很容易计算。这是我发现很难知道从哪里开始的视觉指南。任何帮助,将不胜感激
我熟悉 Python 和 tkInter,如果我能找到合适的起点,我非常愿意自己学习
解决方案
推荐阅读
- javascript - 使用 useEffect 和 useState 在 React JS 中出现无限循环错误
- java - 如何使用android studio从4层父节点firebase获取子数据
- core-data - SwiftUI 中的@FetchRequest
- ffmpeg - 如何从 ffmpeg 流式传输到多个 udp 客户端?
- java - Java Math.sqrt 函数向下舍入为零
- go - 查找特定类型的所有函数
- transactions - 如果在插入 memtable 时发生崩溃,leveldb 是否仍能保持事务性?
- bert-language-model - 是否有类似的“datacollator”代码可以使用 pytorch 将屏蔽的 n-gram 应用于屏蔽的语言模型?
- scala - 如何转换 DF 以添加包含在另一列中的字符串列表的列
- reactjs - 如何在 next.js 中显示来自 websockets 的数据并做出反应?