Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Representations/Motion/JointData.h

Go to the documentation of this file.
00001 /** 
00002 * @file JointData.h
00003 *
00004 * Definition of JointData struct.
00005 * The jointdata struct is a non NDA violating description of join vector data
00006 *
00007 * @author Max Risler
00008 */
00009 #ifndef __JOINTDATA_H__
00010 #define __JOINTDATA_H__
00011 
00012 /** Invalid motor data value. 
00013  * If this value was returned by motion module for the head, 
00014  * other head movement is possible */
00015 static const long jointDataInvalidValue = 10000000;
00016 
00017 #include "Tools/Streams/InOut.h"
00018 
00019 /**
00020 * One joint data set. Containing values for all used joints.
00021 * @author Max Risler
00022 */
00023 struct JointData
00024 {
00025 public:
00026   /**
00027    * enum describing indexes of joints 
00028    */
00029   enum JointID {
00030     headTilt210,
00031     neckTilt = headTilt210,
00032     headPan210,
00033     headPan = headPan210,
00034     headRoll210, 
00035     headTilt = headRoll210,
00036     mouth,
00037     earL, earR,
00038     legFR1, legFR2, legFR3,
00039     legFL1, legFL2, legFL3,
00040     legHR1, legHR2, legHR3,
00041     legHL1, legHL2, legHL3,
00042     tailPan, tailTilt,
00043       numOfJoint
00044   };
00045 
00046   /** The joint data values */
00047   long data[numOfJoint];
00048   
00049   /** Default constructor */
00050   JointData(long headTiltValue = jointDataInvalidValue,
00051     long headPanValue = jointDataInvalidValue,
00052     long headRollValue = jointDataInvalidValue,
00053     long mouthValue = jointDataInvalidValue,
00054     long earLValue = jointDataInvalidValue, 
00055     long earRValue = jointDataInvalidValue,
00056     long legFR1Value = jointDataInvalidValue, 
00057     long legFR2Value = jointDataInvalidValue, 
00058     long legFR3Value = jointDataInvalidValue,
00059     long legFL1Value = jointDataInvalidValue, 
00060     long legFL2Value = jointDataInvalidValue, 
00061     long legFL3Value = jointDataInvalidValue,
00062     long legHR1Value = jointDataInvalidValue, 
00063     long legHR2Value = jointDataInvalidValue, 
00064     long legHR3Value = jointDataInvalidValue,
00065     long legHL1Value = jointDataInvalidValue, 
00066     long legHL2Value = jointDataInvalidValue, 
00067     long legHL3Value = jointDataInvalidValue,
00068     long tailPanValue = jointDataInvalidValue, 
00069     long tailTiltValue = jointDataInvalidValue
00070   );
00071 
00072   /** Assignment operator */
00073   JointData& operator=(const JointData& other);
00074 
00075   /** Copy constructor */
00076   JointData(const JointData& other);
00077 
00078   /** returns the name of a joint */
00079   static const char* getJointName(JointID joint)
00080   {
00081     switch (joint)
00082     {
00083     case headTilt210: return "neckTilt (headTilt210)";
00084     case headPan210: return "headPan"; 
00085     case headRoll210: return "headTilt (headRoll210)"; 
00086     case mouth: return "mouth"; 
00087     case earL: return "earL"; 
00088     case earR: return "earR"; 
00089     case legFR1: return "legFR1"; 
00090     case legFR2: return "legFR2"; 
00091     case legFR3: return "legFR3"; 
00092     case legFL1: return "legFL1"; 
00093     case legFL2: return "legFL2"; 
00094     case legFL3: return "legFL3"; 
00095     case legHR1: return "legHR1"; 
00096     case legHR2: return "legHR2"; 
00097     case legHR3: return "legHR3"; 
00098     case legHL1: return "legHL1"; 
00099     case legHL2: return "legHL2"; 
00100     case legHL3: return "legHL3"; 
00101     case tailPan: return "tailPan"; 
00102     case tailTilt: return "tailTilt"; 
00103     default: return "";
00104     }
00105   }
00106 
00107   static JointID getIDFromName(const char* jointName);
00108 };
00109 
00110 
00111 /**
00112  * Streaming operator that reads a JointData from a stream.
00113  * @param stream The stream from which is read.
00114  * @param jointData The JointData object.
00115  * @return The stream.
00116  */ 
00117 In& operator>>(In& stream,JointData& jointData);
00118  
00119 /**
00120  * Streaming operator that writes a JointData to a stream.
00121  * @param stream The stream to write on.
00122  * @param jointData The JointData object.
00123  * @return The stream.
00124  */ 
00125 Out& operator<<(Out& stream, const JointData& jointData);
00126 
00127 #endif //__JOINTDATA_H__
00128 
00129 /*
00130  * Change log :
00131  * 
00132  * $Log: JointData.h,v $
00133  * Revision 1.2  2004/05/27 17:13:37  jhoffman
00134  * - renaming: tilt1 -> neckTilt,  pan -> headPan,  tilt2 -> headTilt
00135  * - clipping included for setJoints
00136  * - removed some microrad/rad-bugs
00137  * - bodyPosture constructor and "=" operator fixed
00138  *
00139  * Revision 1.1.1.1  2004/05/22 17:25:17  cvsadm
00140  * created new repository GT2004_WM
00141  *
00142  * Revision 1.4  2003/12/31 16:58:44  roefer
00143  * Joints and LEDs for ERS-7
00144  *
00145  * Revision 1.3  2003/12/31 14:29:20  roefer
00146  * Joints and LEDs for ERS-7
00147  *
00148  * Revision 1.2  2003/12/16 18:52:55  loetzsch
00149  * added a function for retrieving the id for as string.
00150  *
00151  * Revision 1.1  2003/10/07 10:07:01  cvsadm
00152  * Created GT2004 (M.J.)
00153  *
00154  * Revision 1.2  2003/09/11 15:55:13  dueffert
00155  * doxygen bug fixed
00156  *
00157  * Revision 1.1.1.1  2003/07/02 09:40:22  cvsadm
00158  * created new repository for the competitions in Padova from the 
00159  * tamara CVS (Tuesday 2:00 pm)
00160  *
00161  * removed unused solutions
00162  *
00163  * Revision 1.2  2002/11/19 17:14:14  risler
00164  * coding conventions: renamed JointData::joint to JointID, GetName to getName
00165  *
00166  * Revision 1.1  2002/09/10 15:26:40  cvsadm
00167  * Created new project GT2003 (M.L.)
00168  * - Cleaned up the /Src/DataTypes directory
00169  * - Removed Challenge Code
00170  * - Removed processing of incoming audio data
00171  * - Renamed AcousticMessage to SoundRequest
00172  *
00173  * Revision 1.2  2002/07/23 13:32:57  loetzsch
00174  * new streaming classes
00175  *
00176  * removed many #include statements
00177  *
00178  * Revision 1.1.1.1  2002/05/10 12:40:13  cvsadm
00179  * Moved GT2002 Project from ute to tamara.
00180  *
00181  * Revision 1.14  2002/02/21 18:02:13  risler
00182  * now thats a constructor
00183  *
00184  * Revision 1.13  2002/01/30 11:10:37  risler
00185  * still no need to include GTMath.h here
00186  *
00187  * Revision 1.12  2002/01/30 01:08:56  dueffert
00188  * fixed endless-compile-bug caused by up/downcase difference MathLib vs. Mathlib, makefile should be caseUNsensitive (in such cases) now
00189  *
00190  * Revision 1.11  2002/01/29 17:05:39  risler
00191  * for some reason its a bad idea to include GTMath.h here
00192  *
00193  * Revision 1.10  2002/01/28 16:24:23  juengel
00194  * Tippfehler in GetJointName beseitigt
00195  *
00196  * Revision 1.9  2002/01/28 14:57:27  jhoffman
00197  * no message
00198  *
00199  * Revision 1.8  2002/01/26 03:11:27  loetzsch
00200  * JointViewer continued
00201  *
00202  * Revision 1.7  2002/01/25 16:52:40  loetzsch
00203  * function for enum names added
00204  *
00205  * Revision 1.6  2001/12/10 17:47:05  risler
00206  * change log added
00207  *
00208  */

Generated on Thu Sep 23 19:57:35 2004 for GT2004 by doxygen 1.3.6