SDLJoypad
: Device that reads inputs of Joypads compatible with the SDL library.
More...
#include <SDLJoypad/SDLJoypad.h>
Public Member Functions | |
SDLJoypad () | |
virtual | ~SDLJoypad () |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. More... | |
bool | close () override |
Close the DeviceDriver. More... | |
bool | getRawAxisCount (unsigned int &axis_count) override |
bool | getRawButtonCount (unsigned int &button_count) override |
bool | getRawHatCount (unsigned int &hat_count) override |
bool | getRawTrackballCount (unsigned int &trackball_count) override |
bool | getRawTouchSurfaceCount (unsigned int &touch_count) override |
bool | getRawStickCount (unsigned int &stick_count) override |
bool | getRawStickDoF (unsigned int stick_id, unsigned int &DoF) override |
bool | getRawButton (unsigned int button_id, float &value) override |
bool | getRawTrackball (unsigned int trackball_id, yarp::sig::Vector &value) override |
bool | getRawHat (unsigned int hat_id, unsigned char &value) override |
bool | getRawAxis (unsigned int axis_id, double &value) override |
bool | getRawStick (unsigned int stick_id, yarp::sig::Vector &value, JoypadCtrl_coordinateMode coordinate_mode) override |
bool | getRawTouch (unsigned int touch_id, yarp::sig::Vector &value) override |
![]() | |
bool | getAxisCount (unsigned int &axis_count) override final |
Get number of Axes. More... | |
bool | getButtonCount (unsigned int &button_count) override final |
Get number of Buttons. More... | |
bool | getTrackballCount (unsigned int &Trackball_count) override final |
Get number of trackballs. More... | |
bool | getHatCount (unsigned int &Hat_count) override final |
Get number of Hats. More... | |
bool | getTouchSurfaceCount (unsigned int &touch_count) override final |
get the number of touch surface. More... | |
bool | getStickCount (unsigned int &stick_count) override final |
get the number of the sticks More... | |
bool | getStickDoF (unsigned int stick_id, unsigned int &DoF) override final |
Get the Degree Of Freedom count for desired stick. More... | |
bool | getButton (unsigned int button_id, float &value) override final |
Get the value of a button. More... | |
bool | getTrackball (unsigned int trackball_id, yarp::sig::Vector &value) override final |
Get the axes change of a Trackball. More... | |
bool | getHat (unsigned int hat_id, unsigned char &value) override final |
Get the value of an Hat. More... | |
bool | getAxis (unsigned int axis_id, double &value) override final |
Get the value of an axis if present, return false otherwise. More... | |
bool | getStick (unsigned int stick_id, yarp::sig::Vector &value, JoypadCtrl_coordinateMode coordinate_mode) override final |
Get the value of a stick if present, return false otherwise. More... | |
bool | getTouch (unsigned int touch_id, yarp::sig::Vector &value) override final |
Get the value of a touch if present, return false otherwise. More... | |
IJoypadEventDriven () | |
IJoypadEventDriven (int rate) | |
IJoypadEventDriven (double period) | |
bool | threadInit () override final |
Initialization method. More... | |
void | run () override final |
Loop function. More... | |
bool | eventDriven (bool enable, yarp::dev::IJoypadEvent *event=nullptr) override |
Activate event Driven mode. More... | |
bool | isEventDriven () override |
![]() | |
virtual | ~IJoypadController () |
Destructor. More... | |
![]() | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. More... | |
![]() | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
Additional Inherited Members | |
![]() | |
enum | JoypadCtrl_coordinateMode |
![]() | |
enum | JoypadCtrl_coordinateMode { JypCtrlcoord_POLAR = 0, JypCtrlcoord_CARTESIAN = 1 } |
![]() | |
virtual bool | executeAction (int action_id) |
virtual bool | parseActions (const yarp::os::Searchable &cfg, int *count=nullptr) |
![]() | |
virtual bool | parseActions (const yarp::os::Searchable &cfg, int *count=nullptr) |
virtual bool | executeAction (int action_id) |
![]() | |
std::map< int, std::string > | m_actions |
![]() | |
std::map< int, std::string > | m_actions |
SDLJoypad
: Device that reads inputs of Joypads compatible with the SDL library.
Parameters accepted in the config argument of the open method:
Parameter name | Type | Units | Default Value | Required | Description | Notes |
---|---|---|---|---|---|---|
UseAllJoypadAsOne | string | if there are more than one joypad connected | merge together multiple joypad | set it to 1 to have all the connected joypad as one | ||
DefaultJoystickNumber | string | will be asked | No | select the id of the joypad to use | important if there are more than one joypad and UseAllJoypadAsOne is set to 0. if not present, a input will be requested to the user | |
sticks | int | Yes | count of sticks to configure | for each stick there must be a group called STICK<id here> with data on the axis to be configured as stickl | ||
STICK[ID] | group | depending on 'sticks' parameter | group containing axes data for this stick | |||
axes | int | yes | axes count for this stick | set it for each stick in the proper stick group | ||
axis[ID]_id | int | depending on axes parameter | axis id for current stick related axis | set it for each stick in the proper stick group | ||
invert_axis_[ID] | bool | false | no | invert the current axis | set it for each stick in the proper stick group | |
deadZone | double | 0.0 | yes | set the deadzone for this stick | set it for each stick in the proper stick group |
Definition at line 61 of file SDLJoypad.h.
|
default |
|
virtualdefault |
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 262 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 363 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 267 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 314 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 273 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 410 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 285 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 379 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 297 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 303 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 405 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 291 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 432 of file SDLJoypad.cpp.
|
overridevirtual |
Implements yarp::dev::IJoypadEventDriven.
Definition at line 279 of file SDLJoypad.cpp.
|
overridevirtual |
Open the DeviceDriver.
config | is a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 44 of file SDLJoypad.cpp.