FakeJoypad : fake device implementing the device interface
More...
#include <fake/fakeJoypad/FakeJoypad.h>
Inheritance diagram for FakeJoypad:Public Member Functions | |
| FakeJoypad () | |
| virtual | ~FakeJoypad () |
| bool | open (yarp::os::Searchable &config) override |
| Open the DeviceDriver. | |
| bool | close () override |
| Close the DeviceDriver. | |
| yarp::dev::ReturnValue | getAxisCount (size_t &axis_count) override |
| Get number of axes. | |
| yarp::dev::ReturnValue | getButtonCount (size_t &button_count) override |
| Get number of buttons. | |
| yarp::dev::ReturnValue | getHatCount (size_t &hat_count) override |
| Get number of hats. | |
| yarp::dev::ReturnValue | getTrackballCount (size_t &trackball_count) override |
| Get number of trackballs. | |
| yarp::dev::ReturnValue | getTouchSurfaceCount (size_t &touch_count) override |
| Get the number of touch surface. | |
| yarp::dev::ReturnValue | getStickCount (size_t &stick_count) override |
| Get the number of the sticks. | |
| yarp::dev::ReturnValue | getButton (size_t button_id, double &value) override |
| Get the value of a button. | |
| yarp::dev::ReturnValue | getTrackball (size_t trackball_id, yarp::dev::TrackballData &value) override |
| Get the axes change of a Trackball. | |
| yarp::dev::ReturnValue | getHat (size_t hat_id, unsigned char &value) override |
| Get the value of an Hat. | |
| yarp::dev::ReturnValue | getAxis (size_t axis_id, double &value) override |
| Get the value of an axis if present, return false otherwise. | |
| yarp::dev::ReturnValue | getStick (size_t stick_id, yarp::dev::StickData &value, JoypadCtrl_coordinateMode coordinate_mode) override |
| Get the value of a stick if present, return false otherwise. | |
| yarp::dev::ReturnValue | getTouch (size_t touch_id, std::vector< yarp::dev::TouchData > &value) override |
| Get the value of a touch if present, return false otherwise. | |
Public Member Functions inherited from yarp::dev::IJoypadController | |
| virtual | ~IJoypadController () |
| Destructor. | |
| virtual yarp::dev::ReturnValue | getAllAxes (std::vector< double > &values) |
| Get the values of all available joystick axes. | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
| DeviceDriver () | |
| DeviceDriver (const DeviceDriver &other)=delete | |
| DeviceDriver (DeviceDriver &&other) noexcept=delete | |
| DeviceDriver & | operator= (const DeviceDriver &other)=delete |
| DeviceDriver & | operator= (DeviceDriver &&other) noexcept=delete |
| virtual | ~DeviceDriver () |
| virtual std::string | id () const |
| Return the id assigned to the PolyDriver. | |
| virtual void | setId (const std::string &id) |
| Set the id for this device. | |
| template<class T > | |
| bool | view (T *&x) |
| Get an interface to the device driver. | |
| virtual DeviceDriver * | getImplementation () |
| Some drivers are bureaucrats, pointing at others. | |
Public Member Functions inherited from FakeJoypad_ParamsParser | |
| FakeJoypad_ParamsParser () | |
| ~FakeJoypad_ParamsParser () override=default | |
| bool | parseParams (const yarp::os::Searchable &config) override |
| Parse the DeviceDriver parameters. | |
| std::string | getDeviceClassName () const override |
| Get the name of the DeviceDriver class. | |
| std::string | getDeviceName () const override |
| Get the name of the device (i.e. | |
| std::string | getDocumentationOfDeviceParams () const override |
| Get the documentation of the DeviceDriver's parameters. | |
| std::vector< std::string > | getListOfParams () const override |
| Return a list of all params used by the device. | |
| bool | getParamValue (const std::string ¶mName, std::string ¶mValue) const override |
| Return the value (represented as a string) of the requested parameter. | |
| std::string | getConfiguration () const override |
| Return the configuration of the device. | |
Public Member Functions inherited from yarp::dev::IDeviceDriverParams | |
| virtual | ~IDeviceDriverParams () |
Additional Inherited Members | |
Public Types inherited from yarp::dev::IJoypadController | |
| enum class | JoypadCtrl_coordinateMode { JypCtrlcoord_POLAR = 0 , JypCtrlcoord_CARTESIAN = 1 } |
Public Attributes inherited from FakeJoypad_ParamsParser | |
| const std::string | m_device_classname = {"FakeJoypad"} |
| const std::string | m_device_name = {"fakeJoypad"} |
| bool | m_parser_is_strict = false |
| const parser_version_type | m_parser_version = {} |
| std::string | m_provided_configuration |
| const std::string | m_rpc_port_name_defaultValue = {"/fakeJoypad/rpc"} |
| std::string | m_rpc_port_name = {"/fakeJoypad/rpc"} |
FakeJoypad : fake device implementing the device interface
Parameters required by this device are shown in class: FakeJoypad_ParamsParser
Definition at line 21 of file FakeJoypad.h.
| FakeJoypad::FakeJoypad | ( | ) |
Definition at line 22 of file FakeJoypad.cpp.
|
virtual |
Definition at line 27 of file FakeJoypad.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 38 of file FakeJoypad.cpp.
|
overridevirtual |
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 90 of file FakeJoypad.cpp.
|
overridevirtual |
Get number of axes.
| axes_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 43 of file FakeJoypad.cpp.
|
overridevirtual |
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 79 of file FakeJoypad.cpp.
|
overridevirtual |
Get number of buttons.
| button_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 49 of file FakeJoypad.cpp.
|
overridevirtual |
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 137 of file FakeJoypad.cpp.
|
overridevirtual |
Get number of hats.
| Hat_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 61 of file FakeJoypad.cpp.
|
overridevirtual |
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 mode. |
Implements yarp::dev::IJoypadController.
Definition at line 101 of file FakeJoypad.cpp.
|
overridevirtual |
Get the number of the sticks.
| stick_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 73 of file FakeJoypad.cpp.
|
overridevirtual |
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 121 of file FakeJoypad.cpp.
|
overridevirtual |
Get the number of touch surface.
Multiple touch surface can represent 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 67 of file FakeJoypad.cpp.
|
overridevirtual |
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 148 of file FakeJoypad.cpp.
|
overridevirtual |
Get number of trackballs.
| Trackball_count | unsigned int reference that will contain the result. |
Implements yarp::dev::IJoypadController.
Definition at line 55 of file FakeJoypad.cpp.
|
overridevirtual |
Open the DeviceDriver.
| config | is a list of parameters for the device. Which parameters are effective for your device can vary. 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 31 of file FakeJoypad.cpp.