Chapter 7
Image Based Control of Robotic Systems

Chapter introduced some of the fundamental joint space feedback control methods. Many variants of these control strategies have been derived in the literature. This chapter focuses on the derivation of feedback controllers that utilize measurements or observations collected from cameras or in the form of CCD imagery in the task space. The image based visual servo control problem is defined, and its stability and convergence are discussed. General methods to achieve asymptotic stability of task space controllers that utilize the computed torque control strategy are introduced. It is shown that camera and CCD imagery measurements can be employed in task space control formulations. Upon completion of this chapter the student should be able to:

  • Define the image plane coordinates and pixel coordinates associated with camera measurements of robotic system location and orientation.
  • Derive the interaction matrix relating the derivatives of image plane coordinates to the velocity of the origin of the camera frame and the angular velocity of the camera frame in the inertial frame.
  • State the image based visual servo control problem and discuss its stability.
  • Derive computed torque controllers in terms of task space coordinates.
  • Derive task space controllers for visual servo problems.

7.1 The Geometry of Camera Measurements

Modernrobotic control systems utilize a wide variety ofsensors to measure the configuration and motion of arobotic system during its operation. These sensors may includeaccelerometers,rate gyros,magnetometers,angle encoders, orglobal positioning system (GPS) sensors, to name a few. This section will discuss a basiccamera model that can be used to represent many of the cameras that are used in robotics for various control tasks. The simplest camera model that is applicable to many of the commercially available cameras is based on thepinhole camera orperspective projection camera.

Perspective pinhole camera, rear projected.

Figure7.1 Perspective pinhole camera, rear projected.

Perspective pinhole camera, coordinate calculation.

Figure 7.2 Perspective pinhole camera, coordinate calculation.

Perspective pinhole camera, front projected.

Figure 7.3 Perspective pinhole camera, front projected.

7.1.1 Perspective Projection and Pinhole Camera Models

As shown in Figure 7.1, when a classical pinhole camera creates an image of a point images , a ray is traced from the point images through the pinhole located at the origin of thecamera frame images onto thefocal plane. Thefocal length images is the distance from the origin of the camera frame to the focal plane. This chapter denotes the basis for the camera frameimages as images . By convention theline‐of‐sight of the camera is along the images axis. Thecamera coordinates images of afeature point images viewed from a camera are defined in terms of theposition vector images of the point images in the camera frameimages ,

equation

The coordinates images of theimage point in the focal plane are known as the thecanonical image plane coordinates,retinal coordinates, orcalibrated coordinates. As shown in Figure 7.1, the location of the the focal plane on the opposite side of the point images being viewed implies that the image in the focal plane is inverted. Figure 7.2 shows a full view of the images images plane in this case. The relationship between the camera coordinates images and the focal plane coordinates images can be derived by considering similar triangles in Figure 7.2. Knowing the focal length images between the focal plane and camera frame, the relationship is

(7.1) equation

It is common practice to replace the physically motivated geometry in Figure 7.1 with a mathematical model that places the focal plane between the origin of the camera frame and point images being viewed, as shown in Figure 7.3. While this arrangement is not physically realizable, it is used so that the image is not inverted in the focal plane. In this mathematical model, the negative signs in Equation (7.2) do not appear, and the relationship between the focal plane coordinates images and the camera coordinates images is simply images and images . These equations can be rewritten in terms of thehomogeneous coordinates of the image point in the focal plane and the camera frame coordinates as

(7.2) equation

Equation (7.2) relates the focal plane coordinatesimages to the camera coordinatesimages , but it is often desired to understand how the coordinates of the point images in the inertial 0 frame are related to the focal plane coordinates. The tools derived in Chapters and 3 can be used to obtain the desired expression. Recall that the homogeneous coordinates of the point with respect to the camera images frame are defined as images . These coordinates are related to the inertial frame 0 using thehomogeneous transform images ,

(7.3) equation

The final homogeneous transformation that relates the inertial frame 0 coordinates and the focal plane coordinates is achieved by combining Equations (7.2) and (7.3),

(7.4) equation

7.1.2 Pixel Coordinates and CCD Cameras

