From d9a388be45345e14f10a7e808d298edeb2912700 Mon Sep 17 00:00:00 2001 From: Paul Sardin Date: Mon, 19 Oct 2026 12:21:21 +0200 Subject: [PATCH] [exercise_10] Expect TOPPRA to keep the path without motion --- CHANGELOG.md | 1 + exercise_10/test_manipulation_timing.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d6783c..baefe77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +- [exercise_10] Expect TOPPRA to keep the path without motion - [tutorials] Fix two broken links - Add exercise 10 - ROS: example-robot-{data -> descriptions} - #200 diff --git a/exercise_10/test_manipulation_timing.py b/exercise_10/test_manipulation_timing.py index 92b98b8..4dff4ba 100644 --- a/exercise_10/test_manipulation_timing.py +++ b/exercise_10/test_manipulation_timing.py @@ -51,10 +51,13 @@ def test_stops_at_nested_boundaries_and_internal_interpolation_points(timing_pro timed = toppra.optimize(path) - assert timed.numberPaths() == 3 + # The path without motion is kept, as a grasp keeps its transition. + assert timed.numberPaths() == 4 + assert timed.pathAtRank(0).length() == 0.0 + np.testing.assert_allclose(timed.pathAtRank(0)(0.0)[0], q0, atol=1e-12) assert path.numberPaths() == 3 assert len(path.pathAtRank(2).pathAtRank(0).interpolationPoints()) == 3 - for rank, (start, end) in enumerate([(-0.2, 0.0), (0.0, 0.3), (0.3, 0.0)]): + for rank, (start, end) in enumerate([(-0.2, 0.0), (0.0, 0.3), (0.3, 0.0)], 1): leaf = timed.pathAtRank(rank) np.testing.assert_allclose(leaf(0.0)[0], [start], atol=1e-12) np.testing.assert_allclose(leaf(leaf.length())[0], [end], atol=1e-12)