Controlled.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 00031 #include "rci/ControlMode.h" 00032 #include "rci/dto/JointAngles.h" 00033 #include "rci/dto/JointTorques.h" 00034 #include "rci/dto/JointImpedance.h" 00035 #include "rci/dto/JointVelocities.h" 00036 #include "rci/dto/Pressure.h" 00037 #include "rci/dto/Length.h" 00038 #include "rci/dto/CartesianPose.h" 00039 00040 namespace rci { 00041 00042 class Controlled { 00043 00044 public: 00050 virtual bool isConverged() const = 0; 00051 00057 virtual ControlModePtr getControlMode(); 00058 00064 virtual void setControlMode(ControlModePtr controlMode); 00065 00066 protected: 00067 ControlModePtr _controlMode; 00068 00069 Controlled(); 00070 virtual ~Controlled(); 00071 }; 00072 00078 class PositionControlled { 00079 00080 public: 00086 virtual bool setJointPosition(JointAnglesPtr position); 00087 00093 virtual JointAnglesPtr getLastPositionCommand() const; 00094 00095 protected: 00096 PositionControlled(); 00097 virtual ~PositionControlled(); 00098 00099 JointAnglesPtr _lastCommandedPosition; 00100 }; 00101 00107 class VelocityControlled { 00108 00109 public: 00115 virtual bool setJointVelocity(JointVelocitiesPtr velocity); 00116 00122 virtual JointVelocitiesPtr getLastVelocityCommand() const; 00123 00124 protected: 00125 VelocityControlled(); 00126 virtual ~VelocityControlled(); 00127 00128 JointVelocitiesPtr _lastCommandedVelocity; 00129 }; 00130 00136 class TorqueControlled { 00137 00138 public: 00144 virtual bool setJointTorque(JointTorquesPtr position); 00145 00151 virtual JointTorquesPtr getLastTorqueCommand() const; 00152 00153 protected: 00154 TorqueControlled(); 00155 virtual ~TorqueControlled(); 00156 00157 JointTorquesPtr _lastCommandedTorque; 00158 }; 00159 00165 class ImpedanceControlled { 00166 00167 public: 00173 virtual bool setJointImpedance(JointImpedancePtr impedance); 00174 00180 virtual JointImpedancePtr getLastImpedanceCommand() const; 00181 00182 protected: 00183 ImpedanceControlled(); 00184 virtual ~ImpedanceControlled(); 00185 00186 JointImpedancePtr _lastCommandedImpedance; 00187 }; 00188 00194 class PressureControlled { 00195 00196 public: 00202 virtual bool setPressure(PressurePtr pressure); 00203 00209 virtual PressurePtr getLastPressureCommand() const; 00210 00211 protected: 00212 PressureControlled(); 00213 virtual ~PressureControlled(); 00214 00215 PressurePtr _lastCommandedPressure; 00216 }; 00217 00223 class LengthControlled { 00224 00225 public: 00231 virtual bool setLength(LengthPtr Length); 00232 00238 virtual LengthPtr getLastLengthCommand() const; 00239 00240 protected: 00241 LengthControlled(); 00242 virtual ~LengthControlled(); 00243 00244 LengthPtr _lastCommandedLength; 00245 }; 00246 00252 class PoseControlled { 00253 00254 public: 00260 virtual bool setPose(PosePtr pose); 00261 00267 virtual PosePtr getLastPoseCommand() const; 00268 00269 protected: 00270 PoseControlled(); 00271 virtual ~PoseControlled(); 00272 00273 PosePtr _lastCommandedPose; 00274 }; 00275 00276 } 00277
Generated on Thu Aug 2 14:02:49 2012 for RCI by 1.6.3