From 46faf4ceac3191c8bf650ba3926676bc4b167cbc Mon Sep 17 00:00:00 2001 From: kajko25 <112957382+Kajko25@users.noreply.github.com> Date: Mon, 27 Jul 2026 22:51:42 +0200 Subject: [PATCH 1/2] fix roboticstoolbox optionality claim for visualize_trajectory.py --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 99be44e..dcb9350 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,8 @@ pip install numpy scipy matplotlib pip install roboticstoolbox-python ``` -> If `roboticstoolbox` is not installed, all tools still work; they will automatically fall back to **joint‑space visualizations only**. +> If `roboticstoolbox` is not installed, `smooth_resampled_traj.py` and the metrics tools still work — they automatically fall back to **joint‑space visualizations only**. +> `visualize_trajectory.py` plots end‑effector space exclusively and therefore requires it. --- @@ -415,7 +416,7 @@ python extra_json.py \ A standalone script for **visualizing original vs smoothed trajectories** in 3D end‑effector space: - Loads two JSON trajectories (e.g. `trajectory.json` and `trajectory_smoothed.json`). -- Uses `roboticstoolbox` Panda DH model for FK. +- Uses `roboticstoolbox` Panda DH model for FK. **Required** — this script has no joint‑space fallback. - Renders: - Original trajectory: red dashed line + points. - Smoothed trajectory: color‑mapped line and points by time. From b8773f77f5c66a19e4fb792c9f6b8c6cec26cc12 Mon Sep 17 00:00:00 2001 From: kajko25 <112957382+Kajko25@users.noreply.github.com> Date: Mon, 27 Jul 2026 22:51:44 +0200 Subject: [PATCH 2/2] fix roboticstoolbox optionality claim for visualize_trajectory.py --- visualize_trajectory.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/visualize_trajectory.py b/visualize_trajectory.py index d86d944..b8ffb85 100644 --- a/visualize_trajectory.py +++ b/visualize_trajectory.py @@ -41,8 +41,7 @@ def load_trajectory_data(file_path): def compute_fk(q_matrix): """计算正运动学 (DH 模型)""" - try: panda = rtb.models.DH.Panda() - except: panda = rtb.models.DH.Panda() + panda = rtb.models.DH.Panda() return panda.fkine(q_matrix).t def visualize_complete_comparison(orig_pos, smooth_pos, time_array):