71 /** Returns the number of Joysticks in the computer.
72 */
73staticint getJoysticksCount();
74
75 /** Gets joystick information.
76 *
77 * This method will try first to open the joystick, so you can safely call it while the joystick is plugged and removed arbitrarly.
78 *
79 * \param nJoy The index of the joystick to query: The first one is 0, the second 1, etc... See CJoystick::getJoysticksCount to discover the number of joysticks in the system.
80 * \param x The x axis position, range [-1,1]
81 * \param y The y axis position, range [-1,1]
82 * \param z The z axis position, range [-1,1]
83 * \param buttons Each element will hold true if buttons are pressed. The size of the vector will be set automatically to the number of buttons.
84 * \param raw_x_pos If it is desired the raw integer measurement from JoyStick, set this pointer to a desired placeholder.
85 * \param raw_y_pos If it is desired the raw integer measurement from JoyStick, set this pointer to a desired placeholder.
86 * \param raw_z_pos If it is desired the raw integer measurement from JoyStick, set this pointer to a desired placeholder.
87 *
88 * \return Returns true if successfull, false on error, for example, if joystick is not present.
89 *
90 * \sa setLimits
91 */
92bool getJoystickPosition(
93int nJoy,
94float &x,
95float &y,
96float &z,
97 std::vector<bool> &buttons,
98int *raw_x_pos=NULL,
99int *raw_y_pos=NULL,
100int *raw_z_pos=NULL );
101
102 /** Set the axis limit values, for computing a [-1,1] position index easily (Only required to calibrate analog joystick).
103 * It seems that these values must been calibrated for each joystick model.
104 *
105 * \sa getJoystickPosition
106 */
107 #ifdef MRPT_OS_WINDOWS
108void setLimits( int x_min = 0,int x_max = 0xFFFF, int y_min=0,int y_max = 0xFFFF,int z_min=0,int z_max = 0xFFFF );
109 #else
110void setLimits( int x_min = -32767,int x_max = 32767, int y_min=-32767,int y_max = 32767,int z_min=-32767,int z_max = 32767);
111 #endif
112 }; // End of class def.
113
114 } // End of namespace
115 } // End of namespace
116
117#endif
Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013