Most modern cameras are comprised of sensors that make measurements using charge coupled device, or CCD, arrays. Cameras based on CCD arrays return a two dimensional matrix of intensity values, in contrast to the mathematical abstraction used in the last section that considered the image as a continuously varying intensity over the focal plane. Thepixel coordinates are used to represent the locations of the entries in the CCD array of intensity values. The pixel coordinates are introduced in a two step process. First, because the individual pixel elements in the CCD array can have different dimensions in the horizontal and vertical directions, thescaled coordinates images are defined in terms of thefocal coordinates images via the simple diagonal matrix equation

(7.5) equation

where the parameters images are scale factors in the images and images directions, respectively.

In addition to scaling, it is also common that the pixels in a CCD array are numbered from left to right, starting at the upper left corner of the pixel array. We account for this offset and define the pixel coordinates by shifting the origin with respect to the scaled coordinates,

(7.6) equation

where images is the location of theprincipal point or the image of the line‐of‐sight of the camera in the CCD array. The process of scaling and translating to obtain the pixel coordinates in terms of the focal plane coordinates can be written by combining Equations (7.5) and (7.6) in terms of a single transformation

(7.7) equation

Before closing this section, several variants of the equations that relate the camera coordinates,inertial coordinates, focal plane coordinates, and pixel coordinates are derived. These equations introduce theintrinsic orcalibration parameter matrix. With Equation (7.7), Equation (7.4) can be used to relate the pixel coordinates and inertial coordinates of the image pointimages in

equation

Note that these equations have introduced another scalar parameter, images , that measures how pixels in the CCD array are sheared relative to the vertical and horizontal directions. Combining the focal length with the calibration constantsimages results in

equation

in which thecamera intrinsic parameter matrix orcalibration matrix may be defined as images ,

equation

By defining theprojection matrix

equation

that extracts the first three coordinates from any 4 images of homogeneous coordinates, a succinct rule that defines the pixel coordinates in terms of the camera coordinates is written as

equation

For completeness the relationships that use the intrinsic parameter matriximages to express the pixel coordinates in terms of the inertial coordinates are summarized,

equation
equation

7.1.3 The Interaction Matrix

This section derives theinteraction matrix orimage Jacobian matrix that plays a critical role in the development of control strategies that use camera measurements for feedback. The interaction matrix relates the derivatives of the focal plane coordinates to the velocity and angular velocity of the camera frame in theinertial frame.

The following theorem specifies an explicit representation of the interaction matriximages when the focal length is equal to 1.

Equation (7.9) shows that the matrix images is a images matrix for a single feature point. In general, Theorem 7.1 will be employed for several feature points. Suppose there are feature points images . Introduce the images vector images and the images vector images that are obtained by stacking the image plane coordinatesimages and by stacking the camera coordinatesimages for all the feature points images as

(7.14) equation

Thesystem interaction matrix is obtained by applying Theorem 7.1 for each feature pointimages ,

equation

or more concisely as,

(7.15) equation

When we stack these equations, we obtain the system interaction matriximages

(7.16) equation

or

(7.17) equation

Just as the system interaction matriximages is defined, an equation is also needed for the system of images feature points that is analogous to Equation (7.12). For images

equation

Stacking these equations for images results in

(7.18) equation

or more succinctly,

(7.19) equation

7.2 Image Based Visual Servo Control

With the construction of the matrices images and images in Equations (7.17) and (7.19) for a system that includes feature pointsimages that are fixed in the inertial 0 frame, it is straightforward to pose and solve a number of standard problems in the control of robotic systems using camera based measurements. This section will discuss one such control problem, theimage based visual servo (IBVS) control problem.

7.2.1 Control Synthesis and Closed Loop Equations

The IBVS control problem is a specific example of atracking control problem. First, the IBVS control problem will be defined to specify the goals of the strategy and the measurements that will be used for feedback control.

The derivation of the visual servo control strategy to solve the problem statement in Definition 7.2 is not difficult given the derivation of the matrices images and images . Since the tracking error should approach zero asymptotically, the control law can be defined so that the closed loop system has a tracking error that satisfies the equation

