擅长:python、mysql、java
<p>我相信我已经找到了最好的解决办法,我在上面张贴的问题。以下是我的想法:</p>
<ol>
<li><p>GPS模块需要足够的时间来定位卫星。没有办法加快这个过程(至少为了这个应用程序)。从我的实验来看,我使用的GPS模块在大约4-5秒内返回所有的GPS修正。在</p>
<p>为了回答我的第一个问题,确保在初始化AirStation对象时获得纬度和纵向坐标的最佳方法是在启动GpsPoller后等待几秒钟。</p></li>
<li><p>确保GpsPoller线程终止的最佳方法是通过设置self终止循环条件_gpsp.正在运行在父进程中为False,然后等待线程使用self与父线程重新连接_gpsp.join(). 在</p>
<p>这些操作可以放在<em>close()</em>方法中,该方法应该在station对象的生命周期结束时调用。</p></li>
</ol>