00001 /* **-*-c++-*-************************************************************** 00002 Copyright (C)2002 David Jung <opensim@pobox.com> 00003 00004 This program/file is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. (http://www.gnu.org) 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 $Id: AnalyticLagrangianFSBetaOptimizer 1036 2004-02-11 20:48:55Z jungd $ 00019 $Revision: 1.7 $ 00020 $Date: 2004-02-11 15:48:55 -0500 (Wed, 11 Feb 2004) $ 00021 $Author: jungd $ 00022 00023 ****************************************************************************/ 00024 00025 #ifndef _ROBOT_CONTROL_KINEMATICS_ANALYTICLAGRANGIANFSBETAOPTIMIZER_ 00026 #define _ROBOT_CONTROL_KINEMATICS_ANALYTICLAGRANGIANFSBETAOPTIMIZER_ 00027 00028 #include <robot/control/kinematics/kinematics> 00029 00030 #include <robot/control/kinematics/LagrangianOptimizer> 00031 #include <robot/control/kinematics/BetaFormConstraints> 00032 00033 00034 namespace robot { 00035 namespace control { 00036 namespace kinematics { 00037 00038 00039 /// A constrained optimizer that uses an analytic Lagrangian solution technique 00040 /** 00041 * Analytic Lagrangian optimizer in Full-Space with Beta form constraints. 00042 * The paper below details a optimizaiton method that provides an analytic solution 00043 * for a Lagrangian-type problem, given the objective function and constraints are 00044 * of a particular form. 00045 * The objective form is represented via the ReferenceOpVectorFormObjective class and 00046 * the form of the constraints via the BetaFormConstraints class. 00047 * 00048 * see 1. "Resolving Kinematic Redundancy with Constraints 00049 * Using the FSP (Full Space Parameterization) Approach", Francois G. Pin & Faithlyn A. Tulloch, 00050 * Proceedings of the 1996 IEEE International Conference on Robotics and Automation. 00051 * 00052 * for the formulation of the non-holonomic constraint solution, 00053 * see 2. "Motion Planning for Mobile Manipulators with a Non-Holonomic Constraint 00054 * Using the FSP (Full Space Parameterization) Method", Francois G. Pin, Kristi A. Morgansen, 00055 * Faithlyn A. Tulloch, Charles J. Hacker and Kathryn B. Gower, 00056 * Journal of Robotic Systems 13(11), 723-736 (1996). 00057 */ 00058 class AnalyticLagrangianFSBetaOptimizer : public LagrangianOptimizer 00059 { 00060 public: 00061 AnalyticLagrangianFSBetaOptimizer() 00062 : gs(0), nullSpace(false) {} 00063 00064 virtual String className() const { return String("AnalyticLagrangianFSBetaOptimizer"); } 00065 00066 /// set the gs (Matrix of column vectors that span the full-space) 00067 virtual void setGs(const Matrix& gs) { this->gs = &gs; } 00068 00069 /// indicate if a solution is sought in the null-space 00070 void setSolveForNullspace(bool nullSpace) { this->nullSpace=nullSpace; } 00071 00072 /// optimize the objective with the given constraints 00073 virtual Vector optimize(ref<const Objective> objective, ref<const Constraints> constraints) const; 00074 00075 protected: 00076 Matrix const *gs; ///< matrix of column vectors that span the solition space of dq's (from a full-space solver) 00077 bool nullSpace; 00078 00079 mutable Vector o; // convenient zero Vector 00080 mutable Vector e; // convenient Vector of 1s 00081 00082 /// compute t Vector 00083 Vector calct(const Matrix& Ginv, const Vector& H, ref<const BetaFormConstraints> betaConstraints, bool nullSpace) const; 00084 00085 }; 00086 00087 00088 } // namespace kinematics 00089 } // namespace control 00090 } // namespace robot 00091 00092 #endif