Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robot Perception — Algorithms & Simulation

MATLAB implementations of classic robot perception and planning algorithms

Final project: "Pinhole Camera Tracking and Path Planning Based on a Two-Wheeled Vehicle Differential Steering Model" — a pan-tilt pinhole camera model that tracks a target, combined with a differential-steering vehicle model for trajectory tracking and A* path planning in obstacle fields.

What's implemented

Pinhole pan-tilt camera model

A PT camera in 3D space is modeled with a pinhole projection: the image sensor (a × b), focal parameter λ, and pan/tilt angles (ψ, φ) define a field-of-view (FOV) quadrilateral on the ground plane. The FOV vertices are obtained by rotating the sensor corner vectors with the pan/tilt Euler rotation matrices and scaling them onto the target plane, and inpolygon decides whether a target is visible.

  • N1 — static camera, static target: FOV construction and visibility check
  • N2 — moving camera on a trajectory, visibility over time
  • N3 — camera with adjustable pan and/or tilt (interactive case selection), plus an inpolygon test harness
  • N4 — moving target with a state-space pan/tilt model
  • N5 — PID control of pan/tilt angles to keep a moving target inside the FOV
  • Two-camera detection — two PT cameras watching the same target

Vehicle model, tracking, and planning

  • two_wheel_vehiclemodel_tracking_twoloop.m — differential-steering kinematics for a two-wheeled vehicle (vₗ, vᵣ → center speed v_c and yaw rate w_c, discretized with sample time T), wrapped in a two-loop trajectory-tracking controller driven by the pinhole camera model
  • Astar_path_planning.m — A* heuristic search on a 20×20 grid with obstacles, producing a collision-free path for the vehicle to follow

Repository layout

File Description
Matlab Code/Astar_path_planning.m A* grid search with obstacles
Matlab Code/two_wheel_vehiclemodel_tracking_twoloop.m Differential steering + camera-based tracking (final project)
Matlab Code/Midterm_N1_Static.m Static camera FOV & target detection
Matlab Code/Midterm_N2_cammoving.m Moving camera
Matlab Code/Midterm_N3_cam_moving_case_selection.m Pan / tilt / pan-tilt adjustment cases
Matlab Code/Midterm_N3_detection_judge.m Detection decision with adjustable camera
Matlab Code/Midterm_N3_inpolygon_test.m Point-in-FOV polygon test
Matlab Code/Midterm_N4_target_moving_detection_judge.m Moving-target detection
Matlab Code/Midterm_N5_PID_target_moving_detection_judge.m PID pan/tilt tracking of a moving target
Matlab Code/Midterm_twocamera_detection.m Two-camera detection
Matlab Code/Pics/ Figures used in the report

Usage

Everything is plain MATLAB scripts — open the Matlab Code folder in MATLAB and run a file directly:

run('Matlab Code/Astar_path_planning.m')

The N3–N5 scripts prompt in the console for a case (1 = pan adjust, 2 = tilt adjust, 3 = pan & tilt adjust) and then animate the camera FOV and target in 3D.

License

Released under the Apache License 2.0.

About

"Pinhole Camera Tracking and Path Planning Based on a Two-Wheeled Vehicle Differential Steering Model" — a pan-tilt pinhole camera model that tracks a target, combined with a differential-steering vehicle model for trajectory tracking and A* path planning in obstacle fields.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages