Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

plt.pause(0) waits for ever: PoseGraph.plot_scan(pause=0) and Vehicle animation may hang

未关闭 适合新手
#876 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@huxiaoyi-ovo 已经在做这个了。

开始于 2026年10月25日。

  • #896 来自 @huxiaoyi-ovo —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
matplotlib, python

调研方向

阅读 mobile/PoseGraph.py 中的 PoseGraph.plot_scan 和 mobile/Vehicle.py 中的 _refresh_animation_frame;检查第 853 行和第 1841 行的调用处,以确定 dt 是否可能为零。比较 PlannerBase.animation_frame 中的处理方式,以及 #875 中 tests/test_step_dt.py 的超时测试方法。补充对零暂停值的测试,并确认受影响的调用会返回或抛出异常,而不会挂起。

由索引模型根据 Issue 内容生成。

描述

bug

plt.pause(0) does not return: Matplotlib treats a timeout of zero as "wait until the event loop is stopped", so it blocks for ever, with no message. PyPlot.step(0) and PyPlot2.step(0) did this and now raise ValueError (#875). Other places pass a caller's value straight to plt.pause:

  • PoseGraph.plot_scan(n, pause=0) (mobile/PoseGraph.py): plt.pause(pause) with no guard, pause is an argument and defaults to 1. Needs a guard, or a ValueError, as in #875.
  • Vehicle animation (mobile/Vehicle.py, _refresh_animation_frame(fig, dt, pause)): ends with plt.pause(dt); check whether dt can be zero from the callers (lines 853 and 1841) and guard it if so.

Not affected: PlannerBase.animation_frame already tests pause > 0, and the others pass a constant.

I believe the first two hang the same way but have not run them. A test should use a timeout so that a regression fails instead of hanging (see tests/test_step_dt.py in #875).

主要语言
C++
星标
3.6k
派生
645
平均合并
1 天 8 小时
30 天内合并 PR
145

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

petercorke/robotics-toolbox-python 的其他 Issue

查看 petercorke/robotics-toolbox-python 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。