SS

Robotics Notes

Robotics (INF-2600)

Introduction to AI in Robotics

  • Robotics Definition: A multidisciplinary field combining mechanical engineering, electronics, computer science, and AI to create autonomous systems. These systems are designed to perceive, decide, and act within the physical world.
  • Intelligence in Robotics: Robots exhibit intelligence when they can adapt, learn, and respond to sensory input rather than merely executing pre-programmed routines.

Embodied Intelligence

  • Embodied AI: This concept shifts from software agents to physical robots, emphasizing intelligence expressed through a physical body that learns via interaction with the real world.
  • Historical Context: Embodied AI's evolution can be traced from early robots like Shakey (1960s) to the advanced robots of Boston Dynamics.

Core Components of an AI Robot

  • Perception:
    • Involves using sensors such as cameras, LiDAR, IMU (Inertial Measurement Unit), and touch sensors.
    • AI enhances perception through object detection, localization, and SLAM (Simultaneous Localization and Mapping).
  • Reasoning and Decision Making:
    • Includes path planning and obstacle avoidance.
  • Learning in Robotics:
    • Utilizes Reinforcement Learning (RL), imitation learning, and Sim2Real techniques.

Introduction to Manipulator Kinematics

  • Inspired by Burton, York University

Robotic Manipulators

  • Definition: A robotic manipulator is a kinematic chain, which is an assembly of rigid bodies connected by joints that allow movement relative to each other through mechanical constraints.
    • Links: The rigid bodies in the manipulator.
    • Joints: The mechanical constraints that allow relative movement between links.

Joints

  • Types of Joints:
    1. Revolute (Rotary):
      • Functions like a hinge, allowing relative rotation about a fixed axis between two links.
      • By convention, the axis of rotation is the z-axis.
    2. Prismatic (Linear):
      • Functions like a piston, allowing relative translation along a fixed axis between two links.
      • By convention, the axis of translation is the z-axis.
  • Joint Convention: Joint i connects link i-1 to link i. When joint i is actuated, link i moves.

Joint Variables

  • Degrees of Freedom (DOF): Revolute and prismatic joints are one degree of freedom joints, described by a single numeric value called a joint variable.
  • Joint Variable Notation: q_i represents the joint variable for joint i.
    1. Revolute:
      • qi = \thetai: Angle of rotation of link i relative to link i-1.
    2. Prismatic:
      • qi = di: Displacement of link i relative to link i-1.

Revolute Joint Variable

  • For a revolute joint, the joint variable qi is equal to the angle of rotation \thetai of link i relative to link i-1.

Prismatic Joint Variable

  • For a prismatic joint, the joint variable qi is equal to the displacement di of link i relative to link i-1.

Common Manipulator Arrangements

  • Most industrial manipulators have six or fewer joints.
    • The first three joints form the arm.
    • The remaining joints form the wrist.
  • Manipulators are often described using the joints of the arm:
    • R: Revolute joint
    • P: Prismatic joint

Articulated Manipulator

  • Configuration: RRR (all three joints are revolute).
  • Joint Axes:
    • z_0: Waist
    • z1: Shoulder (perpendicular to z0)
    • z2: Elbow (parallel to z1)

Spherical Manipulator

  • Configuration: RRP
  • Example: Stanford arm

SCARA Manipulator

  • Configuration: RRP (revolute-revolute-prismatic)
  • Full Name: Selective Compliant Articulated Robot for Assembly

Forward Kinematics

  • Problem: Given the joint variables and link dimensions, determine the position and orientation of the end effector.

Forward Kinematics - Process

  • Choose the base coordinate frame of the robot.
  • Express the position (x, y) in this frame.
  • Link 1 moves in a circle centered on the base frame origin:
    (a1 \cos \theta1 , a1 \sin \theta1)
  • Choose a coordinate frame with its origin located on joint 2, oriented the same as the base frame.
  • Link 2 moves in a circle centered on frame 1:
    (a2 \cos(\theta1 + \theta2), a2 \sin(\theta1 + \theta2))
  • Sum the coordinates because the base frame and frame 1 have the same orientation. The position of the end effector in the base frame is:
    (a1 \cos \theta1 + a2 \cos(\theta1 + \theta2), a1 \sin \theta1 + a2 \sin(\theta1 + \theta2))
  • Determine the orientation of frame 2 with respect to the base frame, expressing x2 and y2 in terms of x0 and y0.
    • x2 = (\cos(\theta1 + \theta2), \sin(\theta1 + \theta_2))
    • y2 = (-\sin(\theta1 + \theta2), \cos(\theta1 + \theta_2))