(7.23) equation

where images is some positive scalar. The solution of Equation (7.23) is given in terms of exponential function

equation

Consequently, if the closed loop tracking error satisfies Equation (7.23), it will approach zero at an exponential rate. The definition of the tracking error can be combined with Equation (7.23) to obtain

(7.24) equation

Ideally, Equation (7.24) would be uniquely solvable for the velocity images and angular velocity images . However, the system interaction matrix is not square in general since

equation

and it may be that images . Depending on the number of system feature points, the matrix equation

(7.25) equation

can be underdetermined, overdetermined or exactly determined. If the matrix images has fewer rows than columns, images , the system is said to beunderdetermined. If the matrix images has more rows than columns, images , the system is said to beoverdetermined. If the matrix images has equal numbers of rows and columns, images , the system is said to beexactly determined.

Even if the system is not exactly determined, it is possible to obtain an expression for the control input images by using thepseudo inverse

equation

When both sides of Equation (7.25) are multiplied by images , an expression for the control input vector is obtained as

(7.26) equation

Before proceeding to the discussion of the closed loop system and its stability, it is important to make several observations about the construction thus far.

  • The pseudo inverseimages is not a square matrix. It has dimension images .
  • The pseudo inverse expression
    equation
    only makes sense provided that the matrix images isinvertible. While the expression given for images assumes that images is invertible, the pseudo inverse always exists for any matrix. The form of the pseudo inverse for an arbitrary matrix can be expressed in terms of thesingular value decomposition of the matrix. While this topic is beyond the scope of this book, the interested reader is referred to [18] for a discussion.
  • The pseudo inverse is a nonlinear function of the image plane coordinates and the range of each the system feature points. That is,
    equation

    This implies that the expression in Equation (7.25) is a nonlinear equation.

  • The set of equations in (7.25) is not a closed set of ordinary differential equations. The left hand side of Equation (7.25) contains the derivatives of the tracking error images , while the right hand side of these same equations contains the image plane coordinates and rangesimages . To put this set of equations in the standard form for a system of ordinary differential equations, it must be rewritten as
    (7.27) equation
    for some set of state variablesimages .

The following theorem derives the set of coupled, nonlinear ordinary differential equations that characterizes the dynamics of the closed loop system associated with the feedback control law embodied in Equation (7.25).

7.2.2 Calculation of Initial Conditions

The actual simulation of the collection of nonlinear ordinary differential equations written in the form images , where the vector of state variablesimages is given by

equation

can use any of a number of standardnumerical integration methods for systems of ordinary differential equations. These numerical methods include the family of linear multistep methods. The linear multistep methods include many popular predictor corrector methods, such as the Adams–Bashforth–Moulton method. Another popular family of numerical integration methods include the self‐starting Runge–Kutta methods. The reader is referred to [2] for a discussion of these methods, as well as other popular alternatives.

To use such a numerical algorithm to obtain an approximate solution of these equations, it is necessary to specify theinitial condition

equation

To describe a general procedure to solve for the initial conditionimages , the initial and final orientation of the camera frame will need to be described. The basis for the initial camera frameimages will be denoted by images , and the basis for the final camera frameimages will be denoted by images . The position of a point images relative to the camera frame in its initial configuration is then

equation

and the position of the point images relative to the camera frame in its final configuration is

equation

The following steps can be used to calculate the initial condition images .

  1. Find the coordinates of the offsetimages between the origin of the final camera frame and the origin of the initial camera frame, and find the rotation matriximages that maps coordinates with respect to the final camera frame into coordinates with respect to theinitial camera frame. Create the homogeneous transformationimages that maps the homogeneous coordinates with respect to the final camera frame into the homogeneous coordinates with respect to the initial coordinate frame.
    (7.32) equation
  2. Calculate the camera coordinates with respect to the initial camera frame from the camera coordinates with respect to the final camera frame for each of the points images ,
    (7.33) equation

    This equation can also be written more compactly as

    (7.34) equation
  3. Use the camera coordinates with respect to the initial camera frame (images ) to calculate the initial focal plane coordinates for images
    (7.35) equation
  4. Use the initial focal plane coordinatesimages images to calculate the initial focal plane tracking error for each point images .
    (7.36) equation

