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: IKORFullSpaceSolver 1068 2004-07-28 19:06:06Z jungd $ 00019 $Revision: 1.8 $ 00020 $Date: 2004-07-28 15:06:06 -0400 (Wed, 28 Jul 2004) $ 00021 $Author: jungd $ 00022 00023 ****************************************************************************/ 00024 00025 #ifndef _ROBOT_CONTROL_KINEMATICS_FULLSPACESOLVER_ 00026 #define _ROBOT_CONTROL_KINEMATICS_FULLSPACESOLVER_ 00027 00028 #include <robot/control/kinematics/kinematics> 00029 00030 #include <base/ReferencedObject> 00031 00032 00033 namespace robot { 00034 namespace control { 00035 namespace kinematics { 00036 00037 00038 00039 /// Base class of Solvers that find the set of vectors gi, such that dq = sum ti.gi s.t. sum tk=1 00040 /// is a solution to Jdq=dx, and dq = sum ti.gi s.t. sum tk=0 is a solution to 00041 /// Jdq=0 (null-space) 00042 class FullSpaceSolver : public base::ReferencedObject 00043 { 00044 public: 00045 00046 /// Computes a set of vectors gi that can be used to find solutions to Ax=b for x 00047 /** 00048 * @param A_in NxM Matrix 00049 * @param b_in N-dim Vector 00050 * @param dependentRowsEliminated is filled out with the indices of rows of A_in 00051 * that are eliminated from the computation because they 00052 * are dependent (actually if Ai|bi is dependent. If only 00053 * Ai is dependent but bi conflicts an exception is throw 00054 * because solution is impossible) 00055 * Can be 0-length is not-supported/used. 00056 * @return returns the set of vector gis as columns of a Matrix 00057 * @exception std::invalid_argument if gis can't be found for the provided A & b 00058 */ 00059 virtual Matrix solve(const Matrix& A_in, const Vector& b_in, 00060 array<Int>& dependentRowsEliminated) = 0; 00061 00062 protected: 00063 FullSpaceSolver() {} 00064 FullSpaceSolver(const FullSpaceSolver& fsp) {} 00065 }; 00066 00067 00068 } // namespace kinematics 00069 } // namespace control 00070 } // namespace robot 00071 00072 #endif