Homepage Demos Overview Downloads Tutorials Reference
Credits

control_select.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2002-2004  Etienne Lachance
00003 
00004 This library is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU Lesser General Public License as
00006 published by the Free Software Foundation; either version 2.1 of the
00007 License, or (at your option) any later version.
00008 
00009 This library 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 Lesser General Public License for more details.
00013 
00014 You should have received a copy of the GNU Lesser General Public
00015 License along with this library; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 Report problems and direct all questions to:
00020 
00021 email: etienne.lachance@polymtl.ca or richard.gourdeau@polymtl.ca
00022 
00023 -------------------------------------------------------------------------------
00024 Revision_history:
00025 
00026 2004/07/13: Ethan Tira-Thompson
00027     -Added support for newmat's use_namespace #define, using ROBOOP namespace
00028 -------------------------------------------------------------------------------
00029 */
00030 
00031 
00032 #ifndef CONTROL_SELECT_H
00033 #define CONTROL_SELECT_H
00034 
00035 /*!
00036   @file control_select.h
00037   @brief Header file for Control_Select class definitions.
00038 */
00039 
00040 //! @brief RCS/CVS version.
00041 static const char header_Control_Select_rcsid[] = "$Id: control_select.h,v 1.3 2004/07/14 02:46:43 ejt Exp $";
00042 
00043 
00044 #include <string>
00045 #include <vector>
00046 #include "robot.h"
00047 #include "config.h"
00048 #include "controller.h"
00049 #include "trajectory.h"
00050 
00051 #ifdef use_namespace
00052 namespace ROBOOP {
00053   using namespace NEWMAT;
00054 #endif
00055 
00056 #define NONE   0
00057 #define PD     1
00058 #define CTM    2
00059 #define RRA    3
00060 #define IMP    4
00061 
00062 #define CONTROLLER  "CONTROLLER"
00063 
00064 #define PROPORTIONAL_DERIVATIVE    "PROPORTIONAL_DERIVATIVE"
00065 #define COMPUTED_TORQUE_METHOD     "COMPUTED_TORQUE_METHOD"
00066 #define RESOLVED_RATE_ACCELERATION "RESOLVED_RATE_ACCELERATION"
00067 #define IMPEDANCE                  "IMPEDANCE"
00068 
00069 /*!
00070   @class Control_Select
00071   @brief Select controller class.
00072 
00073   This class contains an instance of each controller class. The active controller
00074   will be selected when reading a controller file. "type" value correspond to the
00075   active controller, ex:
00076   \li <tt> type = NONE </tt>: no controller selected
00077   \li <tt> type = PD </tt>: Proportional Derivative 
00078   \li <tt> type = CTM </tt>: Computer Torque Method
00079   \li <tt> type = RRA </tt>: Resolved Rate Acceleration
00080   \li <tt> type = IMP </tt>: Impedance
00081 
00082   Bellow is an exemple of RRA configuration file (more info on configuration
00083   file in config.h/cpp):
00084 
00085 \verbatim
00086   [CONTROLLER]
00087 
00088   type:   RESOLVED_RATE_ACCELERATION
00089   dof:    6
00090 
00091   [GAINS]
00092 
00093   Kvp:         500.0
00094   Kpp:        5000.0
00095   Kvo:         500.0
00096   Kpo:        5000.0
00097 \endverbatim
00098 */
00099 class Control_Select
00100 {
00101 public:
00102     Control_Select();
00103     Control_Select(const string & filename);
00104     Control_Select(const Control_Select & x);
00105     Control_Select & operator=(const Control_Select & x);
00106     int get_dof();
00107     void set_control(const string & filename);
00108     Proportional_Derivative pd;
00109     Computed_torque_method ctm;
00110     Resolved_acc rra;
00111     Impedance impedance;
00112 
00113     short type,            //!< Type of controller: PD, CTM,...
00114     space_type;      //!< JOINT_SPACE or CARTESIAN_SPACE.
00115     string ControllerName; //!< Controller name.
00116 private:
00117     int dof;               //!< Degree of freedom.
00118 };
00119 
00120 #ifdef use_namespace
00121 }
00122 #endif
00123 
00124 #endif
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 

ROBOOP v1.21a
Generated Tue Jan 4 15:42:24 2005 by Doxygen 1.4.0