Assert that change_ratio is in the expected range in TrajectoryGuidanceExtension.

This commit is contained in:
Ryan Dick
2024-09-20 20:34:49 +00:00
parent 16ca540ece
commit cd3a7bdb5e

View File

@@ -91,6 +91,9 @@ class TrajectoryGuidanceExtension:
x1=1.0, y1=self._change_ratio_at_t_1, x2=self._t_cutoff, y2=self._change_ratio_at_cutoff
)(t_prev)
# The change_ratio should be in the range [0, 1]. Assert that we didn't make any mistakes.
eps = 1e-5
assert 0.0 - eps <= change_ratio <= 1.0 + eps
return change_ratio
def step(