$search
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_canopen_motor 00013 * Description: 00014 * 00015 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00016 * 00017 * Author: Christian Connette, email:christian.connette@ipa.fhg.de 00018 * Supervised by: Christian Connette, email:christian.connette@ipa.fhg.de 00019 * 00020 * Date of creation: Feb 2009 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 00055 #ifndef CANDRIVEITF_INCLUDEDEF_H 00056 #define CANDRIVEITF_INCLUDEDEF_H 00057 00058 //----------------------------------------------- 00059 #include <cob_generic_can/CanItf.h> 00060 #include <cob_canopen_motor/DriveParam.h> 00061 #include <cob_canopen_motor/SDOSegmented.h> 00062 //----------------------------------------------- 00063 00068 class CanDriveItf 00069 { 00070 public: 00074 enum MotionType 00075 { 00076 MOTIONTYPE_VELCTRL, 00077 MOTIONTYPE_TORQUECTRL, 00078 MOTIONTYPE_POSCTRL 00079 }; 00080 00084 virtual void setCanItf(CanItf* pCanItf) = 0; 00085 00090 virtual bool init() = 0; 00091 00097 virtual bool isInitialized() = 0; 00098 00103 virtual bool start() = 0; 00104 00109 virtual bool stop() = 0; 00110 00115 virtual bool reset() = 0; 00116 00120 virtual bool shutdown() = 0; 00121 00128 virtual bool disableBrake(bool bDisabled) = 0; 00129 00134 virtual bool initHoming() = 0; 00135 00140 virtual bool execHoming() = 0; 00141 00145 virtual double getTimeToLastMsg() = 0; 00146 00151 virtual bool getStatusLimitSwitch() = 0; 00152 00160 virtual bool startWatchdog(bool bStarted) = 0; 00161 00167 virtual bool evalReceivedMsg(CanMsg& msg) = 0; 00168 00174 virtual bool evalReceivedMsg() = 0; 00175 00181 virtual void setGearPosVelRadS(double dPosRad, double dVelRadS) = 0; 00182 00187 virtual void setGearVelRadS(double dVelRadS) = 0; 00188 00194 virtual bool setTypeMotion(int iType) = 0; 00195 00199 virtual void getGearPosVelRadS(double* pdAngleGearRad, double* pdVelGearRadS) = 0; 00200 00205 virtual void getGearDeltaPosVelRadS(double* pdDeltaAngleGearRad, double* pdVelGearRadS) = 0; 00206 00210 virtual void getGearPosRad(double* pdPosGearRad) = 0; 00211 00215 virtual void setDriveParam(DriveParam driveParam) = 0; 00216 00220 virtual bool isError() = 0; 00221 00225 virtual unsigned int getError() = 0; 00226 00230 virtual void requestPosVel() = 0; 00231 00235 virtual void requestStatus() = 0; 00236 00240 virtual void getStatus(int* piStatus, int* piTempCel) = 0; 00241 00245 virtual bool setEMStop() = 0; 00246 00250 virtual bool resetEMStop() = 0; 00251 00255 virtual void IntprtSetInt(int iDataLen, char cCmdChar1, char cCmdChar2, int iIndex, int iData) = 0; 00256 00260 virtual int setRecorder(int iFlag, int iParam = 0, std::string sParam = "/home/MyLog") = 0; 00261 00265 virtual void requestMotorTorque() = 0; 00266 00272 virtual void getMotorTorque(double* dTorqueNm) = 0; 00273 00277 virtual void setMotorTorque(double dTorqueNm) = 0; 00278 }; 00279 00280 00281 //----------------------------------------------- 00282 #endif 00283