RPP Unit 1 Notes
RPP Unit 1 Notes
2. Obstacle Representation:
• Occupancy Grids: Obstacles in the environment can be represented
  using occupancy grids, where each cell of the grid indicates whether it
  is occupied by an obstacle or not.
3. Collision Detection:
• Robots need to detect collisions with obstacles or other robots. This
  can involve geometric methods like bounding boxes or more complex
  collision detection algorithms based on mesh representations.
Aspects of motion planning in robot path
planning
• What is meant by bounding box?
• A bounding box is an imaginary rectangle that serves as a point of
  reference for object detection and creates a collision box for that
  object in projects on image processing.
Aspects of motion planning in robot path planning
4. Path Representation:
5. Search Algorithms:
• A Algorithm: A popular graph search algorithm that finds the shortest
  path between nodes while considering a heuristic to guide the search.
• Dijkstra's Algorithm: Finds the shortest path in a graph by iteratively
  exploring nodes from the start node.
• RRT (Rapidly-exploring Random Trees): A probabilistic algorithm that
  randomly samples the configuration space to build a tree of feasible
  paths.
Aspects of motion planning in robot path planning
6. Optimization Techniques:
• Optimal Control: Formulates the path planning problem as an
  optimization problem, considering robot dynamics and constraints to
  find the optimal trajectory.
• Quintic Polynomials: A polynomial of degree 5. Generates smooth
  trajectories using higher-order polynomials to ensure continuous
  velocity, acceleration, and jerk profiles.
Aspects of motion planning in robot path planning
7. Dynamic Environments:
• In dynamic environments, robot path planning needs to account for
  moving obstacles and adapt in real-time to avoid collisions.
Aspects of motion planning in robot path planning
1.Robot and Workspace: We imagine the robot as a single solid object (no
  separate parts moving around) in a space called the workspace. This workspace
  can be in 2D (like a flat surface) or 3D (like a three-dimensional space).
2.Obstacles: In this space, we have some fixed objects that don't move, and we
  call them obstacles. These obstacles can be any shape, like squares or polygons.
3.No Dynamic Stuff: We don't think about how the robot moves dynamically or
  how fast it moves. Instead, we focus on finding a path that keeps it away from
  obstacles.
4.No Touching: We also don't deal with situations where the robot and obstacles
  touch each other. We treat this as a purely geometric problem.