Inverse Kinematics

  • Problem: Given the position (and possibly the orientation) of the end effector and the link dimensions, determine the joint variables.
  • Challenge: Inverse kinematics is more complex than forward kinematics because there is often more than one possible solution.

Inverse Kinematics - Law of Cosines

  • Using the law of cosines:
    b^2 = a1^2 + a2^2 - 2 a1 a2 \cos(\pi - \theta_2) = x^2 + y^2
  • Therefore:
    \cos(\pi - \theta2) = \frac{a1^2 + a2^2 - x^2 - y^2}{2 a1 a_2}
  • And:
    \cos(\theta2) = \frac{x^2 + y^2 - a1^2 - a2^2}{2 a1 a_2}
  • Let C = \frac{x^2 + y^2 - a1^2 - a2^2}{2 a1 a2}, then \cos \theta_2 = C
  • Taking the inverse cosine gives only one of two possible solutions.
  • Using trigonometric identities to obtain both solutions:
    \sin^2 \theta + \cos^2 \theta = 1
    \tan \theta = \frac{\sin \theta}{\cos \theta}
    \theta = \tan^{-1} \frac{\pm \sqrt{1 - C^2}}{C}
  • Calculate c2 and s2:
    c2 = (xx + yy – a1a1 – a2a2) / (2a1a2)
    s
    2 = \sqrt{1 – c2*c2}
  • Solutions for \theta2: \theta{21} = \text{atan2}(s2, c2)
    \theta{22} = \text{atan2}(-s2, c_2)

Spatial Descriptions

Points and Vectors

  • Point: A location in space.
  • Vector: Magnitude (length) and direction between two points.

Coordinate Frames

  • Choosing a frame (a point and two perpendicular vectors of unit length) allows assignment of coordinates.

Dot Product

  • Definition: The dot product of two vectors u and v.
    u = \begin{bmatrix} u1 \ u2 \ \vdots \ un \end{bmatrix}, v = \begin{bmatrix} v1 \ v2 \ \vdots \ vn \end{bmatrix}
    u \cdot v = u1 v1 + u2 v2 + \dots + un vn = \sum{i=1}^{n} ui v_i = u^T v
    u \cdot v = ||u|| ||v|| \cos \theta

Translation

  • Suppose we are given o1 expressed in frame {0}: ^0o1 = \begin{bmatrix} 3 \ 0 \end{bmatrix}

Translation 1

  • The location of frame {1} expressed in frame {0}:
    ^0d1 = ^0o1 - ^0o_0 = \begin{bmatrix} 3 \ 0 \end{bmatrix} - \begin{bmatrix} 0 \ 0 \end{bmatrix} = \begin{bmatrix} 3 \ 0 \end{bmatrix}

Translation 2

  • p1 expressed in frame {0}. ^0p = ^0d1 + ^1p = \begin{bmatrix} 3 \ 0 \end{bmatrix} + \begin{bmatrix} 1 \ 1 \end{bmatrix} = \begin{bmatrix} 4 \ 1 \end{bmatrix}

Translation 3

  • q_0 expressed in frame {0}.
    ^0q = ^0p + ^0d = \begin{bmatrix} -1 \ 1 \end{bmatrix} + \begin{bmatrix} 3 \ 0 \end{bmatrix} = \begin{bmatrix} 2 \ 1 \end{bmatrix}

Rotation

  • Suppose that frame {1} is rotated relative to frame {0} by an angle \theta.

