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. 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):