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.
I noticed an edge case (probably rare, though I have seen it happen) where if a trajectory point has a zero time-from-start duration, JTC will sample it and output a command that can only ever get checked by goal tolerances but never state tolerances since it's considered to be the last point. I think goal tolerances (and goal_time) are mainly designed for accounting for slight timing error between hardware and commands at the end of a trajectory, but not for handling the first sampled point which can be very off the current joint position in this scenario and could potentially lead to unexpected motion. This PR fixes this by always checking the state tolerance of the first sampled point. I have created a test case that shows this as well.
Before the fix
After the fix