Rotation 1

  • The orientation of frame {1} expressed in {0}. The rotation matrix ^0R1 can be interpreted as the orientation of frame {j} expressed in frame {i}. ^0R1 = \begin{bmatrix} ^0x1 \cdot ^1x & ^0y1 \cdot ^1x \ ^0x1 \cdot ^1y & ^0y1 \cdot ^1y \end{bmatrix}

Rotation 2

  • p1 expressed in frame {0}. The rotation matrix ^0R1 can be interpreted as a coordinate transformation of a point from frame {j} to frame {i}.
    ^0p = ^0R_1 ^1p = \begin{bmatrix} \cos \theta & - \sin \theta \ \sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} 1 \ 1 \end{bmatrix}

Rotation 3

  • q_0 expressed in frame {0}.

    ^0q = ^0R_1 ^0p = \begin{bmatrix} \cos \theta & - \sin \theta \ \sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} -1 \ 1 \end{bmatrix}

Properties of Rotation Matrices

  • R^T = R^{-1}
  • The columns of R are mutually orthogonal.
  • Each column of R is a unit vector.
  • \det R = 1 (the determinant is equal to 1).

Rotations in 3D

  • Rotation matrix in 3D:

^0R1 = \begin{bmatrix} ^0x1 \cdot ^1x & ^0y1 \cdot ^1x & ^0z1 \cdot ^1x \ ^0x1 \cdot ^1y & ^0y1 \cdot ^1y & ^0z1 \cdot ^1y \ ^0x1 \cdot ^1z & ^0y1 \cdot ^1z & ^0z1 \cdot ^1z \end{bmatrix}

Reinforcement Learning for Control

  • RL Concepts: State, Action, Reward, Policy, Q-value.
  • Deep RL in Robotics: DDPG (Deep Deterministic Policy Gradient), PPO, SAC (Soft Actor-Critic).
  • Control Types: Model-based vs. Model-free control.
  • Case Studies: OpenAI Gym, MuJoCo, Robosuite.
  • Challenges: Sample inefficiency, safety, real-time learning.

Human-Robot Interaction and Explainable Robotics

  • Human-in-the-loop Systems: Robots that take feedback from humans (e.g., RLHF).
  • Emotion and Intention Recognition: Essential for social and assistive robots.
  • Explainability and Trust in Robotics: Important in healthcare, military, and collaborative settings.
  • Ethical Issues and Biases in Robotic Decisions: Bias in models, decision transparency, responsibility.

Applications and Case Studies

  • Healthcare Robots: Surgical, eldercare.
  • Industrial Automation: Robot arms, warehouses.
  • Autonomous Vehicles and Drones.
  • Humanoids and Social Robots: Pepper, Sophia.
  • Extreme Environments: Space, disaster zones.

Frontiers and Research Challenges

  • Sim2Real gap, continual learning, multi-agent collaboration
  • Embodied intelligence and developmental robotics
  • Open-ended learning and self-repairing robots
  • AI + Robotics + Neuroscience

DARPA Urban Challenge

  • Date: November 3, 2007
  • Objective: Complete a 96 km urban area course in 6 hours.
  • Challenge: Multiple robotic vehicles carry out missions simultaneously on the same course.
  • Basic Rules:
    • Use a stock vehicle.
    • Obey California driving laws.
    • Operate entirely autonomously.
    • Avoid collisions with objects typical of an urban environment.
    • Operate in parking lots.
  • DARPA supplied an environment map with information on lanes, lane markings, stop signs, parking lots, and special checkpoints.

Autonomous Car Driving Sensors

  • Surround View
  • Blind Spot Detection
  • Traffic Sign Recognition
  • Cross Traffic Alert
  • Emergency Braking
  • Adaptive Cruise Control
  • Pedestrian Detection
  • Park Assist
  • Collision Avoidance
  • Eye/Face Tracking
  • Rear Collision Warning
  • Lane Departure Warning
  • Long-Range Radar
  • LIDAR
  • Camera
  • Short/Med-Range Radar
  • Ultrasound

Junior - Autonomous Vehicle

  • Equipped with various sensors:
    • Velodyne laser
    • Riegl laser
    • Applanix INS
    • SICK LMS laser
    • IBEO laser
    • SICK LDLRS laser
    • BOSCH Radar