Skip to content

jerry102102102/ENPM662_final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ENPM662_final

This project contains code and outputs for the ENPM662 final, including DH forward kinematics derivations, numeric validation, and an IK camera-tracking simulation with visualizations.

Using uv

  1. Install uv (choose one)
brew install uv
# or
pipx install uv
  1. Create/sync the environment
uv sync
  1. Run
# Symbolic FK derivation + LaTeX output
uv run python src/q1_3.py

# DH vs geometric composition validation
uv run python src/q1_4.py

# IK camera-tracking simulation + plots
uv run python src/q1_sim.py

Project structure

  • src/q1_3.py: builds DH parameters with Sympy, computes A1~A6, T0_6, T0_EE, and prints LaTeX.
  • src/q1_4.py: computes FK via DH and via geometric composition, then validates them numerically.
  • src/q1_sim.py: IK solver, camera tracking path generation, error metrics, and visualization outputs.
  • outputs/fig_layout_actor_path.png: XY layout of actor and camera paths.
  • outputs/fig_joint_trajectories.png: joint trajectories for d0 and q2~q6 over time.
  • outputs/fig_camera_path_with_arrows.png: 3D camera path with optical axis arrows.

Implementation overview

1) DH Forward Kinematics (src/q1_3.py)

  • Use the standard DH form A = Rz(theta) * Tz(d) * Tx(a) * Rx(alpha).
  • Build A1~A6 from the given DH table.
  • Add the fixed camera offset T6_EE = Tx(Lc) * Ty(-hc) to obtain T0_EE.
  • Print all intermediate matrices and LaTeX strings for reporting.

2) DH vs Geometric Composition Validation (src/q1_4.py)

  • Multiply the DH chain to get T_dh.
  • Build T_geo from the equivalent geometric sequence of transforms.
  • Compare numeric test cases to confirm FK consistency and rotation orthonormality.

3) Camera-Tracking IK Simulation (src/q1_sim.py)

  • Generate the actor's staircase arc path, then derive desired camera positions and view directions along the path.
  • IK is solved in two stages:
    • Position IK: damped least-squares to reach the desired camera position.
    • Pointing IK: refine with optical-axis direction error.
  • Solve joints at each timestep, then wrap/unwrap angles for continuity.
  • Generate path and joint trajectory plots, and print summary error metrics.

About

final exam node

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages