Fix division by zero in arm paths with repeated configurations - #402
Open
llm-learner wants to merge 2 commits into
Open
llm-learner wants to merge 2 commits into
llm-learner wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Repeated joint configurations give adjacent path points the same cumulative length. Both interpolation sites in
ArmConfigurationPathdivide by that zero-length span. The final-segment fallback can also select a duplicate segment when Reflexxes slightly overshoots, producing non-finite joint targets.This addresses the failure reported in #383. That earlier report already suggested guarding the division; this change covers both interpolation sites and fully stationary paths.
Change
Validation
tests.test_arms_and_configuration_pathsandtests.test_gripperspass in CoppeliaSim 4.1.place_cups, TRAIN episode 0, variation 1, held objectmug1. Each run independently resets and replays the same 14-action prefix. The restored state, requested release action and first native planned path match exactly. That 50-point path has total joint-space length about1.91e-6and repeated points, including a zero-length final segment.mug1The diagnostic guard stops the original run before NaN targets reach the simulator. The video uses real front/wrist renders with the stopped side frozen and non-real-time playback labelled. No policy inference is involved. This demonstrates the numerical fix, not completion of the whole cup-placement task (reward remains 0).
中文说明
路径中重复的关节配置会产生零长度片段,原版两处插值可能除零;Reflexxes 轻微越过终点时,末段兜底也可能命中零长度片段。本修改保护两处插值,并直接完成非空静止路径。对比视频中,原版产生 7 个 NaN 关节目标,松爪未执行;补丁版目标有限、松爪完成。这里只验证数值故障修复,不代表整个放杯任务成功。
Before / after video
Bilingual comparison / 中英双语对比(19.2 s)
pyrep_zero_length_before_after_zh_en.mp4
Download MP4 / 下载视频
The video is attached above, with a backup on a separate evidence branch. This PR contains only the code fix and regression tests.