00001 /** 00002 * @file JoystickData.h 00003 * Declaration of class JoystickData. 00004 * 00005 * @author <a href=mailto:dueffert@informatik.hu-berlin.de>Uwe Düffert</a> 00006 */ 00007 00008 #ifndef __JOYSTICKDATA_H__ 00009 #define __JOYSTICKDATA_H__ 00010 00011 #include "Representations/Motion/MotionRequest.h" 00012 #include "Tools/Streams/InOut.h" 00013 00014 /** the maximum number of configurable buttons */ 00015 static const int numOfJoystickButtons = 12; 00016 00017 /** 00018 * @class JoystickData 00019 * A class for holdung all data produced by a joystick or a key equivalent. 00020 */ 00021 class JoystickData 00022 { 00023 public: 00024 /** Constructor */ 00025 JoystickData(); 00026 00027 /** The value of the three joystick axes in [-1,1] */ 00028 double x,y,z; 00029 00030 /** The value of the accelerator in [0,1] */ 00031 double accel; 00032 00033 /** Bit array of the pressed buttons */ 00034 int button; 00035 00036 /** The value of the coolie: 0 or 1..8 */ 00037 int coolie; 00038 00039 /** Boolean if a special-action is given to be executed */ 00040 bool directSpecialAction; 00041 00042 /** The id of the special-action to be executed directly */ 00043 SpecialActionRequest::SpecialActionID specialActionID; 00044 00045 /** 00046 * The timestamp when the last data was received. 00047 * Note that this value is set in the In streaming operator. 00048 */ 00049 unsigned long timeStamp; 00050 }; 00051 00052 /** 00053 * Streaming operator that reads a JoystickData from a stream. 00054 * @param stream The stream from which is read. 00055 * @param joystickData The JoystickData object. 00056 * @return The stream. 00057 */ 00058 In& operator>>(In& stream,JoystickData& joystickData); 00059 00060 /** 00061 * Streaming operator that writes a JoystickData to a stream. 00062 * @param stream The stream to write on. 00063 * @param joystickData The JoystickData object. 00064 * @return The stream. 00065 */ 00066 Out& operator<<(Out& stream, const JoystickData& joystickData); 00067 00068 #endif // __JOYSTICKDATA_H__ 00069 00070 /* 00071 * Changelog: 00072 * 00073 * $Log: JoystickData.h,v $ 00074 * Revision 1.2 2004/06/02 17:18:24 spranger 00075 * MotionRequest cleanup 00076 * 00077 * Revision 1.1.1.1 2004/05/22 17:25:01 cvsadm 00078 * created new repository GT2004_WM 00079 * 00080 * Revision 1.2 2004/04/26 15:58:59 thomas 00081 * added new project RobotRemote based on ATHAiboControl 00082 * 00083 * Revision 1.1 2003/10/07 10:07:01 cvsadm 00084 * Created GT2004 (M.J.) 00085 * 00086 * Revision 1.1.1.1 2003/07/02 09:40:22 cvsadm 00087 * created new repository for the competitions in Padova from the 00088 * tamara CVS (Tuesday 2:00 pm) 00089 * 00090 * removed unused solutions 00091 * 00092 * Revision 1.3 2003/02/27 12:56:54 dueffert 00093 * doxygen error removed 00094 * 00095 * Revision 1.2 2003/02/27 12:33:57 dueffert 00096 * doxygen warning removed 00097 * 00098 * Revision 1.1 2003/02/27 12:02:11 dueffert 00099 * JoystickData added 00100 * 00101 * 00102 */