00001 /**************************************************************** 00002 * 00003 * Copyright (c) 2010 00004 * 00005 * Fraunhofer Institute for Manufacturing Engineering 00006 * and Automation (IPA) 00007 * 00008 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00009 * 00010 * Project name: care-o-bot 00011 * ROS stack name: cob_driver 00012 * ROS package name: cob_powercube_chain 00013 * Description: An interface class to a virtual manipulator. 00014 * 00015 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00016 * 00017 * Author: Felix Geibel, email:Felix.Geibel@gmx.de 00018 * Supervised by: Alexander Bubeck, email:alexander.bubeck@ipa.fhg.de 00019 * 00020 * Date of creation: Oct 2007 00021 * ToDo: 00022 * 00023 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00024 * 00025 * Redistribution and use in source and binary forms, with or without 00026 * modification, are permitted provided that the following conditions are met: 00027 * 00028 * * Redistributions of source code must retain the above copyright 00029 * notice, this list of conditions and the following disclaimer. 00030 * * Redistributions in binary form must reproduce the above copyright 00031 * notice, this list of conditions and the following disclaimer in the 00032 * documentation and/or other materials provided with the distribution. 00033 * * Neither the name of the Fraunhofer Institute for Manufacturing 00034 * Engineering and Automation (IPA) nor the names of its 00035 * contributors may be used to endorse or promote products derived from 00036 * this software without specific prior written permission. 00037 * 00038 * This program is free software: you can redistribute it and/or modify 00039 * it under the terms of the GNU Lesser General Public License LGPL as 00040 * published by the Free Software Foundation, either version 3 of the 00041 * License, or (at your option) any later version. 00042 * 00043 * This program is distributed in the hope that it will be useful, 00044 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00045 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00046 * GNU Lesser General Public License LGPL for more details. 00047 * 00048 * You should have received a copy of the GNU Lesser General Public 00049 * License LGPL along with this program. 00050 * If not, see <http://www.gnu.org/licenses/>. 00051 * 00052 ****************************************************************/ 00053 00054 #ifndef _SIMULATED_ARM_H_ 00055 #define _SIMULATED_ARM_H_ 00056 00057 #include <cob_powercube_chain/PowerCubeCtrl.h> 00058 #include <vector> 00059 #include <string> 00060 00061 class simulatedMotor; 00062 00063 class simulatedArm 00064 { 00065 public: 00066 00067 simulatedArm(); 00068 virtual ~simulatedArm(); 00069 00070 bool Init(PowerCubeCtrlParams * params); 00071 00072 bool isInitialized() const { return m_Initialized; } 00073 00074 std::string getErrorMessage() const { return m_ErrorMessage; } 00075 00076 bool Close() { m_Initialized = false; return true; } 00077 00079 // Funktionen Arm-Ansteuerung: // 00081 00084 bool MoveJointSpaceSync(const std::vector<double>& Angle); 00085 00087 bool MovePos(const std::vector<double>&); 00089 bool MoveVel(const std::vector<double>&); 00090 00092 // bool MoveCur(const std::vector<double>&); 00093 00095 bool Stop(); 00096 00098 // Funktionen zum setzen von Parametern: // 00100 00103 bool setMaxVelocity(double radpersec); 00104 bool setMaxVelocity(const std::vector<double>& radpersec); 00105 00108 bool setMaxAcceleration(double radPerSecSquared); 00109 bool setMaxAcceleration(const std::vector<double>& radPerSecSquared); 00110 00112 // hier die Funktionen zur Statusabfrage: // 00114 00115 00117 bool getConfig(std::vector<double>& result); 00118 00120 bool getJointVelocities(std::vector<double> & result); 00121 00124 bool statusMoving(); 00125 00127 bool statusDec(); 00128 00130 bool statusAcc(); 00131 00133 // bool doHoming(); 00134 // bool HomingDone(); 00135 00137 bool waitForSync() { return true; } // makes no difference in simulation 00139 bool dontWaitForSync() { return true; } // makes no difference in simulation 00140 00141 protected: 00142 00143 int m_DOF; 00144 bool m_Initialized; 00145 std::string m_ErrorMessage; 00146 00147 std::vector<simulatedMotor> m_motors; 00148 00149 std::vector<double> m_maxVel; 00150 std::vector<double> m_maxAcc; 00151 00152 }; 00153 00154 00155 #endif