ControlMode.h

Go to the documentation of this file.
00001 /* ============================================================
00002  *
00003  * This file is a part of RCI project
00004  *
00005  * Copyright (C) 2011 by Arne Nordmann <anordman at cor-lab dot uni-bielefeld dot de>
00006  *
00007  * This file may be licensed under the terms of the
00008  * GNU Lesser General Public License Version 3 (the ``LGPL''),
00009  * or (at your option) any later version.
00010  *
00011  * Software distributed under the License is distributed
00012  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
00013  * express or implied. See the LGPL for the specific language
00014  * governing rights and limitations.
00015  *
00016  * You should have received a copy of the LGPL along with this
00017  * program. If not, go to http://www.gnu.org/licenses/lgpl.html
00018  * or write to the Free Software Foundation, Inc.,
00019  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  * The development of this software was supported by:
00022  *   CoR-Lab, Research Institute for Cognition and Robotics
00023  *     Bielefeld University
00024  *
00025  * ============================================================ */
00026 
00027 #pragma once
00028 
00029 #include <iostream>
00030 #include <vector>
00031 
00032 #include <boost/shared_ptr.hpp>
00033 
00034 #include "ControlAspect.h"
00035 
00036 namespace rci {
00037 
00038 class ControlMode;
00039 typedef boost::shared_ptr<ControlMode> ControlModePtr;
00040 
00048 class ControlMode {
00049 
00050 public:
00051 
00057     ControlMode(std::string name);
00058 
00062     virtual ~ControlMode();
00063 
00068     std::string getName() const;
00069 
00075     bool equals(const ControlModePtr &mode) const;
00076 
00082     bool supports(const ControlAspectPtr &mode) const;
00083 
00087     void addControlAspect(ControlAspectPtr mode);
00088 
00092     ControlModePtr combineWith(const ControlModePtr &mode,
00093             const std::string &name) const;
00094 
00099     std::string print() const;
00100 
00106     static ControlModePtr create(std::string name);
00107 
00114     static ControlModePtr create(std::string name, ControlAspectPtr aspect);
00115 
00123     static ControlModePtr create(std::string name, ControlAspectPtr aspect1,
00124             ControlAspectPtr aspect2);
00125 
00126 protected:
00130     std::string name;
00131 
00137     std::vector<ControlAspectPtr> contained;
00138 
00142     unsigned int numAspects() const;
00143 
00144 private:
00145 
00149     ControlMode(const ControlMode& controlmode);
00150 };
00151 
00155 static ControlModePtr modeNoControl = ControlMode::create(
00156         "Inactive / no Control", noControl);
00157 
00162 static ControlModePtr modePoseControl = ControlMode::create(
00163         "Cartesian Pose Control", poseControl);
00164 
00169 static ControlModePtr modeForceControl = ControlMode::create(
00170         "Cartesian Force Control", forceControl);
00171 
00176 static ControlModePtr modeJointPositionControl = ControlMode::create(
00177         "Joint Position Control", jointPositionControl);
00178 
00179 /* Compliance */
00180 
00185 static ControlModePtr modeJointComplianceControl = ControlMode::create(
00186         "Joint Compliance Control", jointComplianceControl);
00187 
00192 static ControlModePtr modeCartesianComplianceControl = ControlMode::create(
00193         "Cartesian Compliance Control", cartesianComplianceControl);
00194 
00198 static ControlModePtr modeJointVelocityControl = ControlMode::create(
00199         "Joint Velocity Control", jointVelocityControl);
00200 
00204 static ControlModePtr modeJointTorqueControl = ControlMode::create(
00205         "Joint Torque Control", jointTorqueControl);
00206 }
Generated on Thu Aug 2 14:02:49 2012 for RCI by  doxygen 1.6.3