00001 /************************************************************************* 00002 * * 00003 * Open Physics Abstraction Layer * 00004 * Copyright (C) 2004-2005 * 00005 * Alan Fischer alan.fischer@gmail.com * 00006 * Andres Reinot andres@reinot.com * 00007 * Tyler Streeter tylerstreeter@gmail.com * 00008 * All rights reserved. * 00009 * Web: opal.sourceforge.net * 00010 * * 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of EITHER: * 00013 * (1) The GNU Lesser General Public License as published by the Free * 00014 * Software Foundation; either version 2.1 of the License, or (at * 00015 * your option) any later version. The text of the GNU Lesser * 00016 * General Public License is included with this library in the * 00017 * file license-LGPL.txt. * 00018 * (2) The BSD-style license that is included with this library in * 00019 * the file license-BSD.txt. * 00020 * * 00021 * This library is distributed in the hope that it will be useful, * 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 00024 * license-LGPL.txt and license-BSD.txt for more details. * 00025 * * 00026 *************************************************************************/ 00027 00028 #ifndef OPAL_SERVO_MOTOR_H 00029 #define OPAL_SERVO_MOTOR_H 00030 00031 #include "Defines.h" 00032 #include "Motor.h" 00033 #include "Joint.h" 00034 #include "ServoMotorData.h" 00035 00036 namespace opal 00037 { 00044 class ServoMotor : public Motor 00045 { 00046 public: 00047 ServoMotor(); 00048 00049 virtual ~ServoMotor(); 00050 00054 //virtual void OPAL_CALL init(Mode m, Joint* j, int axisNum); 00055 00058 virtual void OPAL_CALL init(const ServoMotorData& data); 00059 00061 virtual const ServoMotorData& OPAL_CALL getData()const; 00062 00063 virtual MotorType OPAL_CALL getType()const; 00064 00065 virtual void OPAL_CALL setName(const std::string& name); 00066 00067 virtual const std::string& OPAL_CALL getName()const; 00068 00069 virtual bool OPAL_CALL isEnabled()const; 00070 00071 virtual void OPAL_CALL setEnabled(bool e); 00072 00076 virtual void OPAL_CALL setDesiredAngle(real a); 00077 00081 virtual void OPAL_CALL setDesiredAngleNorm(real a); 00082 00085 virtual real OPAL_CALL getDesiredAngle()const; 00086 00088 virtual void OPAL_CALL setDesiredVel(real vel); 00089 00091 virtual real OPAL_CALL getDesiredVel()const; 00092 00094 virtual void OPAL_CALL setMaxTorque(real max); 00095 00097 virtual real OPAL_CALL getMaxTorque()const; 00098 00102 virtual void OPAL_CALL setRestoreSpeed(real speed); 00103 00105 virtual real OPAL_CALL getRestoreSpeed()const; 00106 00107 virtual void OPAL_CALL internal_update(); 00108 00109 virtual bool OPAL_CALL internal_dependsOnJoint(Joint* j); 00110 00111 protected: 00113 ServoMotorData mData; 00114 00115 private: 00116 00117 }; 00118 } 00119 00120 #endif