πŸ€–
Robotics Handbook
HomeConnect
  • Welcome
    • Authors Note
  • Computer Aided Designs and Simulations
    • Computer Aided Design and Simulations
    • 3D Modelling CAD
      • SolidWorks
    • Simulations
    • PCB Design
  • ROS (Advanced)
    • ROS
    • ROS
      • Concepts and Packages
      • Manual and Quick Setup
    • Some Important packages
  • Hardware
    • Design Processes
      • Materials Selection
      • Build and Prototyping
      • 3D Printing and Machining
    • Fabrication Parts
  • Common Mechanisms
    • Wheels and Drives
    • Power Transmission
  • Career Paths & Research Opportunities
    • Career in Robotics
    • Job Roles In Robotics
    • Conferences and Journals
  • Companies Hiring for Robotics
  • Leading Institutes
  • Mathematical and Programming Foundations
    • Linear Algebra for Robotics
    • Calculus
  • Programming for Robotics
    • Common Languages
    • Algorithms
    • Digital Twin
  • Embedded Systems for Robotics
    • Embedded Systems
    • Microcontrollers
      • Microcontrollers (Advanced Theory)
      • Choosing a Microcontroller
    • Sensors and Actuators
      • Sensors for Robotics
      • Actuators for Robotics
    • Communication
      • Communication Protocols
    • RTOS
    • Power Systems
      • Battery Charging and Storage Best Practices
  • ML and Perception
    • ML and Perception
    • Reinforcement Learning
    • Cameras, Depth Sensors and LiDAR
    • Image Processing Basics (OpenCV)
    • Object Detection and Tracking
    • Example of a Vision Pipeline
  • Mobile Robotics
    • Mobile Robotics
    • SLAM and Navigation
    • Robot Kinematics and Dynamics
      • Some Kinematic Models
    • Trajectory Planning
    • AMR's and AGV's
    • MH633 : Mobile Robotics
      • Geometric Foundations
      • Kinematics
  • Frontiers and Emerging Fields
    • Frontiers and Emerging Fields
    • Humanoids
    • Autonomous Navigation
    • Bio-inspired and Soft Robotics
    • Space Robotics
    • Cobots
    • Edge Robotics
    • Medical Robotics
  • Drones, Rocketry and Aviation
    • Drones
      • Drone Anatomy
    • Rocketry
Powered by GitBook
On this page
  1. Mathematical and Programming Foundations

Linear Algebra for Robotics

Linear Algebra in Robotics and Computer Vision

Linear algebra provides the mathematical language for describing and solving geometry, motion, perception, and control problems in robotics and computer vision. This overview covers key concepts and applicationsβ€”from kinematic chains and dynamics to camera modeling, multi‐view geometry, state estimation, and feature extraction.


Vector Spaces and Linear Mappings

Vectors and Norms A vector v∈R encodes quantities like position or velocity. Its length is:

nv∈Rnv∈Rnn\mathbf{v} \in \mathbb{R}^nv∈Rnnv∈Rnv∈Rn

βˆ₯vβˆ₯=v⊀vβˆ₯vβˆ₯=v⊀vβˆ₯vβˆ₯=v⊀v​βˆ₯vβˆ₯=v⊀v\| \mathbf{v} \| = \sqrt{\mathbf{v}^\top \mathbf{v}}βˆ₯vβˆ₯=v⊀v​βˆ₯vβˆ₯=v⊀vβˆ₯vβˆ₯=v⊀v​βˆ₯vβˆ₯=v⊀v​

Projections are given by:

proju(v)=u⊀vu⊀uu\

proju(v)=u⊀vu⊀uu\text{proj}_{\mathbf{u}}(\mathbf{v}) = \frac{\mathbf{u}^\top \mathbf{v}}{\mathbf{u}^\top \mathbf{u}} \mathbf{u}proju​(v)=u⊀uu⊀v​u

proju​(v)=u⊀uu⊀v​uproju​(v)=u⊀uu⊀v​uproju​(v)=u⊀uu⊀v​u

Inner Products and Orthogonality The dot product

f(x)=xβˆ—e2piiΞΎxf(x) = x * e^{2 pi i \xi x}f(x)=xβˆ—e2piiΞΎx

measures similarity and defines angles via:

cos⁑θ=u⊀vβˆ₯uβˆ₯βˆ₯vβˆ₯cos⁑θ=u⊀vβˆ₯uβˆ₯βˆ₯vβˆ₯cosΞΈ=βˆ₯uβˆ₯βˆ₯vβˆ₯u⊀v​cos⁑θ=u⊀vβˆ₯uβˆ₯βˆ₯vβˆ₯\cos \theta = \frac{\mathbf{u}^\top \mathbf{v}}{\|\mathbf{u}\| \|\mathbf{v}\|}cosΞΈ=βˆ₯uβˆ₯βˆ₯vβˆ₯u⊀v​cos⁑θ=u⊀vβˆ₯uβˆ₯βˆ₯vβˆ₯cosΞΈ=βˆ₯uβˆ₯βˆ₯vβˆ₯u⊀v​cosΞΈ=βˆ₯uβˆ₯βˆ₯vβˆ₯u⊀v​

Orthonormal bases via Gram–Schmidt simplify coordinate transformations and least‐squares problems.


Matrices, Determinants, and Invertibility

Linear Transformations A matrix

A∈RmΓ—nΒ mapsΒ Rnβ†’Rm.A \in \mathbb{R}^{m \times n} \text{ maps } \mathbb{R}^n \rightarrow \mathbb{R}^m. A∈RmΓ—nΒ mapsΒ Rnβ†’Rm.

Composition is matrix multiplication:

f(x)=xβˆ—e2piiΞΎxf(x) = x * e^{2 pi i \xi x}f(x)=xβˆ—e2piiΞΎx

Determinant and Rank

A matrix is invertible if and only if its determinant is non-zero:

texCopycodedet⁑(A)β‰ 0β‡’AΒ isΒ invertibletexCopy code\det(A) \neq 0 \Rightarrow A \text{ is invertible}texCopycodedet(A)ξ€ =0β‡’AΒ isΒ invertible

Rank deficiency implies singularity β€” critical in kinematics when Jacobians lose rank.


Eigen Decomposition & Singular Value Decomposition

Eigenvalues and Eigenvectors To analyze modes and stability, solve:

Ax=Ξ»xA \mathbf{x} = \lambda \mathbf{x}Ax=Ξ»x

Singular Value Decomposition (SVD)

A=UΣV⊀A = U \Sigma V^\topA=UΣV⊀

Pseudoinverse

A+=VΣ+U⊀A^+ = V \Sigma^+ U^\topA+=VΣ+U⊀

Used to solve least-squares

Ax=bA \mathbf{x} = \mathbf{b}Ax=b

with minimum norm. In vision, used for decomposing the essential matrix.


Rigid-Body Transforms & Denavit–Hartenberg (DH) Convention

Rotation Matrices

R∈SO(3),R⊀R=I,det⁑(R)=1R \in SO(3),\quad R^\top R = I,\quad \det(R) = 1R∈SO(3),R⊀R=I,det(R)=1

Axis–angle and quaternion representations avoid gimbal lock.

Homogeneous Transformations

T=[Rt01],pworld=TplocalT = \begin{bmatrix} R & \mathbf{t} \\ 0 & 1 \end{bmatrix},\quad \mathbf{p}_{\text{world}} = T \mathbf{p}_{\text{local}}T=[R0​t1​],pworld​=Tplocal​

DH Parameters

(ΞΈ,d,a,Ξ±)(\theta, d, a, \alpha)(ΞΈ,d,a,Ξ±)

Used for systematic forward and inverse kinematic derivation.


Forward & Inverse Kinematics

Forward Kinematics Compute end-effector pose as the product of transforms:

T=T1T2β‹―TnT = T_1 T_2 \cdots T_nT=T1​T2​⋯Tn​

Inverse Kinematics Solve for joint variables:

T(q)=TdesiredT(\mathbf{q}) = T_{\text{desired}}T(q)=Tdesired​

Closed-form or iterative solutions via Newton–Raphson:

f(q)=0f(\mathbf{q}) = 0f(q)=0

Differential Kinematics: The Jacobian

Jacobian Matrix Relates joint velocities qΛ™\dot{\mathbf{q}}q˙​ to end-effector twist ΞΎ\boldsymbol{\xi}ΞΎ:

ΞΎ=[pΛ™Ο‰]\boldsymbol{\xi} = \begin{bmatrix} \dot{\mathbf{p}} \\ \boldsymbol{\omega} \end{bmatrix}ΞΎ=[p˙​ω​]
ΞΎ=J(q)qΛ™\boldsymbol{\xi} = J(\mathbf{q}) \dot{\mathbf{q}}ΞΎ=J(q)q˙​

Singularities occur when:

det⁑(J)=0\det(J) = 0det(J)=0

Inverse Differential Kinematics Use pseudoinverse:

qΛ™=J+ΞΎ\dot{\mathbf{q}} = J^+ \boldsymbol{\xi}q˙​=J+ΞΎ

Or apply damped least squares near singularities.


Dynamics & Control

Lagrange Formulation

M(q)qΒ¨+C(q,qΛ™)qΛ™+g(q)=Ο„M(\mathbf{q}) \ddot{\mathbf{q}} + C(\mathbf{q}, \dot{\mathbf{q}}) \dot{\mathbf{q}} + \mathbf{g}(\mathbf{q}) = \boldsymbol{\tau}M(q)q¨​+C(q,q˙​)q˙​+g(q)=Ο„

Where:

  • MMM: mass matrix

  • CCC: Coriolis matrix

  • g\mathbf{g}g: gravity vector

State-Space & LQR Solve Riccati equation for gain matrix:

A⊀P+PAβˆ’PBRβˆ’1B⊀P+Q=0A^\top P + P A - P B R^{-1} B^\top P + Q = 0A⊀P+PAβˆ’PBRβˆ’1B⊀P+Q=0

Camera Models & Projective Geometry

Pinhole Camera Model Maps 3D point X=[X,Y,Z,1]

⊀\mathbf{X} = [X, Y, Z, 1]^\topX=[X,Y,Z,1]⊀

to image point

x=[u,v,1]⊀\mathbf{x} = [u, v, 1]^\topx=[u,v,1]⊀

:

x∼K[R∣t]X\mathbf{x} \sim K [R \mid \mathbf{t}] \mathbf{X}x∼K[R∣t]X

Where:

K=[fxscx0fycy001]K = \begin{bmatrix} f_x & s & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{bmatrix}K=​fx​00​sfy​0​cx​cy​1​​

Homography For planar scenes:

xβ€²βˆΌHx,H∈R3Γ—3\mathbf{x}' \sim H \mathbf{x},\quad H \in \mathbb{R}^{3 \times 3}xβ€²βˆΌHx,H∈R3Γ—3

Multi-View Geometry & Stereo Vision

Epipolar Constraint Essential matrix:

E=[t]Γ—RE = [\mathbf{t}]_\times RE=[t]×​R

Satisfies:

xβ€²βŠ€Ex=0\mathbf{x}'^\top E \mathbf{x} = 0xβ€²βŠ€Ex=0

Use 8-point algorithm plus SVD to estimate.

Triangulation Solve for 3D point via least squares:

PiX=xiP_i \mathbf{X} = \mathbf{x}_iPi​X=xi​

Feature Extraction & Dimensionality Reduction

Convolution as Matrix Multiply Image filtering = Toeplitz matrix multiplication. Accelerated via FFT with complexity:

O(nlog⁑n)\mathcal{O}(n \log n)O(nlogn)

PCA & Eigenfaces Apply SVD to centered image matrix to extract eigenfaces for compression and recognition.


State Estimation: Kalman Filtering

Linear Kalman Filter

Prediction step:

x^k∣kβˆ’1=Ax^kβˆ’1∣kβˆ’1+Bukβˆ’1\hat{\mathbf{x}}_{k|k-1} = A \hat{\mathbf{x}}_{k-1|k-1} + B \mathbf{u}_{k-1}x^k∣kβˆ’1​=Ax^kβˆ’1∣kβˆ’1​+Bukβˆ’1​

Update step:

x^k∣k=x^k∣kβˆ’1+Kk(zkβˆ’Hx^k∣kβˆ’1)\hat{\mathbf{x}}_{k|k} = \hat{\mathbf{x}}_{k|k-1} + K_k \left( \mathbf{z}_k - H \hat{\mathbf{x}}_{k|k-1} \right)x^k∣k​=x^k∣kβˆ’1​+Kk​(zkβ€‹βˆ’Hx^k∣kβˆ’1​)

Where KkK_kKk​ is the Kalman gain computed from Riccati recursion.

Software Ecosystem

  • MATLAB/Simulink: Robotics Toolbox for kinematics, dynamics, vision.

  • Eigen (C++): Fast linear algebra.

  • NumPy/SciPy: Python matrix ops.

  • OpenCV: Camera models, calibration, stereo geometry.

  • ROS: tf, robot_state_publisher, filtering for runtime transforms and estimation.

PreviousLeading InstitutesNextCalculus

Last updated 2 days ago