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 #include <string>
00041 #include <vector>
00042 #include "robot.h"
00043 #include "config.h"
00044 #include "controller.h"
00045 #include "trajectory.h"
00046 
00047 #ifdef use_namespace
00048 namespace ROBOOP {
00049   using namespace NEWMAT;
00050 #endif
00051   //! @brief RCS/CVS version.
00052   static const char header_Control_Select_rcsid[] __UNUSED__ = "$Id: control_select.h,v 1.4 2005/07/26 03:22:08 ejt Exp $";
00053 
00054   
00055 #define NONE   0
00056 #define PD     1
00057 #define CTM    2
00058 #define RRA    3
00059 #define IMP    4
00060 
00061 #define CONTROLLER  "CONTROLLER"
00062 
00063 #define PROPORTIONAL_DERIVATIVE    "PROPORTIONAL_DERIVATIVE"
00064 #define COMPUTED_TORQUE_METHOD     "COMPUTED_TORQUE_METHOD"
00065 #define RESOLVED_RATE_ACCELERATION "RESOLVED_RATE_ACCELERATION"
00066 #define IMPEDANCE                  "IMPEDANCE"
00067 
00068 /*!
00069   @class Control_Select
00070   @brief Select controller class.
00071 
00072   This class contains an instance of each controller class. The active controller
00073   will be selected when reading a controller file. "type" value correspond to the
00074   active controller, ex:
00075   \li <tt> type = NONE </tt>: no controller selected
00076   \li <tt> type = PD </tt>: Proportional Derivative 
00077   \li <tt> type = CTM </tt>: Computer Torque Method
00078   \li <tt> type = RRA </tt>: Resolved Rate Acceleration
00079   \li <tt> type = IMP </tt>: Impedance
00080 
00081   Bellow is an exemple of RRA configuration file (more info on configuration
00082   file in config.h/cpp):
00083 
00084 \verbatim
00085   [CONTROLLER]
00086 
00087   type:   RESOLVED_RATE_ACCELERATION
00088   dof:    6
00089 
00090   [GAINS]
00091 
00092   Kvp:         500.0
00093   Kpp:        5000.0
00094   Kvo:         500.0
00095   Kpo:        5000.0
00096 \endverbatim
00097 */
00098 class Control_Select
00099 {
00100 public:
00101     Control_Select();
00102     Control_Select(const string & filename);
00103     Control_Select(const Control_Select & x);
00104     Control_Select & operator=(const Control_Select & x);
00105     int get_dof();
00106     void set_control(const string & filename);
00107     Proportional_Derivative pd;
00108     Computed_torque_method ctm;
00109     Resolved_acc rra;
00110     Impedance impedance;
00111 
00112     short type,            //!< Type of controller: PD, CTM,...
00113     space_type;      //!< JOINT_SPACE or CARTESIAN_SPACE.
00114     string ControllerName; //!< Controller name.
00115 private:
00116     int dof;               //!< Degree of freedom.
00117 };
00118 
00119 #ifdef use_namespace
00120 }
00121 #endif
00122 
00123 #endif
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 

ROBOOP v1.21a
Generated Tue Aug 16 16:32:14 2005 by Doxygen 1.4.4