ServoMotorData.h

Go to the documentation of this file.
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_DATA_H
00029 #define OPAL_SERVO_MOTOR_DATA_H
00030 
00031 #include "Defines.h"
00032 #include "MotorData.h"
00033 
00034 namespace opal
00035 {
00037         enum ServoMotorMode
00038         {
00041                 DESIRED_ANGLE_MODE,
00042 
00045                 DESIRED_VEL_MODE
00046         };
00047 
00049         class ServoMotorData : public MotorData
00050         {
00051         public:
00052                 OPAL_DECL ServoMotorData()
00053                 : MotorData()
00054                 {
00055                         mType = SERVO_MOTOR;
00056                         joint = NULL;
00057                         internal_jointIndex = 0;
00058                         jointBlueprintRefName = "";
00059                         mode = DESIRED_ANGLE_MODE;
00060                         jointAxisNum = 0;
00061                         desiredAngle = 0;
00062                         desiredVel = 0;
00063                         maxTorque = defaults::motor::servo::maxTorque;
00064                         restoreSpeed = defaults::motor::servo::restoreSpeed;
00065                 }
00066 
00068                 OPAL_DECL ServoMotorData(const ServoMotorData& data)
00069                 {
00070                         (*this) = data;
00071                 }
00072 
00073                 OPAL_DECL virtual ~ServoMotorData()
00074                 {
00075                 }
00076 
00078                 OPAL_DECL virtual void OPAL_CALL operator=(const ServoMotorData& data)
00079                 {
00080                         mType = data.mType;
00081                         enabled = data.enabled;
00082                         name = data.name;
00083                         joint = data.joint;
00084                         internal_jointIndex = data.internal_jointIndex;
00085                         jointBlueprintRefName = data.jointBlueprintRefName;
00086                         mode = data.mode;
00087                         jointAxisNum = data.jointAxisNum;
00088                         desiredAngle = data.desiredAngle;
00089                         desiredVel = data.desiredVel;
00090                         maxTorque = data.maxTorque;
00091                         restoreSpeed = data.restoreSpeed;
00092                 }
00093 
00095                 Joint* joint;
00096 
00098                 int internal_jointIndex;
00099 
00101                 std::string jointBlueprintRefName;
00102 
00104                 ServoMotorMode mode;
00105 
00107                 int jointAxisNum;
00108 
00111                 real desiredAngle;
00112 
00115                 real desiredVel;
00116 
00119                 real maxTorque;
00120 
00123                 real restoreSpeed;
00124 
00125         protected:
00126 
00127         private:
00128         };
00129 }
00130 
00131 #endif

Generated on Tue May 16 17:49:52 2006 for OPAL by  doxygen 1.4.6-NO