Description

Institutionen för systemteknik Department of Electrical Engineering Examensarbete Visual Servoing Based on Learned Inverse Kinematics Examensarbete utfört i Bildbehandling vid Tekniska högskolan i Linköping

Information

Category:
## Health & Fitness

Publish on:

Views: 40 | Pages: 58

Extension: PDF | Download: 0

Share

Transcript

Institutionen för systemteknik Department of Electrical Engineering Examensarbete Visual Servoing Based on Learned Inverse Kinematics Examensarbete utfört i Bildbehandling vid Tekniska högskolan i Linköping av Fredrik Larsson LITH-ISY-EX--07/3929--SE Linköping 2007 Department of Electrical Engineering Linköpings universitet SE Linköping, Sweden Linköpings tekniska högskola Linköpings universitet Linköping Visual Servoing Based on Learned Inverse Kinematics Examensarbete utfört i Bildbehandling vid Tekniska högskolan i Linköping av Fredrik Larsson LITH-ISY-EX--07/3929--SE Handledare: Examinator: Erik Jonsson isy, Linköpings universitet Michael Felsberg isy, Linköpings universitet Linköping, 12 March, 2007 Avdelning, Institution Division, Department Computer Vision Laboratory, Department of Electrical Engineering Linköpings universitet SE Linköping, Sweden Datum Date Språk Language Svenska/Swedish Engelska/English Rapporttyp Report category Licentiatavhandling Examensarbete C-uppsats D-uppsats Övrig rapport ISBN ISRN LITH-ISY-EX--07/3929--SE Serietitel och serienummer Title of series, numbering ISSN URL för elektronisk version Titel Title Visuell servoing baserat på inlärd invers kinematik Visual Servoing Based on Learned Inverse Kinematics Författare Author Fredrik Larsson Sammanfattning Abstract Initially an analytical closed-form inverse kinematics solution for a 5 DOF robotic arm was developed and implemented. This analytical solution proved not to meet the accuracy required for the shape sorting puzzle setup used in the COSPAL (COgnitiveSystems using Perception-Action Learning) project [2]. The correctness of the analytic model could be confirmed through a simulated ideal robot and the source of the problem was deemed to be nonlinearities introduced by weak servos unable to compensate for the effect of gravity. Instead of developing a new analytical model that took the effect of gravity into account, which would be erroneous when the characteristics of the robotic arm changed, e.g. when picking up a heavy object, a learning approach was selected. As learning method Locally Weighted Projection Regression (LWPR) [27] is used. It is an incremental supervised learning method and it is considered a state-ofthe-art method for function approximation in high dimensional spaces. LWPR is further combined with visual servoing. This allows for an improvement in accuracy by the use of visual feedback and the problems introduced by the weak servos can be solved. By combining the trained LWPR model with visual servoing, a high level of accuracy is reached, which is sufficient for the shape sorting puzzle setup used in COSPAL. Nyckelord Keywords Visual servoing,machine learning,lwpr Abstract Initially an analytical closed-form inverse kinematics solution for a 5 DOF robotic arm was developed and implemented. This analytical solution proved not to meet the accuracy required for the shape sorting puzzle setup used in the COSPAL (COgnitiveSystems using Perception-Action Learning) project [2]. The correctness of the analytic model could be confirmed through a simulated ideal robot and the source of the problem was deemed to be nonlinearities introduced by weak servos unable to compensate for the effect of gravity. Instead of developing a new analytical model that took the effect of gravity into account, which would be erroneous when the characteristics of the robotic arm changed, e.g. when picking up a heavy object, a learning approach was selected. As learning method Locally Weighted Projection Regression (LWPR) [27] is used. It is an incremental supervised learning method and it is considered a state-ofthe-art method for function approximation in high dimensional spaces. LWPR is further combined with visual servoing. This allows for an improvement in accuracy by the use of visual feedback and the problems introduced by the weak servos can be solved. By combining the trained LWPR model with visual servoing, a high level of accuracy is reached, which is sufficient for the shape sorting puzzle setup used in COSPAL. v Acknowledgments This thesis represents the final part of my Master of Science in Applied Physics and Electrical Engineering degree at Linköpings Universitet. This work has been carried out at the Computer Vision Laboratory at the Department of Electrical Engineering. I would like to thank all people working at the Computer Vision Laboratory. You have all in one way or another contributed to this thesis, with technical advice or by contributing to the friendly and inspiring atmosphere. I would especially like to thank my supervisor Erik Jonsson and my examiner Michael Felsberg. Erik for constantly answering my more or less thought through questions, even though I suspect I will never get to know how long a rope is. Michael for invaluable advice and for introducing me to the subject of machine learning and cognitive systems. This work has been supported by EC Grant IST COSPAL. This thesis does not represent the opinion of the European Community, and the European Community is not responsible for any use which may be made of its contents. Fredrik Larsson vii Contents 1 Introduction Thesis Overview Mathematical Notation Thesis Outline Robotics Robotic Arms Robotic Arm Kinematics Learning Machine Learning Why Learning? The Curse of Dimensionality Local Learning Linear Regression Projection Regression Principal Component Regression Partial Least-Squares Regression Locally Weighted Projection Regression Calculating the Activation Locally Weighted Incremental PLS Distance Metric Update Adding Receptive Fields Pruning Receptive Fields Computing the Output Visual Servoing Introduction Nomenclature The Visual Servoing Task Combining Visual Servoing and LWPR LWPR Output as a Linear Mapping The LWPR Jacobian Updating the Jacobian ix 6 Experiments Test Scenario Simulator Setup Results Discussion Real World Setup Results Discussion Conclusions Conclusions Future Work A Leave-One-Out Cross-Validation Without Retraining 43 A.1 The Sherman-Morrison-Woodbury Theorem A.2 Leave-One-Out Cross-Validation Without Retraining B Experimental Setup 45 B.1 Experimental Setup B.2 Data Acquisition B.2.1 Detection of 2D Positions B.2.2 Stereo Triangulation B.2.3 Maping Positions Into Robot Frame B.2.4 Estimating the Configuration of the End-Effector Bibliography 49 Chapter 1 Introduction 1.1 Thesis Overview The main goal of this master thesis project has been to correct for inaccuracies in a low cost robotic arm by a learning approach. By combining Locally Weighted Projection Regression (LWPR) [27] with visual servoing an acceptable level of accuracy as reached. Initially an analytical closed-form inverse kinematics solution for a 5 DOF robotic arm has been developed and implemented. This analytical solution proved not to meet the accuracy required for the shape sorting puzzle setup used in the COSPAL (COgnitiveSystems using Perception-Action Learning) project [2]. The shape sorting puzzle scenario consist of a number of puzzle pieces of different shapes and holes in corresponding shapes. The correctness of the analytic model could be confirmed through a simulated ideal robot and the source of the problem was deemed to be nonlinearities introduced by weak servos unable to compensate for the effect of gravity. Instead of developing a new analytic model that takes into account the effect of gravity, which would be erroneous when the characteristics of the robotic arm changed, e.g. when picking up a heavy object, a learning approach was selected. As learning method LWPR has been used. It is an incremental supervised learning method and it is considered a state-of-the-art method for function approximation in high dimensional spaces. LWPR was used to learn the inverse kinematics of the above mentioned robotic arm. The learned inverse kinematics was further combined with visual servoing. This allows for an improvement in accuracy by the use of visual feedback and the problems introduced by the weak servos can be solved. By combining the trained LWPR model with visual servoing, a high level of accuracy is reached, which is sufficient for the shape sorting puzzle setup used in COSPAL. 1 2 Introduction 1.2 Mathematical Notation Throughout this thesis, bold lower case letters x are used to denote vectors, bold upper case letters X denote matrices. All scalar values x,x are denoted by italic letters. 1.3 Thesis Outline Chapter 1: Introduction. Chapter 2: Short introduction to robotic arms. Chapter 3: Introduction to the basic ideas behind learning systems. A detailed description of two simple supervised learning methods is given as a preparation for Locally Weighted Projection Regression described in chapter 4. Chapter 4: The learning method Locally Weighted Projection Regression (LWPR) is presented. It is an incremental supervised learning method and it is considered a state-of-the-art method for function approximation in high dimensional spaces. Chapter 5: The concept of visual servoing is introduced. How LWPR can be used as a base for visual servoing is described. Chapter 6: Experimental setup and obtained results. LWPR has been used to learn the inverse kinematics and visual servoing has been used to further increase the accuracy. Chapter 7: Discussion and conclusions. Some suggestions of further work are presented. Chapter 2 Robotics This section gives a brief introduction to robotics with focus on robotic arms. 2.1 Robotic Arms A robotic arm, see figure 2.1, can be modeled as a chain of rigid bodies (links) which in general are connected to each other with lower-pair joints. There are a total of six possible types of lower-pair joints, i.e. revolute, sliding, cylindrical, spherical, screw and planar joints, although only revolute and sliding joints are common in industrial robotic arms [10]. The first link is assumed to be connected to a supporting base while the last link is connected to the end-effector, e.g. a gripper or a drilling tool. The robotic arm is moved into different configurations by manipulating the angles of revolute joints and the lengths of sliding joints. The configuration c of the end-effector is usually of interest and can fully be defined by position p = (x, y, z) T, approach vector a = (a x, a y, a z ) T (i.e. the direction from the last joint to the position p) and a vector r = (r x, r y, r z ) T defining rotation such that c = (x, y, z, a x, a y, a z, r x, r y, r z ) T. 2.2 Robotic Arm Kinematics Robot arm kinematics deals with the the motion of a robotic arm, i.e. the position, velocity and acceleration of each link, without any regards to the forces that cause the motion [10]. Two fundamental problems within this area of study are the forward position and the inverse position problem. In the forward position problem the links and joint parameters of the robotic arm are given. The task is to find the configuration of the end-effector that will be the result of the given parameters. For the inverse position problem the desired configuration of the end-effector is given and the task is to find the corresponding joint parameters. Let the joint parameters be noted θ = (θ 1, θ 2,..., θ k ) where k is the degrees of freedom (DOF) and θ i is the configuration of the ith joint. The forward position 3 4 Robotics Figure 2.1. The Lynx-6 robotic arm used for real world experiments. problem can then be formulated as: Find the function f such that f(θ) = c. (2.1) The inverse position problem can be stated as: Find g such that g(f(θ)) = θ. (2.2) The solution to the forward position problem is rather straightforward. One common method is to use Denavit-Hartenberg parameters, that describe the characteristics of each link and also the relationship between connecting links [9], and homogeneous transform matrices. The problem, when the Denavit-Hartenberg parameters are identified, is then reduced to simple matrix multiplication. The inverse problem on the other hand is a more complex one. An analytical solution to the general inverse position problem does not exist even though numerical approaches exist. For 6 DOF robotic arms where kinematic decoupling is possible, e.g. the three last joints intersecting allowing the positioning and orientation problem of the gripper to be separated, closed-form analytical solutions exist [10]. 2.2 Robotic Arm Kinematics 5 It is worth noting that the solution to the forward position problem is unambiguous while the inverse position problem may result in a number of different solutions, i.e. a given configuration of the end-effector can often be reached by more than one joint configuration, see figure 2.2. The accuracy of analytical solutions to the inverse and forward problems depends on how reliable the values of the link parameters are. A small deviation from the true value may result in significant errors for the end-effector rendering the analytical solution unusable. z z Reached position: ( 0.00, , ) x y Reached position: ( 0.00, , ) x y Figure 2.2. The same configuration of the end-effector can often be reached in a number of ways. Here are two possible solutions illustrated for a 5 DOF robotic arm. For a thorough description of the forward and inverse kinematics problem and the use of D-H parameters see [8], [9] or [10]. 6 Robotics Chapter 3 Learning This chapter introduces the basic ideas behind learning systems. A detailed description of two simple supervised learning methods (linear regression and progression regression) are given in the last two sections of this chapter as a preparation for Locally Weighted Projection Regression described in chapter Machine Learning Learning is defined as any relatively permanent change in behavior resulting from past experience, and a learning system is characterized by its ability to improve its behavior with time, in some sense towards an ultimate goal. [18] The field of machine learning strives towards developing systems that have the ability to learn. A strict definition of the ability to learn is hard to find although most sources seem to agree on that the ability to learn is roughly equivalent to the ability to gain knowledge or skills from experience [17][18][20]. The field of machine learning can be divided into three main classes: supervised, unsupervised and reinforcement learning. Supervised learning In supervised learning the system is presented sequences of corresponding inputs and outputs. That is, for each input the system is also shown the desired output. The system is expected to be able to generalize from the shown training sequences and to correctly predict the output for previously unseen inputs. Reinforcement learning In reinforcement learning the system is given a reward (or punishment) depending on the generated output. The aim for the system is to over time acquire as much 7 8 Learning reward as possible. For a reinforcement learning system there will always be a trade-off between exploration (learning) and exploitation of learned knowledge. From experience the system knows which previously generated output that was effective to gain rewards; but to learn such outputs the system needs to try new outputs [24]. Unsupervised learning In unsupervised learning the system is shown only the input sequence. The system has to look for patterns in the input data without any feedback at all. Unsupervised learning is mostly used to learn a certain representation of the input that can be favorable for later processing [6]. A further distinction between learning methods can be done into batch/offline or incremental/online methods. For a batch method, all the training data need to be collected before the training can start. The system will then get access to all the data at once. An incremental method will receive one training sample at the time. Batch versions of an algorithm will often perform better than an incremental version of the same algorithm but the drawback is that the entire set of training samples needs to be kept in memory. 3.2 Why Learning? An autonomous system operating in an unknown changing environment encounters a large diversity of situations. When developing such a system one approach would be to supply the system with appropriate instructions for all possible situations, i.e. in the sense of traditional artificial intelligence. Despite the fact that this would be a very difficult task it would also require that the system would perform identically in the developing environment as well as in an unknown environment. This would be a very difficult, if not an impossible task [12]. A different approach would be to supply the system with the ability to learn and hence adapt to changes. Such a system would change its behavior depending on the current situation and the task to be performed. A learning system would be more flexible to changes and able to function in a wider range of situations. 3.3 The Curse of Dimensionality The curse of dimensionality is an often encountered term in learning and especially in high dimensional problems. It refers to the exponential growth of the volume of the hypercube with the number of dimensions [4]. To illustrate the problem, assume the training space is made up of the unit cube in nd. To cover half of the training space volume in nd we need to cover a distance of l = n units in 3.4 Local Learning 9 each direction. This becomes cumbersome in as few dimensions as 3 and nearly impossible for 10 dimensions, see table 3.1. Curse of dimensionality Dimension Distance to cover Table 3.1. The growth of the volume of the hypercube. The table shows the distance in each dimension that needs to be covered to span a hypercube with half the volume of the unit hypercube. Assume that we are acquiring training points by sampling half the training space along each dimension. One of the problems due to the curse of dimensionality becomes apparent when we realise that for nd we are effectively sampling 0.5 n of the volume of the training space, e.g. for n = 10 we are acquiring training samples for less than 0.1% of the training space. 3.4 Local Learning In global learning methods one global model is fitted to all the training data while in local learning methods a number of local models are fitted to different parts of the training data. All the different models have a position, e.g spatially, and a region of validity centered around the location of the individual model. Instead of region of validity the biologically inspired term receptive field (RF) is sometimes used. When training the individual local model, samples near, in whatever metric used, the center of the local model will influence the model more than samples far away. The simplest local learning method is perhaps the nearest neighbor method. Nearest neighbor approximates the output by using the output data of the nearest training sample, i.e. only the nearest training sample will affect the local model. The use of RFs requires a way to decide which training samples that will contribute, and with how much, to the training process of each model. The weight, or activation, associated with a certain sample can be calculated by using different weighting kernels. The weight is then used as a measurement of how much that particular sample will contribute to the overall characteristics of the local model. Two different weighting kernels can be seen in figure 3.1. The left plot shows a 10 Learning Uniform weighting kernel 2 Gaussian weighting kernel weight 1 weight Distance to model center Distance to model center Figure 3.1. Left: A uniform weighting kernel. A sample that is less than 5 units from the model center is given weight 1. Samples further away are given weight 0. Right: A Gaussian weighting kernel. The weight, w, of a training sample is given as w = e Dx2 2 Here D = 0.1. uniform weighting kernel. All samples within a certain distance from the model center is given weight 1 while samples further away are given weight, and th

Related Search

Similar documents

We Need Your Support

Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks