Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand Down Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions visualize_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down