#include <yarp/dev/IJoypadController.h>
Public Types | |
enum | JoypadCtrl_coordinateMode |
![]() | |
enum | JoypadCtrl_coordinateMode { JypCtrlcoord_POLAR = 0 , JypCtrlcoord_CARTESIAN = 1 } |
Protected Member Functions | |
virtual bool | getRawAxisCount (unsigned int &axis_count)=0 |
virtual bool | getRawButtonCount (unsigned int &button_count)=0 |
virtual bool | getRawTrackballCount (unsigned int &Trackball_count)=0 |
virtual bool | getRawHatCount (unsigned int &Hat_count)=0 |
virtual bool | getRawTouchSurfaceCount (unsigned int &touch_count)=0 |
virtual bool | getRawStickCount (unsigned int &stick_count)=0 |
virtual bool | getRawStickDoF (unsigned int stick_id, unsigned int &DoF)=0 |
virtual bool | getRawButton (unsigned int button_id, float &value)=0 |
virtual bool | getRawTrackball (unsigned int trackball_id, yarp::sig::Vector &value)=0 |
virtual bool | getRawHat (unsigned int hat_id, unsigned char &value)=0 |
virtual bool | getRawAxis (unsigned int axis_id, double &value)=0 |
virtual bool | getRawStick (unsigned int stick_id, yarp::sig::Vector &value, JoypadCtrl_coordinateMode coordinate_mode)=0 |
virtual bool | getRawTouch (unsigned int touch_id, yarp::sig::Vector &value)=0 |
virtual bool | executeAction (int action_id) |
virtual bool | parseActions (const yarp::os::Searchable &cfg, int *count=nullptr) |
Protected Attributes | |
std::map< int, std::string > | m_actions |
![]() | |
std::map< int, std::string > | m_actions |
Definition at line 203 of file IJoypadController.h.
Definition at line 30 of file IJoypadController.h.
yarp::dev::IJoypadEventDriven::IJoypadEventDriven | ( | ) |
Definition at line 21 of file IJoypadController.cpp.
|
explicit |
Definition at line 24 of file IJoypadController.cpp.
|
explicit |
Definition at line 26 of file IJoypadController.cpp.
|
overridevirtual |
Activate event Driven mode.
enable | a bool to turn on or off the eventDriven mode. |
event | a pointer to a valid yarp::dev::IJoypadEvent object whom action() method will be called on event detection. |
Reimplemented from yarp::dev::IJoypadController.
Definition at line 237 of file IJoypadController.cpp.
Reimplemented from yarp::dev::IJoypadController.
Definition at line 36 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get the value of an axis if present, return false otherwise.
axis_id | Id of the axis to get. must be > -1 && < getAxisCount(), return false otherwise. |
value | reference to be valued. the absolute boundaries for the values should be -1.0 and 1.0 However the actual range depends on the physical device (example: analog trigger does not have a central position thus can give a value from 0.0 to 0.1). |
Implements yarp::dev::IJoypadController.
Definition at line 358 of file IJoypadController.cpp.
Get number of axes.
axes_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 286 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get the value of a button.
From 0-unpressed to 1-fullpressed and values in the middle in the analog-face-button case.
button_id | Id of the button to get. Must be > -1 && < getButtonCount(), return false otherwise |
value | reference to be valued. The value will be from 0.0 (not even touched) to 1.0 (fully pressed) |
Implements yarp::dev::IJoypadController.
Definition at line 326 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get number of buttons.
button_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 291 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get the value of an Hat.
hat_id | Id of the POV hat to get. Must be > -1 && < getHatCount(), return false otherwise. |
value | reference to be valued. use the YRPJOY_HAT_ macro series to get the currently pressed directions. |
Implements yarp::dev::IJoypadController.
Definition at line 347 of file IJoypadController.cpp.
Get number of hats.
Hat_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 301 of file IJoypadController.cpp.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
protectedpure virtual |
Implemented in FakeJoypad, JoypadControlClient, and SDLJoypad.
|
finaloverridevirtual |
Get the value of a stick if present, return false otherwise.
stick_id | Id of the stick to get. must be > -1 && < getStickCount(), return false otherwise. |
value | a vector that will contain the joystick position. the size of the vector will give you the Number of degrees of freedom and the value will be from -1.0 to 1.0. |
coordinate_mode | to get data in cartesian mode or polar (spheric in 3 dof position cases) mode. |
Implements yarp::dev::IJoypadController.
Definition at line 369 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get the number of the sticks.
stick_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 311 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get the Degree Of Freedom count for desired stick.
stick_id | Id of the stick. must be > -1 && < getStickCount(), return false otherwise. |
DoF | an unsigned int reference that will contain the value. |
Implements yarp::dev::IJoypadController.
Definition at line 316 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get the value of a touch if present, return false otherwise.
value | a vector that will contain the touch values normalized from 0.0 to 1.0. |
Implements yarp::dev::IJoypadController.
Definition at line 380 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get the number of touch surface.
Multiple touch surface can rappresent either multiple physical monotouch surface or a multitouch surface or a combination of the two.
touch_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 306 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get the axes change of a Trackball.
trackball_id | Id of the Trackball to get. Must be > -1 && < getTrackballCount(), return false otherwise. |
value | reference to be valued. the value will be from 0.0 (not moving) to 1.0 (full velocity). |
Implements yarp::dev::IJoypadController.
Definition at line 336 of file IJoypadController.cpp.
|
finaloverridevirtual |
Get number of trackballs.
Trackball_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 296 of file IJoypadController.cpp.
|
inlineoverridevirtual |
Reimplemented from yarp::dev::IJoypadController.
Definition at line 269 of file IJoypadController.h.
|
protectedvirtual |
Reimplemented from yarp::dev::IJoypadController.
Definition at line 35 of file IJoypadController.cpp.
|
finaloverridevirtual |
Loop function.
This is the thread itself. The thread calls the run() function every <period> ms. At the end of each run, the thread will sleep the amounth of time required, taking into account the time spent inside the loop function. Example: requested period is 10ms, the run() function take 3ms to be executed, the thread will sleep for 7ms.
Note: after each run is completed, the thread will call a yield() in order to facilitate other threads to run.
Implements yarp::os::PeriodicThread.
Definition at line 125 of file IJoypadController.cpp.
|
finaloverridevirtual |
Initialization method.
The thread executes this function when it starts and before "run". This is a good place to perform initialization tasks that need to be done by the thread itself (device drivers initialization, memory allocation etc). If the function returns false the thread quits and never calls "run". The return value of threadInit() is notified to the class and passed as a parameter to afterStart(). Note that afterStart() is called by the same thread that is executing the "start" method.
Reimplemented from yarp::os::PeriodicThread.
Definition at line 59 of file IJoypadController.cpp.
|
protected |
Definition at line 33 of file IJoypadController.h.