Once these steps have been completed, the initial condition images is constructed by stacking the vectors images for images to form the vectors images ,

equation

and subsequently assembling

equation

7.3 Task Space Control

Chapter describes several techniques for deriving feedback controllers for fully actuated robotic systems. All of these control strategies are derived so that the generalized coordinates images and their derivatives images approach a desired trajectory as images , images and images . For setpoint controllers the desired trajectory is a constant trajectory for which images , while trajectory tracking controllers consider time varying desired trajectories. Since all of the formulations in this book have selected the generalized coordinates to be either joint angles or joint displacements, the techniques derived in Chapter are sometimes referred to as methods ofjoint space control. That is, the performance criteria or objective of the controllers discussed in Chapter is the minimization of an error expressed explicitly in terms of the joint degrees of freedom.

Frequently the goal or objective to be achieved via feedback control is naturally expressed in terms of variables associated with the problem at hand, but are not easily written in terms of the joint variables. For example, designing a controller that locates the tool or end effector at some position in the workspace. In this case suppose that the position images of the tip of the tool is given by the vector

equation

The control strategy should guarantee that images , images , images as images . However, the coordinates images are not the joint variables for the robotic manipulator, and the strategies discussed in Chapter are not directly applicable. In principle, it is usually possible to reformulate the equations of motion in terms of the task space variables, but this can be a tedious problem for a realistic robotic system. The set of variables images are an example of a collection of task space variables for the problem at hand. Fortunately, there are many techniques that can be used to derive task space controllers. One approach employs the task space Jacobian matrix and is summarized in the following theorem.

7.4 Task Space and Visual Control

The previous section discussed how the inner loop–outer loop architecture of the computed torque control strategy introduced in Section 6.6 of Chapter can be used to derive tracking or setpoint controllers in task space variables. This section will illustrate that this approach can be used to design controllers based on typical camera observations. The design of controllers based on task space coordinates associated with camera measurements yields stability and convergence results that are more realistic than those described in Section 7.3 of this chapter. Recall that Section 7.3 discusses the visual servo control problem where it is assumed that the input to the controller is the vector of velocities and angular velocities of the camera frame. The value of this input vector is selected so that

(7.40) equation

where images is the tracking error in the image plane of the feature points. However, the velocities and angular velocities of the camera frame are not the output of an actuator; they are response variables. Their values depend on the forces and moments delivered by the actuators. If the input torques and forces can be chosen such that the velocities and angular velocities satisfy Equation (7.40) exactly, then the discussion of stability and convergence in Section 7.3 applies. In practice, it is not possible to achieve the exact specification of the velocities and angular velocities in Equation (7.40).