Basic Problem
• Now, the main problem is this:
• Problem: Imagine you have the robot in one place with a
  certain orientation (the way it's facing), and you want it to go to
  another place with a specific orientation, all without touching
  any obstacles. Can you find a path for the robot to follow from
  its starting position to its goal position without crashing into
  anything? If there's no such path, you need to tell us that it's
  impossible.
Basic Problem
• Imagine you have a rectangular robot, like a small book, and it needs
  to move through a room filled with furniture (obstacles) to get from
  one corner of the room to another. The challenge is to find a way for
  the robot to move from its starting position and orientation to its
  destination without bumping into any furniture.
• This basic motion planning problem might seem simple, but it's
  actually quite tricky. Even though we've simplified it a lot, it's still a
  tough problem. And in the real world, we can use the solutions to this
  basic problem to solve more complex robot navigation tasks, like
  guiding a robot through a cluttered room without collisions.
Basic motion planning problem
• Objective: The goal of the basic motion planning problem is to
  explore fundamental issues before dealing with more complex
  scenarios in robotics.
Basic motion planning problem
• Simplifications:
   • Single Robot: We consider only one robot in the workspace. There are no
     other moving objects.
   • No Dynamic Considerations: We don't worry about how the robot moves
     dynamically or its speed. We ignore any issues related to time.
   • Non-Contact Motions: We assume that the robot's movements do not involve
     physically touching or colliding with obstacles. This simplifies the problem.
   • Rigid Robot: We treat the robot as a single solid object where all its points are
     fixed relative to each other. This simplification makes the problem purely
     geometric.
   • Obstacle Constraints: The robot's movements are constrained only by the
     presence of obstacles in the workspace.
Basic motion planning problem
• Problem Definition:
Basic motion planning problem
• Problem Definition:
• We assume that we accurately know the geometry of both the robot
  A and the obstacles B1, B2, ..., Bq, as well as their positions in the
  workspace.
• There are no restrictions on how the robot can move; it is a free-flying
  object.
• The problem is to find a path T that specifies a continuous sequence
  of positions and orientations for the robot A. This path should allow
  the robot to move from an initial position and orientation to a goal
  position and orientation without colliding with any of the obstacles
  (Bi's). If no such path exists, we report failure.
    Basic motion planning problem
Illustration: basic motion planning problem. It shows how a rectangular robot (Figure a) and an L-shaped polygon
robot (Figure b) navigate through polygonal obstacles in a two-dimensional workspace.
Basic motion planning problem
• Complexity: While this basic problem may seem simple, it is
  actually quite challenging. It serves as the foundation for solving
  more complicated robotics problems. Solving it is also of
  practical importance, as it can be applied to real-world tasks
  such as mobile robot navigation.
Basic motion planning problem
Formal Statement: Some aspects of the problem, like the
concept of a "free-flying" object, may need further clarification.
One way to formalize this problem is through the configuration
space formulation, which involves creating a mathematical
representation of the robot and obstacles in a higher-dimensional
space.
Basic motion planning problem
In mathematical terms, the problem can be summarized as follows:
Given:
• A robot A with geometry and initial position and orientation.
• A set of fixed obstacles B1, B2, ..., Bq with known geometry and positions.
• A goal position and orientation for the robot A.
Find:
• A continuous path T in the configuration space that takes the robot from its
  initial configuration to its goal configuration while avoiding collisions with
  the obstacles.
• The configuration space formulation involves defining this configuration
  space and checking if a path exists within it. The details of this formulation
  can be quite complex and may require advanced mathematical techniques.
What is Configuration Space
• A key concept for motion planning is a configuration:
  – a complete specification of the position of every point in the system
• A simple example: a robot that translates but does not rotate in the
  plane:
 – what is a sufficient representation of its configuration?
• The space of all configurations is the configuration space or C-space.
Robot Motion Planning
J.-C. Latombe (1991):
Goals
 Collision-free trajectories
 Robot should reach the goal location
  as fast as possible
                                               42
 Problem Formulation
 The problem of motion planning can be stated as
  follows. Given:
     A   start pose of the robot
     A   desired goal pose
     A   geometric description of the robot
     A   geometric description of the world
                                                    43
Problem Formulation
                                                          45
Configuration Space
     Rigid-body robot example
                    Robot
                            Reference direction
                                  
                y
                               Reference point
q = (q1,q2,...,q10)
                                                  47
Configuration Space
 The configuration space (C-space) is the space of all
  possible configurations
 The topology of this space is usually not that of a
  Cartesian space
 The C-space is described as a topological manifold
                                                             48
Configuration Space
 Example: circular robot
                      50
Configuration Space
 Example: polygonal robot, translation only
           Work space         Configuration space
Reference point
 We further define
   : start configuration
   : goal configuration
                                         53
Configuration Space
Then, motion planning amounts to
 Finding a continuous path
with
                                   54
What is Configuration Space
• Configuration space (C-space), also known as the state space, is a
  fundamental concept in robotics used to represent all possible
  configurations a robot can take, considering all of its degrees of freedom. It
  is a mathematical abstraction that simplifies the representation of the
  robot's motion planning problem.
• In a more detailed explanation, configuration space formulation involves
  mapping the physical attributes of a robot, such as its joint angles or
  coordinates, to a high-dimensional space where each dimension
  corresponds to a particular degree of freedom (DOF) of the robot.
• The C-space includes all possible combinations of joint angles or
  coordinates that the robot can adopt.
What is Configuration Space
• Here's how the configuration space formulation works:
• Degrees of Freedom (DOF): A robot's DOF refers to the number of
  independent ways it can move. For example, a simple robot arm
  might have revolute joints, which can rotate, providing rotational DOF,
  while a mobile robot might have translational and rotational DOF.
• Configuration Variables: These are the values that describe the
  robot's configuration in terms of its DOF. For a simple 2D robot arm
  with two revolute joints, the configuration variables might be the
  angles of the two joints.
What is Configuration Space
• C-Space Dimensionality: The dimensionality of the C-space is equal to
  the number of configuration variables. So, for a robot with n DOF, the
  C-space would be n-dimensional.
• Obstacle Representation: In the configuration space, obstacles in the
  robot's environment are also represented. An obstacle can be
  represented as a region in the C-space where the robot should not
  move to avoid collisions.
What is Configuration Space
• Path Planning: Path planning in configuration space involves finding a
  continuous or discrete path through the C-space that connects the
  robot's initial configuration to its goal configuration while avoiding
  collisions with obstacles. The path can be represented as a sequence
  of configurations or a trajectory that the robot should follow.
• Mapping to Workspace: Once a path is planned in the C-space, it
  needs to be mapped back to the robot's physical workspace. This
  involves translating the configuration values back into real-world joint
  angles or coordinates that the robot can follow.
Configuration Space Formulation
• Notion of Configuration Space:
1. Basic Idea: Imagine you have a robot in a certain position and
orientation in a workspace. Now, instead of thinking about the whole
robot, we'll represent it as a single point in a special space, which we
call the robot's configuration space. This helps us simplify the problem
and make the rules for the robot's movements clearer.
   Configuration Space Formulation
Notion of Configuration Space:
2. Mathematical Description:
• The robot is in a space W, which can be 2D (like a flat surface) or 3D (like a
  three-dimensional space).
• The robot, denoted as A, is a compact object in W, meaning it's closed and
  bounded.
• There are obstacles, B1, B2, ..., Bq, also in space W.
• We use Cartesian frames FA (moving frame) and Fw (fixed frame) to describe
  the robot and the workspace, respectively.
• A configuration q of the robot A is a specific way of positioning and orienting
  it. It's like telling the robot where every part of itself is relative to a fixed
  reference frame.
• We represent q as (T, θ), where T describes the robot's position, and θ
  describes its orientation.
Configuration Space Formulation
Dimension of Configuration Space:
1. Parameter Representation: We can describe a configuration using a
   list of real numbers. For instance, we can describe the position T as
   a vector of coordinates and the orientation θ as a matrix of unit
   vectors.
2. Redundancy: However, this representation can be redundant
   because some values don't add new information. For example, in
   2D, two angles that differ by a multiple of 2π represent the same
   orientation.
   Configuration Space Formulation
Dimension of Configuration Space:
3. Dealing with Redundancy:
   • In 2D, we can restrict angle values to the [0, 2π) interval, using modular arithmetic
     to ensure uniqueness.
   • In 3D, the problem is a bit trickier, as there can be multiple valid representations
     of the same orientation.
  •We have a rigid object, which we call the robot, moving within a
  physical workspace.
  •The workspace is represented as an N-dimensional Euclidean space RN,
  where N can be 2 or 3, with a fixed Cartesian coordinate system (frame)
  Fw.
  •The robot, when in a reference position and orientation, is represented
  as a compact subset within RN.
  •The robot has a moving frame, FA, attached to it. Every point on the
  robot has fixed coordinates in this frame.
  •We assume that the robot doesn't have any symmetries and isn't just a
  single point.
Configuration Space Formulation
• Configuration Space (C):
• The configuration space of the robot, denoted as C, is
  defined as a space where we specify the position and
  orientation of the robot's moving frame (FA) with respect to
  the fixed frame (Fw).
• A configuration q in C tells us where the robot's frame FA is
  located and oriented within the workspace.
• We have a reference configuration, denoted as O, which is an
  arbitrary choice within C.
Configuration Space Formulation
Summary,
• The configuration space C represents all possible positions and
  orientations of the robot within the workspace.
• Each configuration q specifies where the robot's frame FA is
  located and oriented relative to the fixed frame Fw.
• These configurations can be thought of as rigid body
  transformations, and they form a non-commutative group with
  respect to composition.
Robotic Motion Planning:
 Configuration Space
What if the robot is not a point?
              Expand
             obstacle(s)
              Reduce
               robot
                              Configuration Space
• A key concept for motion planning is a configuration:
  – a complete specification of the position of every point in the system
• A simple example: a robot that translates but does not rotate in the
  plane:
L2
            y
   L1
                
                    x
                            Robot Manipulators
   What are this arm’s forward kinematics?
                        (x,y)
                                 Find (x,y) in terms of  and  ...
L2
                y
       L1
                    
                        x
   Keeping it “simple”
c = cos() , s = sin()
 c = cos() , s = sin()
c= cos() , s= sin()
                        Manipulator kinematics
                y
       L1
                    
                        x
   Keeping it “simple”
c = cos() , s = sin()
 c = cos() , s = sin()
c= cos() , s= sin()
                    Inverse Kinematics
Inverse kinematics -- finding joint angles from Cartesian coordinates
                                      via a geometric or algebraic approach...
            L2   (x,y)
    
        
  L1
            
                              = cos
                                     -1
        
                                                        1        2
                                                   2L1L2
  L1
            
                              = 180 - 
                                            L2 sin()
                              = sin-1                      +   tan-1(y/x)
                                            x2 + y2
 (1,0) = 1.3183, -1.06                                                  atan2(y,x)
 (-1,0) = 1.3183, 4.45
Some Other Examples of C-Space
• A rotating bar fixed at a point
    – what is its C-space?
    – what is its workspace
• A two-link manipulator
    –   what is its C-space?
    –   what is its workspace?
    –   Suppose there are joint limits, does this change the C-space?
    –   The workspace?
                   Configuration Space
                                             Where can we put        qB       ?
360
                        A                                             qA
                                       270
                                B
                                       180
                                         
                                      90
                                         0                  
                                                    45          90      135         180
An obstacle in the robot’s workspace                        Torus
                                              (wraps horizontally and vertically)
Obstacles in C-Space
    •   Let q denote a point in a configuration space Q
Qfree = Q \ ( QOi )
Free Space
Obstacles
                                      Robot
                      x,y
 Configuration Space:
 Accommodate Robot Size
Free Space
Obstacles
                                      Robot
                           x,y        (treat as point object)
Trace Boundary of
Workspace
   workspace             configuration
                            space
Polygonal robot translating & rotating in 2-
             D workspace
       workspace            configuration
                               space
        Any reference point
                  R
y
                  45 degrees
              x
                  Any reference point configuration
                                 R
y
                                 45 degrees
       P
               Any reference point configuration
                                 R
y
                                 45 degrees
       P
                    Minkowski
                    sum
• The Minkowski sum of two sets P and Q, denoted by PQ, is
  defined as
           P+Q = { p+q | p P, qQ }
                                                          q
• Similarly, the Minkowski difference is defined as
           P – Q = { p–q | pP, qQ }                 p
Minkowski sum of convex polygons
• The Minkowski sum of two convex polygons P and Q of m and n
  vertices respectively is a convex polygon P + Q of m + n vertices.
  – The vertices of P + Q are the “sums” of vertices of P and Q.
                   Observation
• If P is an obstacle in the workspace and M is a moving object. Then the C-
  space obstacle corresponding to P is P – M.
                        O
                     Star Algorithm: Polygonal Obstacles
e1
r1
     r3        r2                               e2
                            e4
                                      e3
                    e1
     r2                      r3
e4 e2
                    e3 r1
        Star Algorithm
                          e1
e4 e2
                          e3
          r1
          e1
r2 e4 e2
                    r3
          e3
        Configuration Space “Quiz”
                                             Where do we put                 ?
360
                        A                                            qA
                                       270
                                B
                                       180
                                         
                                      90
                                                  qB
                                         0                 
                                                   45          90      135         180
An obstacle in the robot’s workspace                       Torus
                                             (wraps horizontally and vertically)
         Configuration Space Obstacle
                                              How do we get from A to B ?
Reference configuration
                                        360
                                                                  qA
                              A         270
                                 B
                                        180
                                          
                                       90
                                                  qB
                                          0              
                                                   45        90   135       180
 An obstacle in the robot’s workspace
                                              The C-space representation
                                                  of this obstacle…
Two Link Path(path exists)
Two Link Path(not exist)
               Additional dimensions
What would the configuration space of a
rectangular robot (red) in this world look like?
Assume it can translate and rotate in the plane.
(The blue rectangle is an obstacle.)
                                 x
a 2d possibility
                   2d projection...
                                  x
A problem?
qinit
     qgoal
Requires one more d…
qinit
         qgoal
                           too conservative !
                               what instead?
When the robot is at one orientation
qinit
                                                0º
When the robot is at another orientation
qinit
                    qgoal      it depends...
               Additional dimensions
What would the configuration space of a
rectangular robot (red) in this world look like?
(The obstacle is blue.)
y 180º
90º
                                                             0º
                                                   this is twisted...
Polygonal robot translating & rotating in 2-
             D workspace
                       
                                               y
                                                   x
SE(2)
2D Rigid Object
       The Configuration Space (C-space)
  θ1     θ2   θ3
                             θ3
TOP                                    θ3
VIEW
                                           θ1
                       θ2
                                      θ2
θ1
       workspace            C-space
Moving a Piano
       Configuration Space (C-space)
      q0        q1
                              INIT:
                      q2      Q(0)
 qn
                 Q(t)
           q4    q3
                             GOAL:
        q0 (t)              Q(T)
                
Q(t)   ⁝  t  
       qn (t) 
Parameterizations of SO(2) (2D Rotations):
• Basic Idea:
• In 2D, we're dealing with rotations, like turning a robot
  around a fixed point in a flat plane.
• To represent these rotations, we need a way to describe
  angles.
• However, angles alone aren't perfect because multiple angles
  can represent the same rotation
• (e.g., 45 degrees and 405 degrees represent the same
  rotation).
Parameterizations of SO(2) (2D Rotations):
• Angle Parameterization:
• One simple way to represent rotations in SO(2) is by using a single
  angle (θ), which measures the rotation from a reference orientation.
• However, this representation has a problem: it's not one-to-one
  because multiple angles can represent the same rotation (angles
  differing by multiples of 360 degrees).
• To make this work as a chart, we need to restrict the angle θ to an
  open interval of length 2π (e.g., between 0 and 2π).
• We could use two such intervals, like [0, 2π) and [-π, π), to create an
  atlas. An atlas is a collection of charts covering all possible rotations.
Parameterizations of SO(2) (2D Rotations):
•   Stereographic Projection Parameterization:
•   Another way to represent rotations is through stereographic projection.
•   Imagine you have a unit circle except for one point (P) in 2D space.
•   You project this circle onto a line (L) tangent to the circle, and the origin of the
    line is at the point of tangency (O).
•   Now, imagine drawing a line from point P to the opposite side of the circle,
    intersecting the circle at Q and the line L at R.
•   The stereographic projection maps every point Q on the circle (except P) to a
    point R on the line L.
•   In regions not including P, this mapping is one-to-one and can define a chart.
•   You can create two stereographic charts using two different points (P) on the
    circle to cover all rotations in SO(2). These charts together form an atlas.
Parameterizations of SO(2) (2D Rotations):
• Stereographic Projection Parameterization:
Parameterizations of SO(2) (2D Rotations):
• Mathematical Explanation:
• In SO(2), we want to represent rotations using parameters.
• One parameterization uses a single angle (θ), but it's not one-to-one,
  so we restrict θ to an open interval (e.g., [0, 2π)) and use two such
  intervals to create an atlas.
• Another parameterization, called stereographic projection, maps
  points on a unit circle (except one point) to a line tangent to the
  circle. In regions not including the excluded point, this mapping is
  one-to-one and can be used to create charts. Two stereographic
  charts, created with two different excluded points, form an atlas.
Parameterizations of SO(2) (2D Rotations):
Quaternions:
• Quaternions are a mathematical tool used to represent orientations
  in a three-dimensional space.
• They consist of four parameters and are quite useful for various
  applications, including robotics and computer graphics.
Quaternions:
• Components of a Quaternion:
• A quaternion, denoted as X, has four parts: a scalar part (X₀) and a
  3D vector part (x).
• These parts are combined using addition, so X = X₀ + x.
• In some cases, 3D vectors can be treated as quaternions with a zero
  scalar part, and scalars can be treated as quaternions with a zero
  vector part.
Quaternions:
• Quaternion Multiplication:
• When you multiply two quaternions, P and Q, you get a new
  quaternion R.
• This multiplication involves both the scalar and vector parts:
   • R₀ = P₀ * Q₀ - (P ⋅ Q)
   • Rᵥ = P₀ * Q + Q₀ * P + (P × Q)
• Here, ⋅ represents the inner product, and × represents the cross
  product of vectors.
• This multiplication is linear, meaning it satisfies properties like
  distributivity and associativity.
Quaternions:
• Conjugate of a Quaternion:
• The conjugate of a quaternion X is denoted as X* and is defined as:
   • X* = X₀ - x
• The product of a quaternion X and its conjugate X* results in a non-
  negative scalar:
   • X * X* = |x|²
• The length of X in Euclidean space is the square root of this scalar:
  ||X|| = √(X * X*).
Quaternions:
• Unit Quaternions:
• A unit quaternion is a quaternion with a length of 1, meaning ||X|| = 1.
• Unit quaternions are commonly used to represent rotations in three-
  dimensional space.
• They can represent a rotation around a unit vector n by an angle θ
  with a specific formula:
   • X(θ) = (cos(θ/2), n * sin(θ/2))
• Here, n represents the unit vector along which the rotation occurs.
Quaternions:
• Mapping to Projective 3-Space:
• Unit quaternions are used to map to projective 3-space (p³), a
  topological space.
• In p³, antipodal points (opposite points on the unit sphere) are
  identified.
• This space is topologically equivalent to SO(3), the space of 3D
  rotations.
.
Quaternions:
• Constructing an Atlas of SO(3):
• Unit quaternions are used to create an atlas (a collection of charts)
  for representing SO(3), the space of 3D rotations.
• Each chart (Ui, ϕi) covers a portion of SO(3) and is defined based on
  the largest-magnitude component of the unit quaternion.
• These charts help represent rotations efficiently and are useful in
  various applications, especially in robotics and motion planning.
Quaternions:
• In summary, quaternions are a mathematical representation of
  orientations in 3D space, and unit quaternions are particularly
  valuable for representing rotations. They allow us to efficiently work
  with 3D rotations and are used extensively in fields like computer
  graphics and robotics.
          Topology?
Sphere? Torus?
2R manipulator
                        Configuration space
Why study the Topology
• How would you show that a circle and an ellipse are diffeomorphic (implies both
  are topologically S1)……yes
• S1 is locally diffeomorphic to 1
• The sphere is locally diffeomorphic to the plane (as is the torus)
• S1 is locally diffeomorphic to 1
• The sphere is locally diffeomorphic to the plane (as is the torus)
• S1 is locally diffeomorphic to 1
• The sphere is locally diffeomorphic to the plane (as is the torus)
   – think of this as a “coordinate system” for U (e.g. lines of latitude and longitude away form
      the poles).
   – The inverse map is a parameterization of the manifold
• Many manifolds require more than one chart to cover (e.g. the circle requires at least 2)
   – think of this as a “coordinate system” for U (e.g. lines of latitude and longitude away form
      the poles).
   – The inverse map is a parameterization of the manifold
• Many manifolds require more than one chart to cover (e.g. the circle requires at least 2)
       cos( - sin(
       sin(   cos(