7.5 Problems for Chapter 7

  1. Problem 7.1 Figure 7.49a depicts the configuration of a camera and a calibration pattern. Assume the the images axis of the camera is perpendicular to the plane of the calibration pattern and that it intersects the exact center of the calibration pattern. Further assume that the images and images axes of the camera are parallel to the images and images axes of the retinal plane. The image produced by this configuration is shown in Figure 7.49b. Given a focal length of 2.98 mm, an image resolution of 1080 images 1920 pixels, and a imaging sensor size of images mm, determine the calibration matrix that relates the pixel coordinates (images , images ) to retinal coordinates for this image.
    Camera calibration pattern configuration and generated image. (Left) Configuration. (Right) Generated image.
    Figure 7.49 Camera Calibration Pattern Configuration and Generated Image. (a) Configuration. (b) Generated image.
    Illustration of PUMA robot with attached camera.

    Figure 7.50 PUMA robot with attached camera.

  2. Problem 7.2 Suppose that a camera is mounted so that its camera frame is rigidly fixed to link 3 of the PUMA robot as shown in Figure 7.50. Assume that the location and orientation of the camera relative to the 3 frame of the PUMA robot is given by the constant homogeneous transformation images ,
    equation

    For the following two problems let the PUMA robot be configured with

    equation

    (a) Suppose that images is the rotation matrix in which the images frame is rotated by images about the images axis, and that

    equation

    Which points in the world are mapped to the point images in the canonical focal plane?

    (b) Suppose that images is the rotation matrix in which the images frame is rotated by images about the images axis, and that

    equation

    To what point images in the canonical image plane is the point images having inertial coordinates

    equation

    mapped?

  3. Problem 7.3 Suppose that a camera is mounted so that the camera frame is fixed rigidly to link 3 of the spherical wrist as shown in Figure 7.51.
    Illustration of spherical wrist with mounted camera

    Figure 7.51 Spherical wrist with mounted camera

    Suppose that the location and orientation of the camera relative to the 3 frame of the spherical wrist is given by the constant homogenous transformation images ,

    equation

    (a) Suppose that images is the rotation matrix parametrized by the 3‐2‐1 Euler angles that is used with images to map frame 0 into the images frame, where the yaw images , pitch images , and roll images are

    equation

    Suppose further that images m. Which points in the are mapped to the point images in the canonical retinal plane?

    (b) Suppose that images is the rotation matrix parametrized by the 3‐2‐1 Euler angles used to map frame 0 into the images frame, where the yaw images , pitch images and roll images are

    equation

    Suppose further that images . To what point images in the canonical retinal plane is the point images having inertial coordinates

    equation

    mapped?

  4. Problem 7.4 An ideal pinhole camera is mounted on the SCARA robot shown in Figure 7.52 so that the camera axes coincide with the 3 frame and the optical center is located at point images . Find the transformation that maps the inertial coordinates images of point images , images , to the canonical focal plane coordinates images . Find the transformation that maps the inertial coordinates of images to the pixel coordinates images .
    Illustration of SCARA robot with mounted camera.
    Figure 7.52 SCARA robot with mounted camera.
  5. Problem 7.5 An ideal pinhole camera is mounted on the cylindrical robot shown in Figure 7.53 so that the camera axes coincide with the 4 frame and the optical center is located at point images . Find the transformation that map the inertial coordinates images of the point images , images , to the canonical focal plane coordinates images . Find the transformation that maps the inertial coordinates of images to the pixel coordinates images .
    Illustration of cylindrical robot with mounted camera.
    Figure 7.53 Cylindrical robot with mounted camera.
  6. Problem 7.6 Derive a controller so that the point images on the cylindrical robot depicted in Figure 7.54 tracks the trajectory of the point images . The point images has coordinates images relative to the inertial frame 0, images . Base the controller on the task space computed torque control law studied in Theorem 7.3.
    Illustration of cylindrical robot and task space trajectory tracking.
    Figure 7.54 Cylindrical robot and task space trajectory tracking.
    Illustration of SCARA robot and task space trajectory tracking.

    Figure 7.55 SCARA robot and task space trajectory tracking.

  7. Problem 7.7 Derive a controller so that the point images on the SCARA robot depicted in Figure 7.55 tracks the trajectory of the point images . The point images has coordinates images relative to the inertial frame 0, images . Base the controller on the task space computed torque control law studied in Theorem 7.3.
  8. Problem 7.8 Suppose that the robot depicted in Figure 7.52 is equipped with a camera whose axes coincide with the 3 frame and laser ranging system. Let images denote the coordinates relative to the camera frame of the point images so that images . Assume the laser ranging system enables the measurement of the images coordinate of the point images . Derive a controller that will actuate the robot so that the canonical focal plane coordinates images of the point images approach the origin of the focal plane and the depth images approaches some fixed value images .
  9. Problem 7.9 Suppose that the robot depicted in Figure 7.53 is equipped with a camera whose axes coincide with the 4 frame and a laser ranging system. Let images denote the coordinates relative to the camera frame of point images , images . Assume the laser ranging system enables the measurement of the images coordinate of the point images . Derive a controller that will actuate the robot so that the canonical retinal plane coordinates images of point images approach the origin of the focal plane and images the depth images approaches some fixed value images .
  10. Problem 7.10 Show that the interaction matrix for focal lengthimages is given by
    equation